X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=src%2Fobjects.cl;h=0f28115a0cbd24565ad81b915475212994923d77;hb=fb93b1923db347f01bdebc7226e5e1eaacacc9f9;hp=316a7eea35449397fa73703afeb71a4134f5b45b;hpb=76ae1bdbadaaf87603ebbe987e59dd1a105f1872;p=uffi.git diff --git a/src/objects.cl b/src/objects.cl index 316a7ee..0f28115 100644 --- a/src/objects.cl +++ b/src/objects.cl @@ -1,4 +1,4 @@ -;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*- +;;;; -*- Mode: ANSI-Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*- ;;;; ************************************************************************* ;;;; FILE IDENTIFICATION ;;;; @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: objects.cl,v 1.5 2002/03/14 21:03:12 kevin Exp $ +;;;; $Id: objects.cl,v 1.6 2002/03/17 17:33:30 kevin Exp $ ;;;; ;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -54,11 +54,18 @@ (defmacro deref-pointer (ptr type) "Returns a object pointed" - #+(or lispworks cmu) (declare (ignore type)) - #+cmu `(alien:deref ,ptr) - #+lispworks `(fli:dereference ,ptr) - #+allegro `(ff:fslot-value-typed ,type :c ,ptr) - ) + (let ((result (gensym))) + `(let ((,result + #+cmu (alien:deref ,ptr) + #+lispworks (fli:dereference ,ptr) + #+allegro (ff:fslot-value-typed ,type :c ,ptr) + )) + (if (and + (or (eq ,type :char) + (eq ,type :unsigned-char)) + (numberp ,result)) + (code-char ,result) + ,result)))) (defmacro pointer-address (obj) #+cmu