Advertisement
Guest User

Untitled

a guest
Apr 19th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #define DEBUG_STR_SIZE 1024
  2. char debug_str[DEBUG_STR_SIZE];
  3.  
  4. #define LOG_ERROR(...) { \
  5. snprintf(debug_str, DEBUG_STR_SIZE, "*** thalloc *** "); \
  6. write(1, debug_str, sizeof("*** thalloc *** ")); \
  7. memset(debug_str, 0, DEBUG_STR_SIZE); \
  8. snprintf(debug_str, DEBUG_STR_SIZE, __VA_ARGS__); \
  9. write(1, debug_str, DEBUG_STR_SIZE); \
  10. }
  11.  
  12. #ifdef DEBUG
  13. #define LOG_DEBUG(...) LOG_ERROR(__VA_ARGS__)
  14. #else
  15. #define LOG_DEBUG(...) {}
  16. #endif // DEBUG
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement