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