> > Wild, wild hacking ... ;-) > > Manolo, it's fine that you could fix this "id" problem, but I > strongly suggest that we should find another solution - even if > this is only needed for "old" gcc versions. Such hacks tend to > stay in the code forever(TM). > > Fiddling around with #defines looks like a really bad solution. > > I just did a quick rename of the id member variable in Fl_Pixmap > and Fl_Bitmap as a proof of concept, but I didn't really test it > other than compiling and running test/pixmap_browser (and it works). > > Thus, I propose to rename the id variable, although it is public, > but marked as "for internal use". >
I fully agree it would be better to rename this id variable, even if this conflict is not likely to happen often because it occurs only for objective-c++ source files and only with gcc-3. The #define fiddling solution would be: #if __GNUC__ == 3 // because Fl_Image.H, Fl_Bitmap.H and Fl_Pixmap.H included by Fl_Sys_Menu_Bar.H and Fl_Printer.H, // use a private variable name id that's illegal under GCC 3 -x -objective-c++ #define id id_ #endif #include <FL/Fl_Sys_Menu_Bar.H> #include <FL/Fl_Printer.H> #ifdef id #undef id #endif _______________________________________________ fltk-dev mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk-dev
