Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 62ee7ec4 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Allow LOG_ALWAYS_FATAL_IF in constexpr functions" am: e2a1705f

Change-Id: Ifcbe6cfc745161c7efde932ca28d557698a03d40
parents 2edb1355 e2a1705f
Loading
Loading
Loading
Loading
+25 −20
Original line number Diff line number Diff line
@@ -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__
@@ -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
@@ -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

@@ -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

/*
@@ -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

/*
@@ -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

/*
@@ -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

/* --------------------------------------------------------------------- */