diff options
author | Matthias Benkard <code@mail.matthias.benkard.de> | 2008-02-12 12:27:33 +0100 |
---|---|---|
committer | Matthias Benkard <code@mail.matthias.benkard.de> | 2008-02-12 12:27:33 +0100 |
commit | 249183c4df86e7cd1939fd821ad60b4fe5ba02e5 (patch) | |
tree | a9ab34cd081dbfedc637fe1e0e9cc40f5c6f86d4 /Lisp/internal-utilities.lisp | |
parent | 7a417274fbc5913ccc288f06842345ff494363df (diff) |
Fix the most recent incarnation of PRIMITIVE-INVOKE.
darcs-hash:a5115916c06851aae810945c7e4844bb26106ba5
Diffstat (limited to 'Lisp/internal-utilities.lisp')
-rw-r--r-- | Lisp/internal-utilities.lisp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Lisp/internal-utilities.lisp b/Lisp/internal-utilities.lisp index 1c54068..9be74a9 100644 --- a/Lisp/internal-utilities.lisp +++ b/Lisp/internal-utilities.lisp @@ -27,6 +27,22 @@ (member symbol *features*)) +(defun objc-null (value) + (or (null value) + (and (typep value 'c-pointer-wrapper) + (objc-pointer-null (pointer-to value))))) + + +(defmacro objc-or (&rest forms) + (let ((sym (gensym))) + `(let ((,sym ,(first forms))) + (if (objc-null ,sym) + ,(if (rest forms) + `(objc-or ,@(rest forms)) + 'nil) + ,sym)))) + + (defmacro with-foreign-string-pool ((register-fn-name) &body body) (let ((pool-var (gensym))) `(let ((,pool-var (list))) |