|
[Sbcl-commits] CVS: sbcl/tests alien.impure.lisp,1.12,1.13
From: Brian Mastenbrook <bmastenbrook@us...> - 2005-08-27 17:15
|
Update of /cvsroot/sbcl/sbcl/tests
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10931/tests
Modified Files:
alien.impure.lisp
Log Message:
0.9.4.11:
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).
Index: alien.impure.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/tests/alien.impure.lisp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- alien.impure.lisp 26 Aug 2005 21:09:04 -0000 1.12
+++ alien.impure.lisp 27 Aug 2005 17:14:57 -0000 1.13
@@ -115,6 +115,17 @@
(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)
|
| Thread | Author | Date |
|---|---|---|
| [Sbcl-commits] CVS: sbcl/tests alien.impure.lisp,1.12,1.13 | Brian Mastenbrook <bmastenbrook@us...> |