I'm writing some serialization code, and obiously, this code needs to know if the result should be big or little endian, so I tried declaring an enum like this:
namespace TerrainGenerator
{
...
enum Endianess {LITTLE_ENDIAN, BIG_ENDIAN};
...
}
But for some reason, my IntelliSense was telling me that these values are already declared.
Running g++ also gave me errors, telling me they had been defined as 1234 and 4321 (for little and big endian respectively).
I noticed the errors went away when I stopped including <string>
.
Is there somewhere I can find a list of constants that have been declared in the std. libs?
I'm running Arch Linux, Kernel 4.12.8-2-ARCH.
Running strings /usr/lib/libstdc++.so.6 | grep LIBCXX
returns a bunch of lines, the highest version number being GLIBCXX_3.4.24
.
Running ldconfig -p | grep stdc++
returns:
libstdc++.so.6 (libc6,x86-64) => /usr/lib/libstdc++.so.6
libstdc++.so (libc6,x86-64) => /usr/lib/libstdc++.so
(as suggested by https://stackoverflow.com/a/10355215/6242052 to find what version of the std. libs i'm using)
EDIT: If these values are #defined
, on a scale of 1-10 how bad of an idea would it be to #undef
them after including all headers? (And possibly re-#define
-ing them after my code)