r10588: better support for lispworks variance on derefing
[uffi.git] / src / objects.lisp
index e9a2024112ec409b26c136a3deda65020ba8ca16..cdd3882296bdf1b9bd86269a2af63980a20ec838 100644 (file)
@@ -137,7 +137,11 @@ an array of TYPE with size SIZE. The TYPE parameter is evaluated."
   
 (defmacro ensure-char-integer (obj)
   #+(or (and mcl (not openmcl))) `(char-code ,obj)
-  #+(or allegro cmu sbcl scl openmcl) obj)
+  #+(or allegro cmu sbcl scl openmcl) obj
+  #+lispworks
+  ;; lispworks varies whether deref'ing array vs. slot access of a char
+  #+lispworks
+  `(if (integerp ,obj) ,obj (char-code ,obj)))
 
 (defmacro ensure-char-storable (obj)
   #+(or lispworks (and mcl (not openmcl))) obj