Advertisement
Darker666

HW templates for PRP

Nov 20th, 2016
99
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #ifdef HOME
  2.     #ifdef _WIN32
  3.         #define PAUSE system("pause")
  4.     #else
  5.         #define PAUSE system("read -n1 -r -p \"Press any key to continue...\"")
  6.     #endif
  7.  
  8.     #define chyba(E, N, ...) {fprintf(stderr, E, ##__VA_ARGS__); fprintf(stderr, "\n"); PAUSE; exit(N);}
  9.     #define chyba_debug(E, N, ...) chyba(E, N, ##__VA_ARGS__)
  10.     #define chyba1(E, ...) {fprintf(stderr, E, ##__VA_ARGS__); PAUSE; exit(1);}
  11.  
  12.     #define log_err(M, ...) {fprintf(stderr, "[ERROR] " M " [%s:%d]\a\n", ##__VA_ARGS__, __FILE__, __LINE__); PAUSE;exit(1);}
  13.  
  14.     #define log_warn(M, ...) fprintf(stderr, "[WARN] (%s:%d:) " M "\n", __FILE__, __LINE__, ##__VA_ARGS__)
  15.  
  16.     #define log_info(M, ...) {\
  17.              printf("[INFO] " M " [%s:%d]\n",##__VA_ARGS__, __FILE__, __LINE__);\
  18.     }
  19.  
  20. #else
  21.    
  22.     #define chyba(E, N, ...) {fprintf(stderr, E, ##__VA_ARGS__); fprintf(stderr, "\n");exit(N);}
  23.     #define chyba_debug(E, N, ...)
  24.     #define chyba1(E, ...) {exit(1);}
  25.     #define PAUSE
  26.     #define log_info(M, ...)
  27.     #define log_warn(M, ...)
  28.     #define log_info(M, ...)
  29. #endif
Advertisement
RAW Paste Data Copied
Advertisement