freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft-devel] Minor misc patches to freetype cvs, from custom c


From: David Turner
Subject: Re: [ft-devel] Minor misc patches to freetype cvs, from custom changes in vtk
Date: Thu, 22 Mar 2007 11:37:48 +0100

> 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
> 
> 
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]