In fltk2 the generic system header file (unfortuatly called fltk/x.h) does this so that USE_X11 is defined:
# if defined(_WIN32) && !USE_X11 # include "win32.h" # elif defined(__APPLE__) && !USE_X11 # include "osx.h" # else # define USE_X11 1 # include "x11.h" # endif This seems to be a pretty good solution. Once this header file is included you can safely do "#if USE_X11". imacarthur wrote: > On 21 Sep 2008, at 17:06, Fabien Costantini wrote: > >> I would like to add a UNIX_X11 flags that would be set when the >> platform is not darwin, not cygwin and has X11. >> >> In other words, this would be used after WIN32, __APPLE_XXXX__ tests, >> to distinguish easily the X11 implementation from the others. >> >> I find it particularly handy when a piece of code only deals with X11 >> and we would like to avoid to test all other combinations to finally >> implement our code. >> >> It is currently assumed that the #else preprocessor use in a sequence >> of #if defined(MY_PLATFORM) is UNIX X11 (see original configure.in >> file case/esac tests). > > I'd vote yes for this change - not only for the reasons Fabien gave, but > also because it is possibly wrong to assume that UNIX == X11... We could > feasibly have cases in future where the OS is UNIX but the display > system is not X11 (e.g. some sort of framebuffer, or native Gl or some > such thing) so if we build for that now... > > > _______________________________________________ fltk-dev mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk-dev
