Circular includes

View: New views
1 Messages — Rating Filter:   Alert me  

Circular includes

by Patrik Fimml-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

I just discovered gob as a great thing hopefully simplifying my GObject
programming a lot.  There's just one thing that seems awkward to me: the
__TYPEDEF_*__ approach to circular type dependencies.  In hand-written
classes, I usually just put the typedefs before the includes—e.g.
instead of

        <begin %h code>
        #include "another-class.h"
        <end %h code>
       
        [...]
       
        #ifndef __TYPEDEF_A_CLASS__
        #define __TYPEDEF_A_CLASS__
        typedef struct _aClass aClass;
        #endif

I would suggest

        typedef struct _aClass aClass;
       
        <begin %h code>
        #include "another-class.h"
        <end %h code>
       
and circular includes would resolve comfortably.  Is there a reason why
gob2 doesn't do it like that?


Kind regards,
Patrik


--
to unsubscribe:
send mail to minimalist@... with "unsubscribe gob-list" in the subject

signature.asc (196 bytes) Download Attachment