r2927: Integrate Reini Urban's cormanlisp patches into main UFFI source
[uffi.git] / src / primitives.lisp
index 6abd855bb5fe9b0cd704391c3a8aad64758e665a..6147753d8847a874b1afe7238d6b2666d199ad37 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Programmer:    Kevin M. Rosenberg
 ;;;; Date Started:  Feb 2002
 ;;;;
-;;;; $Id: primitives.lisp,v 1.1 2002/09/30 10:02:36 kevin Exp $
+;;;; $Id: primitives.lisp,v 1.2 2002/10/01 17:05:29 kevin Exp $
 ;;;;
 ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;;
 (defmacro def-type (name type)
   "Generates a (deftype) statement for CL. Currently, only CMUCL
 supports takes advantage of this optimization."
-  #+(or lispworks allegro mcl)
-  (declare (ignore type))
-  #+(or lispworks allegro mcl)
-  `(deftype ,name () t)
+  #+(or lispworks allegro mcl cormanlisp)  (declare (ignore type))
+  #+(or lispworks allegro mcl cormanlisp) `(deftype ,name () t)
   #+cmu
   `(deftype ,name () '(alien:alien ,(convert-from-uffi-type type :declare)))
   #+sbcl
@@ -73,6 +71,7 @@ supports takes advantage of this optimization."
   #+allegro `(ff:def-foreign-type ,name ,(convert-from-uffi-type type :type))
   #+cmu `(alien:def-alien-type ,name ,(convert-from-uffi-type type :type))
   #+sbcl `(sb-alien:def-alien-type ,name ,(convert-from-uffi-type type :type))
+  #+cormanlisp `(ct:defctype ,name ,(convert-from-uffi-type type :type))
   #+mcl
   (let ((mcl-type (convert-from-uffi-type type :type)))
     (unless (or (keywordp mcl-type) (consp mcl-type))
@@ -157,7 +156,7 @@ supports takes advantage of this optimization."
       (:float . float) (:double . double)
       (:array . array)))
 
-#+allegro
+#+(or allegro cormanlisp)
 (setq +type-conversion-list+
     '((* . *) (:void . :void)
       (:short . :short)
@@ -236,7 +235,7 @@ supports takes advantage of this optimization."
   "Converts from a uffi type to an implementation specific type"
   (if (atom type)
       (cond
-       #+allegro 
+       #+(or allegro cormanlisp)
        ((and (or (eq context :routine) (eq context :return))
             (eq type :cstring))
        (setq type '((* :char) integer)))