5 ms·
Pre-defined C/C++ Compiler Macros
- wahern 4y agoFor anyone as confused as I was, this seems to be a fork of the original database at https://sourceforge.net/p/predef/wiki/Home/ https://sourceforge.net/p/predef/wiki/Home/ The Sourceforge page now includes a link to this new repository.
- rurban 4y agoDoesn't look like a fork, but a move
- Night_Thastus 4y agoThis may be missing a couple under the Windows category, such as _WINDOWS and WIN32 (no underscores). Buried in some code I wrote is this, because of compatibility nightmares: #if defined(__WIN32__) || defined(_WIN32) || defined(_WINDOWS) || defined(WIN32)
- mdaniel 4y agoWell, they accept contributions, but are you sure those are predefined, and not courtesy of some system include?
- Night_Thastus 4y agoWhat's the difference between those two?
- mdaniel 4y agoI stand corrected (although I still can't speak to what the VC++ compilers do): I somehow thought there were "bootstrapping" headers that were silently included with a compiler invocation, but were still subject to exclusion through various "-nostdinc" and "-nobuiltininc" style "just preprocess the given C source, without respect to the filesystem". But in the few minutes I spent futzing around with clang-15 I was unable to find a counter example, and sure enough even running strings on libclang-cpp coughs up one I would have thought for sure was coming from such a system header $ grep -rl __GNUC_PATCHLEVEL__ $HOMEBREW_CELLAR/llvm/15.0.6/lib/libclang-cpp.so.15 /home/linuxbrew/.linuxbrew/Cellar/llvm/15.0.6/lib/libclang-cpp.so.15 I'm sorry for the noise
- pjmlp 4y agoPre-defined compiler macros are visible in the absence of any kind of includes.
- Tempest1981 4y ago_WIN32 can trick people: _WIN16 Defined for 16-bit environments _WIN32 Defined for both 32-bit and 64-bit environments _WIN64 Defined for 64-bit environments