Changeset 14769
- Timestamp:
- May 2, 2011, 11:31:56 AM (14 years ago)
- File:
-
- 1 edited
-
trunk/source/lib/macros.lisp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/lib/macros.lisp
r14741 r14769 3115 3115 `(foreign-type-ordinal (load-time-value (%foreign-type-or-record ',record-name)))))) 3116 3116 (when (eq *host-backend* *target-backend*) 3117 (setq result (nconc result `(( %set-macptr-type ,name,ordinal-form)))))3117 (setq result (nconc result `((setf (uvref ,name target::macptr.type-cell) ,ordinal-form))))) 3118 3118 (if (typep ftype 'foreign-record-type) 3119 3119 (setq result … … 3209 3209 ,ptr))) 3210 3210 3211 3211 (defun with-constrained-values (type specs body env) 3212 (multiple-value-bind (body decls) (parse-body body env) 3213 (collect ((inits)) 3214 (dolist (spec specs) 3215 (when (cdr spec) 3216 (inits `(setq ,(car spec) ,(cadr spec))))) 3217 (let* ((vector (gensym)) 3218 (idx -1)) 3219 `(let* ((,vector (make-array ,(length specs) :element-type ',type))) 3220 (declare (dynamic-extent ,vector)) 3221 (symbol-macrolet ,(mapcar (lambda (spec) `(,(car spec) (aref ,vector ,(incf idx)))) specs) 3222 ,@decls 3223 ,@(inits) 3224 ,@body)))))) 3225 3226 (defmacro with-constrained-double-floats (specs &body body &environment env) 3227 (with-constrained-values 'double-float specs body env)) 3228 3229 3230 (defmacro with-constrained-single-floats (specs &body body &environment env) 3231 (with-constrained-values 'single-float specs body env)) 3212 3232 3213 3233 (defmacro with-terminal-input (&body body)
Note:
See TracChangeset
for help on using the changeset viewer.
