一、判断编译器是C或者C++
通过__cplusplus
判断C/C++:
1 2 3 4 5 6 7 8 9 10 11 12 |
// 如果是C++,使用扩展C的关键字 #ifdef __cplusplus extern "C" { #endif struct string_t *create_string(int max_len); struct string_t *copy_string(const char *str); void release_string(struct string_t *str); #ifdef __cplusplus } #endif |
评论