X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Firrat.lisp;h=45aa0fb8ba04c1c73f9a5324e5ce3ba4c6e28f40;hb=b8f63d9b4e978bec3bfc1f4fc471e5ed946781fd;hp=9e71d15c8457b354c81a1137b5f927cae06db7db;hpb=a530bbe337109d898d5b4a001fc8f1afa3b5dc39;p=sbcl.git diff --git a/src/code/irrat.lisp b/src/code/irrat.lisp index 9e71d15..45aa0fb 100644 --- a/src/code/irrat.lisp +++ b/src/code/irrat.lisp @@ -11,36 +11,26 @@ ;;;; files for more information. (in-package "SB!KERNEL") - -(file-comment - "$Header$") ;;;; miscellaneous constants, utility functions, and macros (defconstant pi 3.14159265358979323846264338327950288419716939937511L0) ;(defconstant e 2.71828182845904523536028747135266249775724709369996L0) -;;; Make these INLINE, since the call to C is at least as compact as a Lisp -;;; call, and saves number consing to boot. -;;; -;;; FIXME: This should be (EVAL-WHEN (COMPILE-EVAL) (SB!XC:DEFMACRO ..)), -;;; I think. -(defmacro def-math-rtn (name num-args) - (let ((function (intern (concatenate 'simple-string - "%" - (string-upcase name))))) +;;; Make these INLINE, since the call to C is at least as compact as a +;;; Lisp call, and saves number consing to boot. +(eval-when (:compile-toplevel :execute) + +(sb!xc:defmacro def-math-rtn (name num-args) + (let ((function (symbolicate "%" (string-upcase name)))) `(progn (proclaim '(inline ,function)) - (let ((sb!int::*rogue-export* "DEF-MATH-RTN")) - (export ',function)) (sb!alien:def-alien-routine (,name ,function) double-float - ,@(let ((results nil)) - (dotimes (i num-args (nreverse results)) - (push (list (intern (format nil "ARG-~D" i)) - 'double-float) - results))))))) - -(eval-when (:compile-toplevel :load-toplevel :execute) + ,@(let ((results nil)) + (dotimes (i num-args (nreverse results)) + (push (list (intern (format nil "ARG-~D" i)) + 'double-float) + results))))))) (defun handle-reals (function var) `((((foreach fixnum single-float bignum ratio))