iofcas / nativeclient-sdk

Automatically exported from code.google.com/p/nativeclient-sdk
0 stars 0 forks source link

<math.h> macro pollution, eg. log2() #145

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Platform: pepper_15 (but probably many others)
Toolchain variant: newlib

What steps will reproduce the problem?
1. #include <cmath>
2. int log2(int a, int b, int c) { return a + b + c; }
3. Try to compile.

<math.h> defines log2 as a macro, but <cmath> does not undefine this macro. 
This breaks C++ software that define their own log2 in their own namespace.

Original issue reported on code.google.com by sam@hocevar.net on 23 Nov 2011 at 12:52