Capital-Foreign + stale-identifier comment refs: library (Foreign Java types→Runtime, foreign-class→runtime-class, foreign_class_map→runtime_class_map); docs/debugger (foreign call→extern call); docs/fork-c ledger (foreign_class_map, protocol/foreign→ runtime-class); docs/inline-asm-design Deviation-6 obsolete #foreign-vs-extern design RESOLVED to the landed extern/export reality; example comments (parseForeignClassDecl→ parseRuntimeClassDecl, checkForeignRefs→checkExternRefs, Foreign decls→Extern). Docs/ comments only — no build impact.
24 lines
630 B
Plaintext
24 lines
630 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. EXTERN FUNCTION BINDING
|
|
// ========================================================
|
|
print("=== 15. Extern ===\n");
|
|
|
|
// Symbol rename: c_abs maps to C's abs()
|
|
print("extern-rename: {}\n", c_abs(xx -42));
|
|
}
|