- Jun 26, 2019
I think you're referring to the #ifdef __cplusplus code that's in the C++ source files. It's something that used to be done when mixing C and C++ modules. I guess it's still possible to compile a C file in Visual Studio, but I can't find the project or compiler settings that would let you specifically define the code type within the source file (being either C or C++). I guess the compiler and environment is relying on the filename extension to determine the compile type to use.Also what is that #cplusplus thing about?
The Stack Overflow link should give you enough information, but the gist of it is that this macro is defined when the file is being compiled as a C++ module. If this macro is defined, the code between the #ifdef and the #endif will be included as part of the compile, in this case the extern "C" stuff.
(that sounded rambling ... it's a Monday morning and my brain is foggy)