* Added gethostname2 to examples/gethostname.cl which uses with-foreign-object
* Added char-array-to-pointer function to encapsulate converting a char array
to a pointer to char
+ * Converted with-foreign-object to use stack allocation on CMUCL and LW
20 Mar 2002
* Updated strings.cl so that foreign-strings are always unsigned.
# Programer: Kevin M. Rosenberg, M.D.
# Date Started: Mar 2002
#
-# CVS Id: $Id: Makefile,v 1.27 2002/03/21 14:49:14 kevin Exp $
+# CVS Id: $Id: Makefile,v 1.28 2002/03/21 16:47:59 kevin Exp $
#
# This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg
#
docs:
@(cd doc; make dist-doc)
-VERSION=0.2.11
+VERSION=0.2.12
DISTDIR=uffi-${VERSION}
DIST_TARBALL=${DISTDIR}.tar.gz
DIST_ZIP=${DISTDIR}.zip
-;;;; -*- Mode: ANSI-Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*-
+;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*-
;;;; *************************************************************************
;;;; FILE IDENTIFICATION
;;;;
;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Feb 2002
;;;;
-;;;; $Id: objects.cl,v 1.12 2002/03/21 15:57:01 kevin Exp $
+;;;; $Id: objects.cl,v 1.13 2002/03/21 16:47:46 kevin Exp $
;;;;
;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;
;; Simple first pass. Will later create optimized routines for
;; various platforms.
-(defmacro with-foreign-object ((var type &rest etc) &rest body)
- `(let ((,var (allocate-foreign-object ,type ,@etc)))
+(defmacro with-foreign-object ((var type) &rest body)
+ #+allegro
+ `(let ((,var (allocate-foreign-object ,type)))
(unwind-protect
(progn ,@body)
- (free-foreign-object ,var))))
+ (free-foreign-object ,var)))
+ #+cmu
+ `(alien:with-alien ((,var ,(convert-from-uffi-type type :allocate)))
+ (setq ,var (alien:addr ,var))
+ ,@body)
+ #+lispworks
+ `(fli:with-dynamic-foreign-objects ((,var ,(convert-from-uffi-type type :allocate)))
+ ,@body)
+ )
(defmacro with-foreign-objects (bindings &rest body)