This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

__cplusplus is not defined in .h files

when I test the __cplusplus version in the .cpp, keil uvison shows the correct one

But, when I test it in the h. file, keil uvison  doesn't show the same version as in .cpp .

code:

Fullscreen
1
2
3
4
5
6
7
8
9
#if (__cplusplus < 201103L)
#define MY_TEST_H 0 // greyed out in .cpp file
#endif
#if (__cplusplus >= 201103L)
#define YOUR_TEST_H 11 // greyed out in .h file
#endif
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

0