From b5fb6d0f18fed511256fd3aa07bb3eccbbb15f80 Mon Sep 17 00:00:00 2001 From: John Reck Date: Fri, 14 Mar 2014 18:38:24 -0700 Subject: Fix ALOG_ASSERT Change-Id: I3484aa7b62ad883a94ef68ec2c65841716d85a2c --- framesequence/jni/utils/log.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/framesequence/jni/utils/log.h b/framesequence/jni/utils/log.h index 5e15f30..d8441dc 100644 --- a/framesequence/jni/utils/log.h +++ b/framesequence/jni/utils/log.h @@ -267,6 +267,20 @@ extern "C" { if (__android_log_assert(ANDROID_##priority, tag)) #endif +/* Returns 2nd arg. Used to substitute default value if caller's vararg list + * is empty. + */ +#define __android_second(dummy, second, ...) second + +/* If passed multiple args, returns ',' followed by all but 1st arg, otherwise + * returns nothing. + */ +#define __android_rest(first, ...) , ## __VA_ARGS__ + +#define android_printAssert(cond, tag, fmt...) \ + __android_log_assert(cond, tag, \ + __android_second(0, ## fmt, NULL) __android_rest(fmt)) + #ifdef __cplusplus } #endif -- cgit v1.2.3