-;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-
+;;;; -*- Mode: ANSI-Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*-
;;;; *************************************************************************
;;;; FILE IDENTIFICATION
;;;;
;;;; 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
;;;;
(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