X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=contrib%2Fsb-grovel%2Fdef-to-lisp.lisp;h=7549b86e230624893798da146077ebb9cc654fbd;hb=6bbc22725d3bf663726ed9adca544e39316364a6;hp=f2621dac266c5a62f1847a56f4724be3a3381802;hpb=c3fa52250b540c0b859fd3beb80cf147108f0fc6;p=sbcl.git diff --git a/contrib/sb-grovel/def-to-lisp.lisp b/contrib/sb-grovel/def-to-lisp.lisp index f2621da..7549b86 100644 --- a/contrib/sb-grovel/def-to-lisp.lisp +++ b/contrib/sb-grovel/def-to-lisp.lisp @@ -112,10 +112,12 @@ code: (dolist (def definitions) (destructuring-bind (type lispname cname &optional doc export) def (case type - (:integer + ((:integer :errno) (as-c "#ifdef" cname) (printf "(cl:defconstant ~A %d \"~A\")" lispname doc cname) + (when (eql type :errno) + (printf "(cl:setf (get '~A 'errno) t)" lispname)) (as-c "#else") (printf "(sb-int:style-warn \"Couldn't grovel for ~A (unknown to the C compiler).\")" cname) (as-c "#endif")) @@ -153,8 +155,8 @@ code: (defclass grovel-constants-file (asdf:cl-source-file) ((package :accessor constants-package :initarg :package) (do-not-grovel :accessor do-not-grovel - :initform nil - :initarg :do-not-grovel))) + :initform nil + :initarg :do-not-grovel))) (define-condition c-compile-failed (compile-failed) () (:report (lambda (c s) @@ -187,7 +189,8 @@ code: (funcall (intern "C-CONSTANTS-EXTRACT" (find-package "SB-GROVEL")) filename tmp-c-source (constants-package component)) (unless (do-not-grovel component) - (let* ((cc (or (sb-ext:posix-getenv "CC") + (let* ((cc (or (and (string/= (sb-ext:posix-getenv "CC") "") + (sb-ext:posix-getenv "CC")) ;; It might be nice to include a CONTINUE or ;; USE-VALUE restart here, but ASDF seems to insist ;; on handling the errors itself.