常用的C/C++ 内置宏
这是我在VS2015下运行的
cout << "file = " << __FILE__ << endl;
cout << "line = " << __LINE__ << endl;
cout << "date = " << __DATE__ << endl;
cout << "time = " << __TIME__ << endl;
#ifdef __STDC__
cout << "stdc = " << __STDC__ << endl;
#endif
cout << "func = " << __func__ << endl;
#ifdef __cplusplus
cout << "cplusplus = " << __cplusplus << endl;
#endif
#ifdef __STDC_VERSION__
cout << "stdc version = " << __STDC_VERSION__ << endl;
#endif // __STDC_VERSION__
其中有几个是没有的
这个是clang20 编译的结果,