summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2013-11-23 22:58:22 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2013-11-23 22:58:22 +0100
commitb07ada57f14f3250790d781e7b7efc797f00f242 (patch)
treef928b5ceb6b34b9a70989e308fb2d65022b9d3b8
parentbe2ece6ff7fbd90ddc42c38cab46250a31ad20e4 (diff)
downloadeo_tokenizer-b07ada57f14f3250790d781e7b7efc797f00f242.zip
eo_tokenizer-b07ada57f14f3250790d781e7b7efc797f00f242.tar.gz
improve ABORT macro end _eo_tokenizer_abort()
-rw-r--r--eo_tokenizer.rl11
1 files changed, 8 insertions, 3 deletions
diff --git a/eo_tokenizer.rl b/eo_tokenizer.rl
index 94e8a50..63b7a4b 100644
--- a/eo_tokenizer.rl
+++ b/eo_tokenizer.rl
@@ -6,13 +6,18 @@
static void
_eo_tokenizer_abort(Eo_Tokenizer *toknz,
const char *file, const char* fct, int line,
- const char *msg)
+ const char *fmt, ...)
{
- eina_log_print(_eo_tokenizer_log_dom, EINA_LOG_LEVEL_ERR, file, fct, line, msg);
+ va_list ap;
+ va_start (ap, fmt);
+ eina_log_vprint(_eo_tokenizer_log_dom, EINA_LOG_LEVEL_ERR,
+ file, fct, line, fmt, ap);
+ va_end(ap);
eo_tokenizer_dump(toknz);
exit(EXIT_FAILURE);
}
-#define ABORT(toknz, msg) _eo_tokenizer_abort(toknz, __FILE__, __FUNCTION__, __LINE__, msg);
+#define ABORT(toknz, ...) \
+ _eo_tokenizer_abort(toknz, __FILE__, __FUNCTION__, __LINE__, __VA_ARGS__);
static const char*
_eo_tokenizer_token_get(Eo_Tokenizer *toknz, char *p)