您的位置:首页 > 其它

#ifdef __cplusplus是什么意思

2005-10-15 19:32 393 查看
#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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: