X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=src%2Fprimitives.cl;h=7a57a949aa4c5d7352fd01f472b92977a4f8a354;hb=1247d7633ebf85d1d9285c69dc0ee1ef3076def9;hp=47f151ccca959049f80b10adca272e14f8a2c029;hpb=f83d9af1a5b3ec07bce41a7552b36134f5342b87;p=uffi.git diff --git a/src/primitives.cl b/src/primitives.cl index 47f151c..7a57a94 100644 --- a/src/primitives.cl +++ b/src/primitives.cl @@ -1,4 +1,4 @@ -;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*- +;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10; Package: UFFI -*- ;;;; ************************************************************************* ;;;; FILE IDENTIFICATION ;;;; @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: primitives.cl,v 1.15 2002/04/06 19:45:14 kevin Exp $ +;;;; $Id: primitives.cl,v 1.20 2002/06/27 14:35:24 kevin Exp $ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -56,7 +56,8 @@ supports takes advantage of this optimization." (defconstant +cmu-def-type-list+ '((:char . (alien:signed 8)) (:unsigned-char . (alien:unsigned 8)) - (:byte . (alien:unsigned 8)) + (:byte . (alien:signed 8)) + (:unsigned-byte . (alien:unsigned 8)) (:short . (alien:signed 16)) (:unsigned-short . (alien:unsigned 16)) (:int . (alien:signed 32)) @@ -68,16 +69,18 @@ supports takes advantage of this optimization." ) "Conversions in CMUCL or def-foreign-type are different thatn in def-function") +(defparameter +type-conversion-list+ nil) #+cmu -(defconstant +type-conversion-list+ +(setq +type-conversion-list+ '((* . *) (:void . c-call:void) (:short . c-call:short) (:pointer-void . (* t)) (:cstring . c-call:c-string) (:char . c-call:char) (:unsigned-char . (alien:unsigned 8)) - (:byte . (alien:unsigned 8)) + (:byte . (alien:signed 8)) + (:unsigned-byte . (alien:unsigned 8)) (:short . c-call:unsigned-short) (:unsigned-short . c-call:unsigned-short) (:int . alien:integer) (:unsigned-int . c-call:unsigned-int) @@ -85,27 +88,30 @@ supports takes advantage of this optimization." (:float . c-call:float) (:double . c-call:double) (:array . alien:array))) #+allegro -(defconstant +type-conversion-list+ +(setq +type-conversion-list+ '((* . *) (:void . :void) (:short . :short) (:pointer-void . (* :void)) (:cstring . (* :unsigned-char)) + (:byte . :char) + (:unsigned-byte . :unsigned-byte) (:char . :char) (:unsigned-char . :unsigned-char) - (:byte . :byte) (:int . :int) (:unsigned-int . :unsigned-int) (:long . :long) (:unsigned-long . :unsigned-long) (:float . :float) (:double . :double) (:array . :array))) #+lispworks -(defconstant +type-conversion-list+ +(setq +type-conversion-list+ '((* . :pointer) (:void . :void) (:short . :short) (:pointer-void . (:pointer :void)) - (:cstring . (:reference-pass :ef-mb-string :allow-null t)) - (:cstring-returning . (:reference :ef-mb-string :allow-null t)) + (:cstring . (:reference-pass (:ef-mb-string :external-format :latin-1) + :allow-null t)) + (:cstring-returning . (:reference (:ef-mb-string :external-format :latin-1) :allow-null t)) + (:byte . :byte) + (:unsigned-byte . (:unsigned :byte)) (:char . :char) - (:byte :byte) (:unsigned-char . (:unsigned :char)) (:int . :int) (:unsigned-int . (:unsigned :int)) (:long . :long) (:unsigned-long . (:unsigned :long))