X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=contrib%2Fsb-posix%2Fmacros.lisp;h=018ff62de337c057e5834bb152f9204001b40b29;hb=ad6345c0021507c8830c7c8541ed651a89792335;hp=dd22a7c943bdf7c3d906f3bd4542228261f475ad;hpb=8e9908b6f79b7bb52a281cfcbf0712d4b914f3cf;p=sbcl.git diff --git a/contrib/sb-posix/macros.lisp b/contrib/sb-posix/macros.lisp index dd22a7c..018ff62 100644 --- a/contrib/sb-posix/macros.lisp +++ b/contrib/sb-posix/macros.lisp @@ -25,20 +25,29 @@ (let ((root (if (eql #\_ (char name 0)) (subseq name 1) name))) (intern (substitute #\- #\_ (string-upcase root)) :sb-posix))))) +;; Note: this variable is set in interface.lisp. defined here for +;; clarity and so the real-c-name compile as desired. +(defparameter *c-functions-in-runtime* nil) + (defun real-c-name (name) - (etypecase name - (list - (destructuring-bind (name &key c-name options) name - (if c-name - c-name - (cond #+largefile - ((or (eql options :largefile) - (member :largefile options)) - (format nil "~a_largefile" name)) - (t - name))))) - (string - name))) + (let ((maybe-name + (etypecase name + (list + (destructuring-bind (name &key c-name options) name + (if c-name + c-name + (cond #+largefile + ((or (eql options :largefile) + (member :largefile options)) + (format nil "~a_largefile" name)) + (t + name))))) + (string + name)))) + (if (member maybe-name *c-functions-in-runtime* + :test #'string=) + (format nil "_~A" maybe-name) + maybe-name))) (defmacro define-call-internally (lisp-name c-name return-type error-predicate &rest arguments)