Re: #include in the middle of enum




Eric Kidd <eric.kidd@pobox.com> writes:

> Hello!
> 
> I'm trying to use GTK+ from a Dylan application (don't even ask =), and our
> automatic interface generator found the following in gdk/gdktypes.h:
> 
>   typedef enum
>   {
>   #include <gdk/gdkcursors.h>
>     ....
> 
> This really threw our parser for a loop--it doesn't support #includes in
> the middle of a declaration.
> 
> Here's my question: is there a reason for gdkcursors.h to do this? If so,
> I'll happily hack our interface generator to support #includes in arbitrary
> places. If not, might it be possible to merge gdkcursors.h back into
> gdktypes.h?

The problem is that gdk/gdkcursors.h is autogenerated from X 
header files, so it sort of needs to be in a separate file.

In gtk-1.1, a parser makeenums.pl is included which does know
how to handle '#includes' in enumerations - it spits out a
file gtk.defs, which includes a scheme-like description of
all enumerations. gtk.defs is then read by maketypes.awk which
creates some additional files.

Perhaps your parser could make use of these facilities. On the
other hand, just hacking in support for #includes might
be easier.

Regards,
                                        Owen



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