1 Feb 2006 07:24
Bitfields and defcenum
Luís Oliveira <luismbo <at> gmail.com>
2006-02-01 06:24:29 GMT
2006-02-01 06:24:29 GMT
Hello, While building CFFI bindings for GLUT and using enums for defining bitfield masks, I came across this example: (defcenum display-mode (:rgb 0) (:rgba 0) (:index 1) (:single 0) (:double 2) (:accum 4) (:alpha 8) (:depth 16) (:stencil 32) (:multisample 128) (:stereo 256) (:luminance 512)) defcenum won't accept this because it contains duplicate values. This a misfeature introduced by myself that I forgot to fix and people have complained[1] about this before. Unless someone has any objections, I'll implement something like what CLISP has. But this makes me wonder if another abstraction, say DEFBITFIELD would be useful. Something like: (defbitfield name (0 sym1 sym2 ...) (1 sym3)(Continue reading)
and it says the same thing. "FFI:
> FOREIGN-LIBRARY-FUNCTION: No dynamic object named 'SDL_Init' in
> library :DEFAULT"
My first guess is that you are using an older version of CLISP that is
technically unsupported by CFFI. What CLISP version are you using,
and do the SDL bindings work if you upgrade to the latest release?
IIRC, several releases ago, a feature was added to CLISP to look for
foreign symbols globally when the library is :DEFAULT, instead of only
in the C library. Perhaps this is not working on Win9x... does this
work under NT/XP/whatever?
> I did a little bit of detective work:
>
> Clisp's top-level view shows the scope, at the time of the above error
> as (from src/cffi-clisp.lisp):
>
> `(funcall
> (load-time-value
RSS Feed