[cffi-devel] Not able to use constant variables in with-foreign-pointer
![](https://secure.gravatar.com/avatar/1c23791f5e72f12fee5bc0c52faeafbc.jpg?s=120&d=mm&r=g)
Hi, There's a minor problem in the cffi-allegro.lisp that prevents using constant variables in with-foreign-pointer. Would you please apply the patch? Tue Apr 20 19:16:26 JST 2010 Jianshi Huang <huang@msi.co.jp> * Fix bug that size in with-foreign-pointer cannot be a constant variable. diff -rN old-cffi/src/cffi-allegro.lisp new-cffi/src/cffi-allegro.lisp 139c139 < (ff:with-static-fobject (,var '(:array :char ,size) ---
(ff:with-static-fobject (,var (list :array :char ,size)
Cheers, Jianshi
![](https://secure.gravatar.com/avatar/fa1e806f97322661e06279d2f35e7ab8.jpg?s=120&d=mm&r=g)
On Wed, 2010-04-21 at 17:45 +0900, Jianshi Huang wrote:
Hi,
There's a minor problem in the cffi-allegro.lisp that prevents using constant variables in with-foreign-pointer. Would you please apply the patch?
Thanks for the report, I've applied your patch. The next time please send a unified diff - obtained with darcs diff -u -- Stelian Ionescu a.k.a. fe[nl]ix Quidquid latine dictum sit, altum videtur. http://common-lisp.net/project/iolib
![](https://secure.gravatar.com/avatar/1c23791f5e72f12fee5bc0c52faeafbc.jpg?s=120&d=mm&r=g)
From: Stelian Ionescu <sionescu@cddr.org> Date: Wed, 21 Apr 2010 11:26:59 +0200
Thanks for the report, I've applied your patch. The next time please send a unified diff - obtained with darcs diff -u
Sure, thanks.
![](https://secure.gravatar.com/avatar/326b108ffcc42f27628703b0c11ed239.jpg?s=120&d=mm&r=g)
Hello, On Wed, Apr 21, 2010 at 9:45 AM, Jianshi Huang <huang@msi.co.jp> wrote:
< (ff:with-static-fobject (,var '(:array :char ,size) ---
(ff:with-static-fobject (,var (list :array :char ,size)
Thanks for the report. This fix is not correct because it inhibits stack allocation due to the type/size specification not being constant anymore. (Plus, the committed patch was missing a comma, which broke the macro altogether.) I've pushed a fix, along with a test. Cheers, -- Luís Oliveira http://r42.eu/~luis/
participants (3)
-
Jianshi Huang
-
Luís Oliveira
-
Stelian Ionescu