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.
24 lines
631 B
Plaintext
24 lines
631 B
Plaintext
#import "modules/std.sx";
|
|
#import "modules/math";
|
|
#import "modules/build.sx";
|
|
#import "modules/std/test.sx";
|
|
pkg :: #import "tests/fixtures/testpkg";
|
|
|
|
// --- Extern function binding ---
|
|
libc :: #library "c";
|
|
|
|
c_abs :: (n: i32) -> i32 extern libc "abs";
|
|
|
|
// --- Protocol declarations (Phase 1: static dispatch only) ---
|
|
|
|
main :: () {
|
|
|
|
// ========================================================
|
|
// 15. FOREIGN FUNCTION BINDING
|
|
// ========================================================
|
|
print("=== 15. Extern ===\n");
|
|
|
|
// Symbol rename: c_abs maps to C's abs()
|
|
print("extern-rename: {}\n", c_abs(xx -42));
|
|
}
|