diff --git a/specs.md b/specs.md index 3092839..4b1d5f1 100644 --- a/specs.md +++ b/specs.md @@ -1206,7 +1206,7 @@ write_fd :: (fd: i32, buf: [*]u8, count: u64) -> i64 #foreign libc "write"; ``` - `#library "name"` must be assigned to a named constant. The library is passed to the linker (`-lname` on Unix, `name.lib` on Windows). -- `#foreign lib_ref` declares a function as external C. The library reference is mandatory. +- `#foreign lib_ref` declares a function as external C. The library reference is optional: when present it is passed to the linker (`-lname` on Unix); when omitted (`name :: (…) -> T #foreign;`), the symbol must resolve at link time from a framework or an already-linked / auto-detected library. - `#foreign lib_ref "c_symbol"` renames the binding: the sx function name differs from the C symbol. This avoids name collisions (e.g. POSIX `write` vs an sx builtin). ### C Interop Type Mapping