Hello, I would like to test the version of both the EC++ and C compilers and return an #error message if they don't match what it is supposed to be. Just to make sure that no-one will compile and run the code with another toolchain without being warned. So here it goes, in a .cpp file:
// test.cpp #ifdef __cplusplus #if __EC166__ != 109 #error Wrong EC++ compiler version #endif #endif #if __C166__ != 0 #error Wrong C compiler version #endif unsigned int i; // end of file
// v_2.45.2, Fri Oct 28 19:01:33 2005 #line 1 "deleteme.cpp" #line 12 unsigned i = 0;
// test.cpp #ifdef __cplusplus #if __EC166__ != 109 #error Wrong EC++ compiler version #endif #endif #if __C166__ != 602 #error Wrong C compiler version << error here #endif unsigned int i; // end of file
// test.c #ifdef __cplusplus #if __EC166__ != 109 #error Wrong EC++ compiler version #endif #endif #if __C166__ != 602 #error Wrong C compiler version #endif unsigned int i; // end of file
Drew, Thank you for your reply. Eventually, I think I'll use a .cpp file to test the EC++ version, and besides that, a .c file to test the C compiler version. That will take care of it. I wish I could test both things in the same .cpp file but that doesn't seem to be possible... -Stéphane