Using C Preprocessor to Determine Compilation Environment
问题 I am building an application that consists of both a windows driver written in C and a user mode executable in C++. They both use a shared header file to define several macros, constants, enums, etc. In the C++ version, I want to include everything within a namespace, which a feature not supported by the C compiler. Is there certain variable I can check for to use as a preprocessor directive with Visual Studio like in the following example? #ifdef USING_CPLUSPLUS namespace mynamespace{ #endif