Are there preprocessor defines to differentiate gcc and g++ code?

c, c++, g++, gcc

Solution

In c++ you can you

#ifdef __cplusplus

eg if c++ code you want certain piece of code to be handled by compiler as c code you need to put that block in

#ifdef __cplusplus
   extern "C" {
#endif

#ifdef __cplusplus
}
#endif

Problem

Are there preprocessor macros defined in the gcc and g++ compilers so that if I want to make my C code link to the C standard library or the C++ standard library? Something like: someFile.c ``` #ifdef __CPP__ #include <c++ library include> #else #include <c library include> ``` I'm sure there are but a quick Google search didn't point me to right away and I'm sure someone is going to just post duplicate question, but in any case, please point me in the right direction.

Original source