X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Flate-format.lisp;h=9b339c616351522d5a74a83b97eb0c42ca0be9f2;hb=dbe82b489260b2ef76e916d0aeaee8b3850f5f52;hp=2fc0f3a09972b5e2099d8b1c503e3fe057de239e;hpb=08d05510b51708853ca998154d8096b21d85edab;p=sbcl.git diff --git a/src/code/late-format.lisp b/src/code/late-format.lisp index 2fc0f3a..9b339c6 100644 --- a/src/code/late-format.lisp +++ b/src/code/late-format.lisp @@ -279,8 +279,7 @@ (let ((char (format-directive-character directive))) (typecase char (base-char - (aref *format-directive-expanders* (char-code char))) - (character nil)))) + (aref *format-directive-expanders* (sb!xc:char-code char)))))) (*default-format-error-offset* (1- (format-directive-end directive)))) (declare (type (or null function) expander)) @@ -350,8 +349,8 @@ ;;;; format directive machinery -;;; FIXME: only used in this file, could be SB!XC:DEFMACRO in EVAL-WHEN -(defmacro def-complex-format-directive (char lambda-list &body body) +(eval-when (:compile-toplevel :execute) +(#+sb-xc-host defmacro #-sb-xc-host sb!xc:defmacro def-complex-format-directive (char lambda-list &body body) (let ((defun-name (intern (format nil "~:@(~:C~)-FORMAT-DIRECTIVE-EXPANDER" char))) @@ -370,8 +369,7 @@ ,@body))) (%set-format-directive-expander ,char #',defun-name)))) -;;; FIXME: only used in this file, could be SB!XC:DEFMACRO in EVAL-WHEN -(defmacro def-format-directive (char lambda-list &body body) +(#+sb-xc-host defmacro #-sb-xc-host sb!xc:defmacro def-format-directive (char lambda-list &body body) (let ((directives (sb!xc:gensym "DIRECTIVES")) (declarations nil) (body-without-decls body)) @@ -385,17 +383,18 @@ ,@declarations (values (progn ,@body-without-decls) ,directives)))) +) ; EVAL-WHEN (eval-when (#-sb-xc :compile-toplevel :load-toplevel :execute) (defun %set-format-directive-expander (char fn) - (setf (aref *format-directive-expanders* (char-code (char-upcase char))) fn) + (let ((code (sb!xc:char-code (char-upcase char)))) + (setf (aref *format-directive-expanders* code) fn)) char) (defun %set-format-directive-interpreter (char fn) - (setf (aref *format-directive-interpreters* - (char-code (char-upcase char))) - fn) + (let ((code (sb!xc:char-code (char-upcase char)))) + (setf (aref *format-directive-interpreters* code) fn)) char) (defun find-directive (directives kind stop-at-semi)