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:

#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