;;;; 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
#+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))
(:float . float) (:double . double)
(:array . array)))
-#+allegro
+#+(or allegro cormanlisp)
(setq +type-conversion-list+
'((* . *) (:void . :void)
(:short . :short)
"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)))