is there any #define that can be checked to see if your source file is being compiled in an ansi-compliant enviornment?
is there any #define that can be checked to see if your source file is being compiled in an ansi-compliant enviornment?
hello, internet!
There's a macro called __STDC__ which you can check. If the compiler supports standard C then __STDC__ will be defined as one, otherwise it will be undefined.
Try running this. In MSVC++ 6 if you run the program with the /Za switch active then it will output 'Standard!' and if you turn off the /Za switch it will print 'Bugger!':
-PreludeCode:#include <stdio.h> int main ( void ) { #ifdef __STDC__ (void)puts ( "Standard!" ); #else (void)puts ( "Bugger!" ); #endif return 0; }
My best code is written with the delete key.