Re: tuning Gtk+ for embedded (was: GtkSheet)

Joel Becker <jlbec evilplan org> writes:

> On Thu, Mar 14, 2002 at 10:18:44AM -0500, Cody Russell wrote:
> > I would rather see a more complicated Makefile than having source and
> > header files polluted with extra preprocessor stuff.  configure can
> > figure out what files need to be built and and set gtk_c_sources include
> > all those values.
> 	Yes most of the work should be in configure/Makefile, but you
> won't be able to escape ifdefs everywhere.  The GtkButton=y GtkImage=n
> case is a great example.  gtk_c_sources will have gtkbutton.o but not
> gtkimage.o.  However, gtkbutton.c has to ifdef around all the bits that
> work with GtkImage.
> 	Granted, we could define that deps like that don't get broken
> (you want button, you get image).  This particular example might be
> possible to solve without ifdefs with all the image-using bits checking
> GType for the availability of GtkImage.  But we will run into other
> cases like this where ifdef will be the only solution.  That doesn't
> mean it is not worth doing.  It just means we need to do it right :-)

If there are cases where large dependency that it is likely to be useful
to avoid needs an #ifdef to be avoided, then a few #ifdefs might make

(That is, if, say, GtkButton pulled in GtkTreeView in some fashion, an
#ifdef to avoid that could definitely make sense.)

Any patch that adds extensive amounts of #ifdefs to the .c files would be
best avoided.


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