0.9.4.11:
authorBrian Mastenbrook <bmastenb@cs.indiana.edu>
Sat, 27 Aug 2005 17:14:57 +0000 (17:14 +0000)
committerBrian Mastenbrook <bmastenb@cs.indiana.edu>
Sat, 27 Aug 2005 17:14:57 +0000 (17:14 +0000)
Some alien changes:
 * SAPs are now valid arguments to a callback (thanks to
   Andreas Scholta).
 * Enumeration values can be used more than once in an alien
           enum (thanks to Cyrus Harmon).

src/code/host-alieneval.lisp
src/code/target-alieneval.lisp
tests/alien.impure.lisp
version.lisp-expr

index 56e743d..bb0956c 100644 (file)
         (unless (and max (> max val)) (setq max val))
         (unless (and min (< min val)) (setq min val))
         (when (rassoc val from-alist)
-          (error "The element value ~S is used more than once." val))
+          (warn "The element value ~S is used more than once." val))
         (when (assoc sym from-alist :test #'eq)
           (error "The enumeration element ~S is used more than once." sym))
         (push (cons sym val) from-alist)))
index 822dd7d..c670384 100644 (file)
@@ -852,7 +852,8 @@ ENTER-ALIEN-CALLBACK pulls the corresponsing trampoline out and calls it.")
   (let ((type (parse-alien-type spec env)))
     (if (or (alien-integer-type-p type)
             (alien-float-type-p type)
-            (alien-pointer-type-p type))
+            (alien-pointer-type-p type)
+            (alien-system-area-pointer-type-p type))
         (ceiling (alien-type-word-aligned-bits type) sb!vm:n-byte-bits)
         (error "Unsupported callback argument type: ~A" type))))
 
index 7192ba3..e215ad2 100644 (file)
                                      (deref integer-array 1)))
     (assert (eql (deref enum-array 2) 'k-two))))
 
+;; enums used to allow values to be used only once
+;; C enums allow for multiple tags to point to the same value
+(define-alien-type enum.4
+    (enum nil (:key1 1) (:key2 2) (:keytwo 2)))
+(with-alien ((enum-array (array enum.4 3)))
+  (setf (deref enum-array 0) :key1)
+  (setf (deref enum-array 1) :key2)
+  (setf (deref enum-array 2) :keytwo)
+  (assert (and (eql (deref enum-array 1) (deref enum-array 2))
+               (eql (deref enum-array 1) :key2))))
+
 ;;; As reported by Baughn on #lisp, ALIEN-FUNCALL loops forever when
 ;;; compiled with (DEBUG 3).
 (sb-kernel::values-specifier-type-cache-clear)
index a917079..06af1b2 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.9.4.10"
+"0.9.4.11"