在 2018/12/31 2:56, Jacek Caban 写道:
> Hello,
> 
> We currently have a few checks for strict more in our math.h. It guards
> some non-standard (or at least not present in requested standard
> version) declarations. Some of those are pretty standard things like
> M_PI, others are Windows-specific, like underscored versions of standard
> functions. This causes some problems like [1] or [2] when one tries to
> build with -std=c++...
> 
> AFAIK, MSVC doesn't have a counterpart of strict standard more, so an

There is `/Za` but I haven't used it ever.

> assumption that those declarations are always present is valid among
> them. To mimic that, we could just remove __STRICT_ANSI__ checks. My
> patch does not go so far. I used a safer and less controversial approach
> and concentrated on C++ only.
> 
> On Linux, g++ defines _GNU_SOURCE because libstdc++ relies on some
> declarations that would be otherwise not be present (clang and libc++
> are the same AFAIK). I didn't check, but saw an info that it does
> similar things on other platforms. That causes C++ to assume that things
> like M_PI is present even if specified standard would mean otherwise.
> The attached patch makes such assumption valid on mingw-w64 by
> explicitly checking for C++ in places checking __STRICT_ANSI__.
> 

Yes, I think this bad, but it is how GCC behaves. Is it really necessary
to check for `__cplusplus`? It looks to me that the GNU C++ compiler
i.e. `__GNUG__` should be checked instead.

I grep'd over libstdc++ headers for `M_PI` and found no results. Which
declaration was it that caused the failure?


> Thanks,
> Jacek
> 
> [1] https://bugzilla.mozilla.org/show_bug.cgi?id=1390583#c106
> [2] https://bugzilla.mozilla.org/show_bug.cgi?id=1508316
> 


-- 
Best regards,
LH_Mouse

_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to