From b07ada57f14f3250790d781e7b7efc797f00f242 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Sat, 23 Nov 2013 22:58:22 +0100 Subject: improve ABORT macro end _eo_tokenizer_abort() --- eo_tokenizer.rl | 11 ++++++++--- 1 file 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) -- cgit v1.1-2-g2b99