Files
sx/examples/1224-ffi-extern-fn-rename.sx
agra 811a280517 refactor(ffi-linkage): Phase 9.3 — purge 'foreign' from comments (src caps + examples + docs)
src/: ~21 capital-Foreign comments the case-sensitive verify grep missed
(Foreign-class→Runtime-class, Foreign path→Runtime path, Foreign decls→Extern decls,
FOREIGN function→extern function) across calls/inst/ffi_objc/jni_descriptor/emit_llvm/
c_import/lower.*/ops. src 'foreign' now = ONLY the hash_foreign token + 4 rejection
messages (9.0-delete targets). examples/*.sx comments → extern/runtime-class (1219
stdout regen; KEPT 1176). docs/inline-asm-design + debugger purged. Comments only —
no build impact. 9.0 ratified: DELETE hash_foreign token next.
2026-06-15 10:52:56 +03:00

14 lines
458 B
Plaintext

// extern with a "csym" rename (FFI-linkage stream, Phase 1.2): the sx name
// `c_abs` binds C's `abs` via the optional symbol-name override after the
// `extern` keyword — mirrors `extern "abs"`. The optional `LIB` ident slot
// (extern_lib) sits before the string; here it's omitted (libc is
// default-linked).
#import "modules/std.sx";
c_abs :: (n: i32) -> i32 extern "abs";
main :: () -> i32 {
print("c_abs(-42) = {}\n", c_abs(xx -42));
0
}