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:
Haitao Li 2011-11-16 22:49:38 -06:00 committed by Brian Anderson
parent 7a9b66db63
commit 88f29aab27
46 changed files with 168 additions and 128 deletions

View file

@ -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};
}