https://github.com/nemequ/pre-defined-macros
Lists of pre-defined macros for various C/C++ compilers
https://github.com/nemequ/pre-defined-macros
Last synced: 11 months ago
JSON representation
Lists of pre-defined macros for various C/C++ compilers
- Host: GitHub
- URL: https://github.com/nemequ/pre-defined-macros
- Owner: nemequ
- Created: 2018-04-12T15:52:37.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-11-15T20:21:10.000Z (over 6 years ago)
- Last Synced: 2023-03-24T04:48:48.068Z (about 3 years ago)
- Language: C
- Size: 43 KB
- Stars: 16
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Pre-defined C/C++ compiler macros
Lists of pre-defined macros for various compilers.
You should probably check the [Pre-defined C/C++ Compiler Macros
wiki](https://sourceforge.net/p/predef/wiki/Home/) on SourceForge
first. It's probably more useful for now; it has lots more compilers,
and a more friendly presentation. This repo, OTOH, has more complete
information (all of the pre-defined macros instead of just a select
few).
If you have access to compilers not listed, a PR would be appreciated!
## Generating the files
* GCC:
* C: `gcc -dM -E -o "${OUTFILE}" empty.c`
* C++: `g++ -dM -E -o "${OUTFILE}" empty.cpp`
* clang:
* C: `clang -dM -E -o "${OUTFILE}" empty.c`
* C++: `clang++ -dM -E -o "${OUTFILE}" empty.cpp`
* Intel C/C++ Compiler:
* C: `icc -dM -E -o "${OUTFILE}" empty.c`
* C++: `icpc -dM -E -o "${OUTFILE}" empty.cpp`
* Oracle Developer Studio:
* C: `suncc -xdumpmacros=%all -E empty.c 2>&1 | grep -oP '#define .+' > "${OUTFILE}"`
* C++: `sunCC -xdumpmacros=%all -E empty.cpp 2>&1 | grep -oP '#define .+' > "${OUTFILE}"`
* PGI C/C++ Compiler:
* C: `pgcc -dM -E /dev/null > "${OUTFILE}"`
* C++: `pgc++ -dM -E /dev/null > "${OUTFILE}"`
* TI C/C++ Compiler:
* C: `cl6x --preproc_macros empty."$MODE" --output_file="$OUTFILE"`
* C++: `cl6x --preproc_macros empty."$MODE" --output_file="$OUTFILE"`
* Emscripten:
* C: `emcc -dM -E -o "${OUTFILE}" empty.c`
* C++: `em++ -dM -E -o "${OUTFILE}" empty.cpp`