__zero__

winlinux

Oct 7th, 2019
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.59 KB | None | 0 0
  1. #if defined(_WIN32)
  2. #define WDEF_ 1
  3. #define LDEF_ 0
  4. #include "windefs.h"
  5. #else if defined(__gnu_linux__) || defined(__linux__)
  6. #define LDEF_ 1
  7. #define WDEF_ 0
  8. #include <sys/uninstd.h>
  9. #endif
  10.  
  11. #include <stdio.h>
  12. #include <stdint.h>
  13. #include <stdlib.h>
  14.  
  15. #if WDEF_
  16. int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine, int nCmdShow) {
  17.     return MessageBox(NULL, "Windows Application!", "Alert", MB_OK);
  18. }
  19. #else if LDEF_
  20. int main(int argc, char[]* argv) {
  21.     printf("[Alert]: Linux Application!");
  22.     return 0;
  23. #endif
  24.  
  25. /*
  26. * THIS WILL NOT COMPILE
  27. *
  28. * true?
  29. */
Advertisement
Add Comment
Please, Sign In to add comment