From 3b0d65ad10ec729f34b788ec400a16f86bdd6306 Mon Sep 17 00:00:00 2001 From: Alex Vakulenko Date: Wed, 27 Apr 2016 14:37:00 -0700 Subject: [PATCH] Change remaining Android logging macros to use C99 varidaic syntax Most of the system/core/include/log/log.h file uses the C99 syntax of variadic macros (that is, '...' in parameter list and __VA_ARGS__ in arguments). Except for andoid_printLog and android_printAssert which still uses GCC custom extension syntax. Switched the remaining macros to use C99 syntax. GCC extension syntax makes my editor's code parser puke. BUG: None Change-Id: Ia6ebc0f2044b64182c425b179da0229c7046be4a --- include/log/log.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/log/log.h b/include/log/log.h index e606a842f..045feca6a 100644 --- a/include/log/log.h +++ b/include/log/log.h @@ -614,11 +614,11 @@ int android_log_destroy(android_log_context *ctx); * The stuff in the rest of this file should not be used directly. */ -#define android_printLog(prio, tag, fmt...) \ - __android_log_print(prio, tag, fmt) +#define android_printLog(prio, tag, ...) \ + __android_log_print(prio, tag, __VA_ARGS__) -#define android_vprintLog(prio, cond, tag, fmt...) \ - __android_log_vprint(prio, tag, fmt) +#define android_vprintLog(prio, cond, tag, ...) \ + __android_log_vprint(prio, tag, __VA_ARGS__) /* XXX Macros to work around syntax errors in places where format string * arg is not passed to ALOG_ASSERT, LOG_ALWAYS_FATAL or LOG_ALWAYS_FATAL_IF @@ -635,9 +635,9 @@ int android_log_destroy(android_log_context *ctx); */ #define __android_rest(first, ...) , ## __VA_ARGS__ -#define android_printAssert(cond, tag, fmt...) \ +#define android_printAssert(cond, tag, ...) \ __android_log_assert(cond, tag, \ - __android_second(0, ## fmt, NULL) __android_rest(fmt)) + __android_second(0, ## __VA_ARGS__, NULL) __android_rest(__VA_ARGS__)) #define android_writeLog(prio, tag, text) \ __android_log_write(prio, tag, text)