mirror of
https://github.com/TokTok/c-toxcore
synced 2026-04-26 00:12:13 +00:00
Fixed style in several macros.
This commit is contained in:
@@ -39,26 +39,26 @@ unsigned char *hex_string_to_bin(char hex_string[]);
|
||||
#include <string.h>
|
||||
|
||||
#define DEBUG_PRINT(str, ...) do { \
|
||||
char msg[1000]; \
|
||||
sprintf(msg, "%s(): line %d (file %s): %s%%c\n", __FUNCTION__, __LINE__, __FILE__, str); \
|
||||
fprintf(stderr, msg, __VA_ARGS__); \
|
||||
} while (0)
|
||||
char msg[1000]; \
|
||||
sprintf(msg, "%s(): line %d (file %s): %s%%c\n", __FUNCTION__, __LINE__, __FILE__, str); \
|
||||
fprintf(stderr, msg, __VA_ARGS__); \
|
||||
} while (0)
|
||||
|
||||
#define WARNING(...) do { \
|
||||
fprintf(stderr, "warning in "); \
|
||||
DEBUG_PRINT(__VA_ARGS__, ' '); \
|
||||
} while (0)
|
||||
fprintf(stderr, "warning in "); \
|
||||
DEBUG_PRINT(__VA_ARGS__, ' '); \
|
||||
} while (0)
|
||||
|
||||
#define INFO(...) do { \
|
||||
DEBUG_PRINT(__VA_ARGS__, ' '); \
|
||||
} while (0)
|
||||
DEBUG_PRINT(__VA_ARGS__, ' '); \
|
||||
} while (0)
|
||||
|
||||
#undef ERROR
|
||||
#define ERROR(exit_status, ...) do { \
|
||||
fprintf(stderr, "error in "); \
|
||||
DEBUG_PRINT(__VA_ARGS__, ' '); \
|
||||
exit(exit_status); \
|
||||
} while (0)
|
||||
fprintf(stderr, "error in "); \
|
||||
DEBUG_PRINT(__VA_ARGS__, ' '); \
|
||||
exit(exit_status); \
|
||||
} while (0)
|
||||
#else
|
||||
#define WARNING(...)
|
||||
#define INFO(...)
|
||||
|
||||
Reference in New Issue
Block a user