-
-
Save xyzz/157b4dcca0ec792864e3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xyz@xyz-pc /tmp $ cat test.c | |
int main() { | |
#if defined(linux) | |
return 1; | |
#elif defined(__linux) | |
return 2; | |
#elif defined(__linux__) | |
return 3; | |
#endif | |
} | |
xyz@xyz-pc /tmp $ g++ test.c && ./a.out; echo $? | |
1 | |
xyz@xyz-pc /tmp $ g++ -std=c++0x test.c && ./a.out; echo $? | |
2 | |
xyz@xyz-pc /tmp $ g++ -std=c++11 test.c && ./a.out; echo $? | |
2 | |
xyz@xyz-pc /tmp $ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment