aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2015-05-02 03:43:29 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2015-05-02 03:43:29 +0200
commit852c2ac1583ec9a7033626b93c8e894083ceaae3 (patch)
tree5d449c76b60135bf4d0ff94e5ef782582b054f63
parent57f052a2bed1a427fcd7f004c4a7bf88264a26a0 (diff)
downloadxK-852c2ac1583ec9a7033626b93c8e894083ceaae3.tar.gz
xK-852c2ac1583ec9a7033626b93c8e894083ceaae3.tar.xz
xK-852c2ac1583ec9a7033626b93c8e894083ceaae3.zip
Move some macros to common.c
-rw-r--r--common.c13
-rw-r--r--degesch.c13
2 files changed, 13 insertions, 13 deletions
diff --git a/common.c b/common.c
index 3145f74..6210011 100644
--- a/common.c
+++ b/common.c
@@ -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
diff --git a/degesch.c b/degesch.c
index dabf6d7..3246d30 100644
--- a/degesch.c
+++ b/degesch.c
@@ -107,19 +107,6 @@ static struct config_item g_config_table[] =
// All text stored in our data structures is encoded in UTF-8.
// Or at least should be. The exception is IRC identifiers.
-/// 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))
-
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// We need a few reference countable objects with support