Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define DEBUG_STR_SIZE 1024
- char debug_str[DEBUG_STR_SIZE];
- #define LOG_ERROR(...) { \
- snprintf(debug_str, DEBUG_STR_SIZE, "*** thalloc *** "); \
- write(1, debug_str, sizeof("*** thalloc *** ")); \
- memset(debug_str, 0, DEBUG_STR_SIZE); \
- snprintf(debug_str, DEBUG_STR_SIZE, __VA_ARGS__); \
- write(1, debug_str, DEBUG_STR_SIZE); \
- }
- #ifdef DEBUG
- #define LOG_DEBUG(...) LOG_ERROR(__VA_ARGS__)
- #else
- #define LOG_DEBUG(...) {}
- #endif // DEBUG
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement