Skip to content

Instantly share code, notes, and snippets.

@1nnOc3nt
Last active January 4, 2019 02:10
Show Gist options
  • Save 1nnOc3nt/39a2262f7b7bceddb8b91f8fcc60f079 to your computer and use it in GitHub Desktop.
Save 1nnOc3nt/39a2262f7b7bceddb8b91f8fcc60f079 to your computer and use it in GitHub Desktop.
#ifdef __unix__ /* __unix__ is usually defined by compilers targeting Unix systems */
printf("using linux");
#elif defined _WIN32 /* _WIN32 is usually defined by compilers targeting 32 or 64 bit Windows systems */
printf("using windows");
#endif
-------------------------------------------------------------------------------------------------------
/* Unix systems */
# 1 "hello.c"
# 1 "<built-in>"
# 1 "<command-line>"
# 31 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 32 "<command-line>" 2
# 1 "hello.c"
printf("using linux");
-------------------------------------------------------------------------------------------------------
/* Windows systems */
# 1 "hello.c"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "hello.c"
printf("using windows");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment