Commit5cc8942eRecorded1 Mar 2026Repositorysigil-socket

Fix Windows build: use define-native for unix-connect

Message

unix-connect is only registered by the C runtime on non-Windows platforms. Using %set-docstring! on the unbound symbol caused a load failure. define-native creates a safe #f placeholder when the native function isn't available.

Changed
 src/sigil/socket.sgl | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Diff
src/sigil/socket.sglmodified
@@ -274,13 +274,13 @@
274
;;; Connect to a Unix domain socket.
275
;;;
276
;;; Returns a socket on success, or `#f` on failure.
277
;;; Note: Not available on Windows.
+277
;;; Not available on Windows.
278
;;;
279
;;; ```scheme
280
;;; (unix-connect "/var/run/docker.sock") ; => #<socket>
281
;;; ```
282
(%set-docstring! unix-connect)
283
(%set-spec! unix-connect '(string? -> (maybe socket?)))
+282
(define-native (unix-connect path)
+283
(: string? -> (maybe socket?)))
284
285
;; ========== Higher-Level Utilities ==========
286