> The relevant part is where it says how to handle incorrect expression > syntax in an #if statement. Because where FOO is undefined, #if FOO > expands to a null expression which is not a valid one... > I have not found anything in the document that discusses this case; maybe I missed it, but it's strange that the MSDN documentation doesn't mention it
on the other hand, I just tried to compiled the following program on Windows: #if FOO_IS_UNDEFINED #error "should not happen" #else int dummy; #endif I had correct compilation, without warnings with all the following compilers though: MingW (GCC) Visual C++ 6 Visual C++ 7 Borland C++ 5.5 OpenWatcom C++ (don't remember version) Win32-LCC (don't remember version) I only used the default compiler options though (no -ansi or equivalent); I would say it's pretty widely supported. Apparently the Microsoft compilers and their documentation don't agree on everything; I'm not too surprised, I've seen the same thing with GCC :-) Regards, - David > > So "#if FOO, where FOO is undefined" is ok with GNU cpp [2] but not > > with Visual C++ [3] > > I haven't looked at other compilers, but I wouldn't be surprised to > > see that this is > > a GNU-specific extension, or it may come from a tradition of various > > Unix pre-processors, > > but certainly can't be generalized... > > Well, a trick I have used in one of my projects is to write "#if FOO+0" > but most people don't like it. > > -- > behdad > http://behdad.org/ > > "Those who would give up Essential Liberty to purchase a little > Temporary Safety, deserve neither Liberty nor Safety." > -- Benjamin Franklin, 1759 > > > _______________________________________________ Freetype-devel mailing list Freetype-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/freetype-devel