Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Determining value of preprocessor token

Tags:

c++

macros

How can I tell what the value of the __GNUC__ definition is on my C++ compiler?

like image 378
Lightness Races in Orbit Avatar asked Feb 14 '26 02:02

Lightness Races in Orbit


1 Answers

You can get all the GCC predefined macros with this:

g++ -dM -E - < /dev/null

A quick grep will get you what you want.

like image 112
Mat Avatar answered Feb 16 '26 15:02

Mat