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: Sat, 19 Nov 2011 15:58:28 +0000
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.
>

Hi Scott,

yes I think initially a set might be the best interim solution.  gm2
will be modified to include bit accessible fields and also implement
the gnu __attribute__ ((packed)).  Both are just a case of passing the
details through to the gcc middle end trees,

regards,
Gaius



reply via email to

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