From: Christophe Rhodes Date: Thu, 8 Aug 2002 11:28:45 +0000 (+0000) Subject: 0.7.6.15: X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=5e7911a06d41c8e374e218ff9654e0977c3f9aeb;p=sbcl.git 0.7.6.15: Bugfix for DEFINE-ALIEN-ROUTINE ... now alien routines with doctypes get an FTYPE DECLAIMed which has the right number of arguments ... remove duplicate definition of get-timezone; use helper functions defined in unix.lisp --- diff --git a/src/code/target-alieneval.lisp b/src/code/target-alieneval.lisp index c130387..66a2e56 100644 --- a/src/code/target-alieneval.lisp +++ b/src/code/target-alieneval.lisp @@ -663,7 +663,7 @@ ;; here, so e.g. an alien function of "int" and "char" ;; arguments would get Lisp arg types WORD and CHARACTER ;; or something. Meanwhile, for now we just punt. - (lisp-arg-types (mapcar (constantly t) args)) + (lisp-arg-types (mapcar (constantly t) (lisp-args))) ;; KLUDGE: This is a quick hack to solve bug 133, ;; where PROCLAIM trying to translate alien void result ;; types would signal an error here ("cannot use values diff --git a/src/code/time.lisp b/src/code/time.lisp index 3694425..451003a 100644 --- a/src/code/time.lisp +++ b/src/code/time.lisp @@ -70,14 +70,6 @@ ;;;; Encode and decode universal times. -;;; Returns two values: -;;; - the minutes west of GMT. -;;; - T if daylight savings is in effect, NIL if not. -(sb!alien:define-alien-routine get-timezone sb!alien:void - (when sb!alien:long :in) - (minutes-west sb!alien:int :out) - (daylight-savings-p sb!alien:boolean :out)) - ;;; Subtract from the returned Internal-Time to get the universal ;;; time. The offset between our time base and the Perq one is 2145 ;;; weeks and five days. @@ -124,15 +116,17 @@ (year NIL) (day NIL) (daylight NIL) - (timezone (if (null time-zone) - (multiple-value-bind - (ignore minwest dst) - (get-timezone (- universal-time - unix-to-universal-time)) - (declare (ignore ignore)) - (setf daylight dst) - minwest) - (* time-zone 60)))) + (timezone (cond + ((null time-zone) + (multiple-value-bind + (ignore minwest dst) + (sb!unix::get-timezone (- universal-time + unix-to-universal-time)) + (declare (ignore ignore)) + (declare (fixnum minwest)) + (setf daylight dst) + minwest)) + (t (* time-zone 60))))) (declare (fixnum timezone)) (multiple-value-bind (t1 seconds) (truncate secs 60) (setq second seconds) @@ -211,14 +205,12 @@ (if time-zone (+ second (* (+ minute (* (+ hours time-zone) 60)) 60)) (let* ((minwest-guess - (nth-value 1 - (get-timezone (- (* hours 60 60) - unix-to-universal-time)))) + (sb!unix::unix-get-minutes-west (- (* hours 60 60) + unix-to-universal-time))) (guess (+ minute (* hours 60) minwest-guess)) (minwest - (nth-value 1 - (get-timezone (- (* guess 60) - unix-to-universal-time))))) + (sb!unix::unix-get-minutes-west (- (* guess 60) + unix-to-universal-time)))) (+ second (* (+ guess (- minwest minwest-guess)) 60)))))) ;;;; TIME diff --git a/tests/alien.impure.lisp b/tests/alien.impure.lisp index 8638d5c..3aee388 100644 --- a/tests/alien.impure.lisp +++ b/tests/alien.impure.lisp @@ -25,8 +25,26 @@ ;;; bug 133, fixed in 0.7.0.5: Somewhere in 0.pre7.*, C void returns ;;; were broken ("unable to use values types here") when -;;; auto-PROCLAIM-of-return-value was added to DEFINE-ALIEN_ROUTINE. +;;; auto-PROCLAIM-of-return-value was added to DEFINE-ALIEN-ROUTINE. (sb-alien:define-alien-routine ("free" free) void (ptr (* t) :in)) +;;; Types of alien functions were being incorrectly DECLAIMED when +;;; docstrings were included in the definition until sbcl-0.7.6.15. +(sb-alien:define-alien-routine ("getenv" ftype-correctness) c-string + "docstring" + (name c-string)) + +(multiple-value-bind (function warningsp failurep) + (compile nil '(lambda () (ftype-correctness))) + (assert warningsp)) + +(multiple-value-bind (function warningsp failurep) + (compile nil '(lambda () (ftype-correctness "FOO"))) + (assert (not warningsp))) + +(multiple-value-bind (function warningsp failurep) + (compile nil '(lambda () (ftype-correctness "FOO" "BAR"))) + (assert warningsp)) + ;;; success (quit :unix-status 104) diff --git a/version.lisp-expr b/version.lisp-expr index b990d22..18afe7f 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -18,4 +18,4 @@ ;;; for internal versions, especially for internal versions off the ;;; main CVS branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.7.6.14" +"0.7.6.15"