#ifdef __cplusplus是什么意思

来源:百度文库 编辑:神马文学网 时间:2024/05/11 11:09:32
#ifdef __cplusplus是什么意思
#ifdef __cplusplus是什么意思?
Microsoft-Specific Predefined Macros
__cplusplus Defined for C++ programs only.
意思是说,如果是C++程序,就使用
extern "C"{
而这个东东,是指在下面的函数不使用的C++的名字修饰,而是用C的
The following code shows a header file which can be used by C and C++ client applications:
// MyCFuncs.h
#ifdef __cplusplus
extern "C" { // only need to export C interface if
// used by C++ source code
#endif
__declspec( dllimport ) void MyCFunc();
__declspec( dllimport ) void AnotherCFunc();
#ifdef __cplusplus
}
#endif