Loading liblog/include/log/log_main.h +25 −20 Original line number Diff line number Diff line Loading @@ -56,7 +56,7 @@ __BEGIN_DECLS /* * Use __VA_ARGS__ if running a static analyzer, * to avoid warnings of unused variables in __VA_ARGS__. * Use contexpr function in C++ mode, so these macros can be used * Use constexpr function in C++ mode, so these macros can be used * in other constexpr functions without warning. */ #ifdef __clang_analyzer__ Loading Loading @@ -132,9 +132,9 @@ extern int __fake_use_va_args(int, ...); */ #ifndef LOG_ALWAYS_FATAL_IF #define LOG_ALWAYS_FATAL_IF(cond, ...) \ ((__predict_false(cond)) \ ? ((void)android_printAssert(#cond, LOG_TAG, ##__VA_ARGS__)) \ : __FAKE_USE_VA_ARGS(__VA_ARGS__)) ((__predict_false(cond)) ? (__FAKE_USE_VA_ARGS(__VA_ARGS__), \ ((void)android_printAssert(#cond, LOG_TAG, ##__VA_ARGS__))) \ : ((void)0)) #endif #ifndef LOG_ALWAYS_FATAL Loading Loading @@ -214,8 +214,9 @@ extern int __fake_use_va_args(int, ...); #define ALOGV_IF(cond, ...) __FAKE_USE_VA_ARGS(__VA_ARGS__) #else #define ALOGV_IF(cond, ...) \ ((__predict_false(cond)) ? ((void)ALOG(LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) \ : __FAKE_USE_VA_ARGS(__VA_ARGS__)) ((__predict_false(cond)) \ ? (__FAKE_USE_VA_ARGS(__VA_ARGS__), (void)ALOG(LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) \ : ((void)0)) #endif #endif Loading @@ -228,8 +229,9 @@ extern int __fake_use_va_args(int, ...); #ifndef ALOGD_IF #define ALOGD_IF(cond, ...) \ ((__predict_false(cond)) ? ((void)ALOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \ : __FAKE_USE_VA_ARGS(__VA_ARGS__)) ((__predict_false(cond)) \ ? (__FAKE_USE_VA_ARGS(__VA_ARGS__), (void)ALOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \ : ((void)0)) #endif /* Loading @@ -241,8 +243,9 @@ extern int __fake_use_va_args(int, ...); #ifndef ALOGI_IF #define ALOGI_IF(cond, ...) \ ((__predict_false(cond)) ? ((void)ALOG(LOG_INFO, LOG_TAG, __VA_ARGS__)) \ : __FAKE_USE_VA_ARGS(__VA_ARGS__)) ((__predict_false(cond)) \ ? (__FAKE_USE_VA_ARGS(__VA_ARGS__), (void)ALOG(LOG_INFO, LOG_TAG, __VA_ARGS__)) \ : ((void)0)) #endif /* Loading @@ -254,8 +257,9 @@ extern int __fake_use_va_args(int, ...); #ifndef ALOGW_IF #define ALOGW_IF(cond, ...) \ ((__predict_false(cond)) ? ((void)ALOG(LOG_WARN, LOG_TAG, __VA_ARGS__)) \ : __FAKE_USE_VA_ARGS(__VA_ARGS__)) ((__predict_false(cond)) \ ? (__FAKE_USE_VA_ARGS(__VA_ARGS__), (void)ALOG(LOG_WARN, LOG_TAG, __VA_ARGS__)) \ : ((void)0)) #endif /* Loading @@ -267,8 +271,9 @@ extern int __fake_use_va_args(int, ...); #ifndef ALOGE_IF #define ALOGE_IF(cond, ...) \ ((__predict_false(cond)) ? ((void)ALOG(LOG_ERROR, LOG_TAG, __VA_ARGS__)) \ : __FAKE_USE_VA_ARGS(__VA_ARGS__)) ((__predict_false(cond)) \ ? (__FAKE_USE_VA_ARGS(__VA_ARGS__), (void)ALOG(LOG_ERROR, LOG_TAG, __VA_ARGS__)) \ : ((void)0)) #endif /* --------------------------------------------------------------------- */ Loading Loading
liblog/include/log/log_main.h +25 −20 Original line number Diff line number Diff line Loading @@ -56,7 +56,7 @@ __BEGIN_DECLS /* * Use __VA_ARGS__ if running a static analyzer, * to avoid warnings of unused variables in __VA_ARGS__. * Use contexpr function in C++ mode, so these macros can be used * Use constexpr function in C++ mode, so these macros can be used * in other constexpr functions without warning. */ #ifdef __clang_analyzer__ Loading Loading @@ -132,9 +132,9 @@ extern int __fake_use_va_args(int, ...); */ #ifndef LOG_ALWAYS_FATAL_IF #define LOG_ALWAYS_FATAL_IF(cond, ...) \ ((__predict_false(cond)) \ ? ((void)android_printAssert(#cond, LOG_TAG, ##__VA_ARGS__)) \ : __FAKE_USE_VA_ARGS(__VA_ARGS__)) ((__predict_false(cond)) ? (__FAKE_USE_VA_ARGS(__VA_ARGS__), \ ((void)android_printAssert(#cond, LOG_TAG, ##__VA_ARGS__))) \ : ((void)0)) #endif #ifndef LOG_ALWAYS_FATAL Loading Loading @@ -214,8 +214,9 @@ extern int __fake_use_va_args(int, ...); #define ALOGV_IF(cond, ...) __FAKE_USE_VA_ARGS(__VA_ARGS__) #else #define ALOGV_IF(cond, ...) \ ((__predict_false(cond)) ? ((void)ALOG(LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) \ : __FAKE_USE_VA_ARGS(__VA_ARGS__)) ((__predict_false(cond)) \ ? (__FAKE_USE_VA_ARGS(__VA_ARGS__), (void)ALOG(LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) \ : ((void)0)) #endif #endif Loading @@ -228,8 +229,9 @@ extern int __fake_use_va_args(int, ...); #ifndef ALOGD_IF #define ALOGD_IF(cond, ...) \ ((__predict_false(cond)) ? ((void)ALOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \ : __FAKE_USE_VA_ARGS(__VA_ARGS__)) ((__predict_false(cond)) \ ? (__FAKE_USE_VA_ARGS(__VA_ARGS__), (void)ALOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \ : ((void)0)) #endif /* Loading @@ -241,8 +243,9 @@ extern int __fake_use_va_args(int, ...); #ifndef ALOGI_IF #define ALOGI_IF(cond, ...) \ ((__predict_false(cond)) ? ((void)ALOG(LOG_INFO, LOG_TAG, __VA_ARGS__)) \ : __FAKE_USE_VA_ARGS(__VA_ARGS__)) ((__predict_false(cond)) \ ? (__FAKE_USE_VA_ARGS(__VA_ARGS__), (void)ALOG(LOG_INFO, LOG_TAG, __VA_ARGS__)) \ : ((void)0)) #endif /* Loading @@ -254,8 +257,9 @@ extern int __fake_use_va_args(int, ...); #ifndef ALOGW_IF #define ALOGW_IF(cond, ...) \ ((__predict_false(cond)) ? ((void)ALOG(LOG_WARN, LOG_TAG, __VA_ARGS__)) \ : __FAKE_USE_VA_ARGS(__VA_ARGS__)) ((__predict_false(cond)) \ ? (__FAKE_USE_VA_ARGS(__VA_ARGS__), (void)ALOG(LOG_WARN, LOG_TAG, __VA_ARGS__)) \ : ((void)0)) #endif /* Loading @@ -267,8 +271,9 @@ extern int __fake_use_va_args(int, ...); #ifndef ALOGE_IF #define ALOGE_IF(cond, ...) \ ((__predict_false(cond)) ? ((void)ALOG(LOG_ERROR, LOG_TAG, __VA_ARGS__)) \ : __FAKE_USE_VA_ARGS(__VA_ARGS__)) ((__predict_false(cond)) \ ? (__FAKE_USE_VA_ARGS(__VA_ARGS__), (void)ALOG(LOG_ERROR, LOG_TAG, __VA_ARGS__)) \ : ((void)0)) #endif /* --------------------------------------------------------------------- */ Loading