Use attributes for native module ABI and link name
This patch changes how to specify ABI and link name of a native module.
Before:
native "cdecl" mod llvm = "rustllvm" {...}
After:
#[abi = "cdecl"]
#[link_name = "rustllvm"]
native mod llvm {...}
The old optional syntax for ABI and link name is no longer supported.
Fixes issue #547
This commit is contained in:
parent
7a9b66db63
commit
88f29aab27
46 changed files with 168 additions and 128 deletions
|
|
@ -45,8 +45,7 @@ fn fold_native_mod(cfg: ast::crate_cfg, nm: ast::native_mod,
|
|||
fld: fold::ast_fold) -> ast::native_mod {
|
||||
let filter = bind filter_native_item(cfg, _);
|
||||
let filtered_items = vec::filter_map(filter, nm.items);
|
||||
ret {native_name: nm.native_name,
|
||||
abi: nm.abi,
|
||||
ret {abi: nm.abi,
|
||||
view_items: vec::map(fld.fold_view_item, nm.view_items),
|
||||
items: filtered_items};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue