Re: gmarshal.h fix



On Monday, August 20, 2001, at 05:25  AM, Tim Janik wrote:

On Sat, 18 Aug 2001, Darin Adler wrote:

I'd like to change the Makefile.am in gobject to put an "#include
<glib/gtypes.h>" at the top of gmarshal.h, so it's safe to include it
first. Is that OK?

no, you should never include gobject/gmarshal.h directly, if you
need just the marshallers, put #include <gobject/gsignal.h> into
your code, but even that shouldn't be necessary as
#include <glib-object.h> is required anywhere you use
types/objects/signals/marshaller so you should have them right away.

The specific case I'm thinking about is in generated marshal .h files. These generated files include <gobject/gmarshal.h> (I'm not sure why), but they don't include anything else. So they don't have enough includes to compile as-is -- you always have to include gtypes.h explicitly first. Perhaps I should add the "#include <glib/gtypes.h>" to the top of files generated by glib-gmarshal, before the "#include <gobject/gmarshal.h>". What do you think of that?

I am not happy with header files that you can't include without first including other .h files. Such headers seem sloppy and inconvenient to me.

Perhaps the problem is that we have different philosophies about header files.

    -- Darin




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