Albrecht Schlosser wrote: >> #if !defined(WIN32) && !defined(sgi) || defined(CYGWIN) >> #warning FIXME This needs to be UTF aware now >> #endif >> > I don't think that this is correct, for two reasons: > > (1) WIN32 is also defined when compiling with gcc under Windows. If we > want to exclude the MS VC compilers, as discussed in the STR, then > the correct macro would probably be _MSC_VER instead of WIN32. > > (2) CYGWIN is wrong as well. If used, then it must read __CYGWIN__.
OK.. > But if we change (1), then we don't need __CYGWIN__, thus the correct > solution would be: > > #if !defined(_MSC_VER) && !defined(sgi) > #warning FIXME This needs to be UTF aware now > #endif > > This looks much easier and reflects _compilers_ and not platform > dependencies. > > I'm not 100% sure that "_MSC_VER" is the correct name, but I'm sure > that WIN32 would be wrong. That all sounds good. As you noticed, I started with what was there already: #if !defined(WIN32) || defined(CYGWIN) ..and added the "&& !defined(sgi)" to that, so I'm assuming what was there worked for the person who added it. > And I'm aware that you copied existing code from glut_font.cxx, so > it must have been wrong before ... Right. Grepping the code for CYGWIN, I see the more common use is "__CYGWIN__", so what was there before may be unintended. But I'm assuming the folks who added the original #if did so to get it to compile on those platforms (as I did for the SGI), so maybe "CYGWIN" is also valid as an FLTK build time macro? However, I agree with you; CYGWIN -> __CYGWIN__ seems more consistent with the rest of the code, even if CYGWIN works too. Targeting _MSC_VER is surely better too, if g++ under windows uses the WIN32 macro. Certainly there are many precedents in the code for the _MSC_VER macro. However, let's wait to see what others say. At worst folks compiling under windows with g++ won't see #warnings, and assuming CYGWIN does work but is not consistent, it might be fine as it is for now. _______________________________________________ fltk-dev mailing list fltk-dev@easysw.com http://lists.easysw.com/mailman/listinfo/fltk-dev