#ifdef __cplusplus
extern "C"
{
#endif
void test(void);
#ifdef __cplusplus
}
#endif
如果是C++编译环境,那么test()函数将按C标准进行编译,这是为了兼容C++编译器。
#ifdef __cplusplus
extern "C"
{
#endif
void test(void);
#ifdef __cplusplus
}
#endif
如果是C++编译环境,那么test()函数将按C标准进行编译,这是为了兼容C++编译器。