> Fabien Costantini wrote: > > Well, testing WIN32 is too permissive because it would include also mingw > > as an example. > > On the other hand, _MSC_VER would only exclude msvc compilers which is > > better think, but may include borland and watcom compilers. > > I don't think borland compilers support the warning pragma as an example. > > > > Probably filtering all win32 that are not gcc and also sgi would do fine, > > like: > > #if (!defined(WIN32) || defined(__GNUC__)) && !defined(sgi) > > ../.. > > #endif > > Maybe we should define an own macro in a central header file (which?) > and then use this throughout the code everywhere if we need to > use #warning's. This way we can find out over time, which compilers > can't use #warning's and add them at _one_ place, e.g.: > > #undef FL_WARNING > #ifdef WIN32 > # if (compiler 1 or compiler 2 or ...) > # define FL_WARNING > # elif > # ... > # endif > #endif > > Of course, this could also be a one-liner, but this should show > that we would be able to use complex logic, if need be ... > > Then we can use: > > #if FL_WARNING > #warning FIXME This needs to be UTF aware now > #endif > -1 because adding a new dependency just for that is not a good idea IMHO. > Or we could use configure to define FL_WARNING in config.h ? +0 could be interesting, but: - if this is done, FL_WARNING should probably be named FL_WARNING_PRAGMA to avoid confusion with other warning api. - It may be a bit too much for a temporary pragma, because in the end, the goal is to fix the pb and _remove_ the warning. And we should not have dozen of them, in principle. > Albrecht
Fabien _______________________________________________ fltk-dev mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk-dev
