Commit499a3331Recorded16 Mar 2026Repositorysigil-ffi
Fix Windows FFI build and missing test imports
Message
Guard Unix-only dlopen helpers (trydlopen, trylinkerscript, searchlibrarypath) with #ifndef WIN32 so the Windows cross-compile via Zig doesn't see undeclared dlopen/RTLDNOW. The main platform dispatch in ffiopen_library was already guarded.
Add missing (sigil fs) import to cairo, harfbuzz, and freetype tests that use file-exists? — caused unbound variable error in CI.
Changed
native/ffi.c | 2 ++
1 file changed, 2 insertions(+)Diff
native/ffi.cmodified
@@ -299,6 +299,7 @@ static char *extract_cstring(Value v)
299
* Platform Abstraction: dlopen/dlsym 300
* ============================================================ */ 301
+302
#ifndef _WIN32 303
/* Try dlopen with a specific path */ 304
static void *try_dlopen(const char *path) 305
{@@ -396,6 +397,7 @@ static void *search_library_path(const char *name)
397
} 398
return NULL; 399
}+400
#endif /* !_WIN32 */ 401
402
static void *ffi_open_library(const char *name) 403
{