[cfe-dev] math.h on Windows

Chris Lattner clattner at apple.com
Thu Oct 29 09:27:27 PDT 2009


On Oct 29, 2009, at 8:34 AM, John Thompson wrote:

> Thanks, Chris.
>
> >Can this be implemented like __has_builtin is?
> Oh, I totally missed this!  Yes, I'll redo it like this.
> >This can be done by just not registering the 'magic' macros in no- 
> extensions mode.
>
> How is no-extensions mode detected?  I was expecting a flag in  
> LangOptions, but I don't see it, and there is no -fno-extensions  
> option.  There is a -fbuiltin option and a NoBuiltin flag in  
> LangOptions, but that seems to be for builtin functions, not  
> preprocessor macros.  Or perhaps it needs adding?  I don't see an  
> equivalent in gcc.  Or perhaps something more specific like "-fno- 
> magic-macros=[0|1]" or "-fno-magic-macro=(macroname)"
>

I would follow the lead of __has_builtin.  If it doesn't warn in some  
situation, your new thing shouldn't either :).  Since it starts with  
__ I think we're in the clear here.

-Chris




More information about the cfe-dev mailing list