Files
sx/examples/1225-ffi-extern-global.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

16 lines
610 B
Plaintext

// extern data global (FFI-linkage stream, Phase 1.2): reference a symbol
// defined elsewhere (here libSystem's __stdinp) via the bare `extern`
// linkage modifier on a typed var decl — the extern-named counterpart of
// `<name> : <type> extern;` (see examples/1205). The optional
// `extern [LIB] ["csym"]` tail mirrors the fn form; bare here (the sx name
// IS the C symbol, resolved against the default-linked libSystem).
#import "modules/std.sx";
__stdinp : *void extern;
main :: () -> i32 {
addr_bits : u64 = xx @__stdinp;
print("stdin extern global non-null: {}\n", addr_bits != 0);
0
}