refactor(ffi-linkage): Phase 8 pre-cutover — migrate multi-file example companions
The Phase 7 batches globbed top-level examples/*.sx and missed #foreign decls in SUBDIRECTORY companion files. Migrate the 4 incidental fn decls (behavior-preserving): 0729/a.sx + b.sx (same-name 'absval' libc authors), 1617/c.sx (pcap_lib_version), 1623/mod.sx (unit_in_mod_answer) — all '#foreign LIB "csym";' → 'extern LIB "csym";'. Parents all marker'd → corpus-validated; empty snapshot diff. Comment lines left for Phase 9.3. Suite green (647/444).
This commit is contained in:
@@ -2,4 +2,4 @@
|
||||
// flat-importing BOTH must NOT see this as an ambiguous bare-call collision —
|
||||
// foreign authors are never rerouted by the bare-call resolver, so the call
|
||||
// falls to the existing first-wins foreign dispatch.
|
||||
absval :: (n: i32) -> i32 #foreign libc "abs";
|
||||
absval :: (n: i32) -> i32 extern libc "abs";
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
// The second flat author of `absval` — the identical `#foreign` libc binding.
|
||||
absval :: (n: i32) -> i32 #foreign libc "abs";
|
||||
absval :: (n: i32) -> i32 extern libc "abs";
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#import "modules/std.sx";
|
||||
|
||||
pcaplib :: #library "pcap";
|
||||
pcap_lib_version :: () -> ?cstring #foreign pcaplib "pcap_lib_version";
|
||||
pcap_lib_version :: () -> ?cstring extern pcaplib "pcap_lib_version";
|
||||
|
||||
pcap_version :: () -> string {
|
||||
p := pcap_lib_version();
|
||||
|
||||
@@ -5,6 +5,6 @@ cunit :: #import c {
|
||||
#source "inmod.c";
|
||||
};
|
||||
|
||||
unit_in_mod_answer :: () -> i32 #foreign cunit "unit_in_mod_answer";
|
||||
unit_in_mod_answer :: () -> i32 extern cunit "unit_in_mod_answer";
|
||||
|
||||
answer_via_mod :: () -> i32 { return unit_in_mod_answer(); }
|
||||
|
||||
Reference in New Issue
Block a user