X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=src%2Fobjects.lisp;h=46b72752dcc79b52b0a0f1944ad61eaee63f7ef6;hb=d25878a6a15d78719a44ba21534b24a11e03628f;hp=cc4a9fef6ca25a06beb7221b6644e496cfd81196;hpb=3ade95bab16abe09642554e9cbf56f117f01e507;p=uffi.git diff --git a/src/objects.lisp b/src/objects.lisp index cc4a9fe..46b7275 100644 --- a/src/objects.lisp +++ b/src/objects.lisp @@ -242,6 +242,11 @@ an array of TYPE with size SIZE. The TYPE parameter is evaluated." '(error "WITH-CAST-POINTER not (yet) implemented for ~A" (lisp-implementation-type))) + (defmacro convert-external-name (name) + "Add an underscore to NAME if necessary for the ABI." + #+macosx `(concatenate 'string "_" ,name) + #-macosx name) + (defmacro def-foreign-var (names type module) #-lispworks (declare (ignore module)) (let ((foreign-name (if (atom names) names (first names))) @@ -255,7 +260,7 @@ an array of TYPE with size SIZE. The TYPE parameter is evaluated." #+allegro `(define-symbol-macro ,lisp-name (ff:fslot-value-typed (quote ,(convert-from-uffi-type type :deref)) - :c (ff:get-entry-point ,foreign-name))) + :c (convert-external-name (ff:get-entry-point ,foreign-name)))) #+lispworks `(progn (fli:define-foreign-variable (,lisp-name ,foreign-name)