gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gm2] translating C bit fields


From: Gaius Mulley
Subject: Re: [Gm2] translating C bit fields
Date: Sun, 29 Apr 2012 13:18:09 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

SiTex Graphics <address@hidden> writes:

> I'm looking for advice on how to translate bit fields in a C struct
> for reference in MODULA-2 (compiling with gm2).
>
> E.g.,
>
> struct _GtkToggleButton
> {
>   GtkButton button;
>
>   guint active : 1;
>   guint draw_indicator : 1;
>   guint inconsistent : 1;
> };
>
> My first thought is to turn the bit fields into a set, but I'm
> wondering whether that will reliably match up with the way bits are
> packed by gcc.
>
> Thanks,
> Scott

Hi Scott,

now implemented in the latest cvs.  Here is an example of its use in
action:

http://www.nongnu.org/gm2/packed.html

regards,
Gaius



reply via email to

[Prev in Thread] Current Thread [Next in Thread]