[cffi-devel] bitfield structure members
26 Jun
2007
26 Jun
'07
8:35 p.m.
hello all, How do I bind a structure such as this?: struct mystuff { int foo; unsigned int bar : 1; } regards, d.t. webb
17 Jul
17 Jul
11:55 p.m.
Hello, Sorry for the late reply. On 26/06/07, dtwebb@postpro.net <dtwebb@postpro.net> wrote:
struct mystuff { int foo; unsigned int bar : 1; }
In this case I'd just use (defcstruct mystuff (foo :int) (bar :uint)) and get the bit with (logand 1 (foreign-slot-value p 'mystuff 'bar)). For more complex cases I'd need to check the ABI docs. In order to achieve portability, it might be necessary to write some C glue code. HTH, -- Luís Oliveira http://student.dei.uc.pt/~lmoliv/
6413
Age (days ago)
6434
Last active (days ago)
1 comments
2 participants
participants (2)
-
dtwebb@postpro.net
-
Luís Oliveira