Move some macros to common.c

This commit is contained in:
2015-05-02 03:43:29 +02:00
parent 57f052a2be
commit 852c2ac158
2 changed files with 13 additions and 13 deletions

View File

@@ -34,6 +34,19 @@
#include <inttypes.h>
#include <arpa/inet.h>
/// Shorthand to set an error and return failure from the function
#define FAIL(...) \
BLOCK_START \
error_set (e, __VA_ARGS__); \
return false; \
BLOCK_END
// A few other debugging shorthands
#define LOG_FUNC_FAILURE(name, desc) \
print_debug ("%s: %s: %s", __func__, (name), (desc))
#define LOG_LIBC_FAILURE(name) \
print_debug ("%s: %s: %s", __func__, (name), strerror (errno))
// --- Logging -----------------------------------------------------------------
static void