rust/src/test/run-pass/import-from-native.rs
Haitao Li 88f29aab27 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
2011-11-16 11:35:13 -08:00

14 lines
197 B
Rust

mod spam {
fn ham() { }
fn eggs() { }
}
#[abi = "cdecl"]
native mod rustrt {
import spam::{ham, eggs};
export ham;
export eggs;
}
fn main() { rustrt::ham(); rustrt::eggs(); }