From 6f224be39466130691391f074b0307f715ec38c1 Mon Sep 17 00:00:00 2001 From: Nikodemus Siivola Date: Sun, 5 Sep 2010 12:27:59 +0300 Subject: [PATCH] fix iolib.os on Darwin * PARSE-NAME-AND-OPTIONS used to return NIL as the foreign name if both a lisp name and a foreign name were specified, but the foreign name was unknown. In contrast if just a single foreign name was given, it would be returned without checking for availability. CFFI in turn would then loop in CFFI:FOREIGN-NAME, trying to deal with NIL. So: prefer known foreign names, but return one even if it is unknown. * Not all the DEFSYSCALL functions are available on Darwin, so this broke the build. --- src/syscalls/early.lisp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/syscalls/early.lisp b/src/syscalls/early.lisp index adf62c0..f231da5 100644 --- a/src/syscalls/early.lisp +++ b/src/syscalls/early.lisp @@ -144,8 +144,12 @@ (cffi::foreign-options spec nil))) (t (values (first spec) - (find-if #'foreign-symbol-pointer - (ensure-list (second spec))) + (let ((foreign-names (ensure-list (second spec)))) + ;; If there are multiple foreign names, pick the + ;; one that is available -- defaulting to the first + ;; one if all else fails. + (or (find-if #'foreign-symbol-pointer foreign-names) + (car foreign-names))) (cffi::foreign-options spec nil))))) -- 2.11.4.GIT