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

Commit 62adc938 authored by Colin Cross's avatar Colin Cross
Browse files

HACK: work around both android-base/logging.h and ADebug.h defining CHECK

One version of the CHECK_* macros are defined by
android-base/logging.h, and another by ADebug.h.  Eventually
the ADebug.h ones should be replaced with the libbase ones, but
that ripples out into a long dependency chain that needs to link
against libbase.  The redefined macro warnings were hidden by the
use of -isystem to include frameworks/av/include.  Hack around it
for now by undefining the libbase ones if they exist.

Bug: 31751828
Bug: 37782039
Test: m -j checkbuild
Change-Id: Ifabff1c2bc6bac198804c951e98f3fee282cd018
(cherry picked from commit 1b1686db)
parent e374617c
Loading
Loading
Loading
Loading
+12 −0
Original line number Original line Diff line number Diff line
@@ -53,6 +53,9 @@ inline static const char *asString(status_t i, const char *def = "??") {
#define LITERAL_TO_STRING_INTERNAL(x)    #x
#define LITERAL_TO_STRING_INTERNAL(x)    #x
#define LITERAL_TO_STRING(x) LITERAL_TO_STRING_INTERNAL(x)
#define LITERAL_TO_STRING(x) LITERAL_TO_STRING_INTERNAL(x)


#ifdef CHECK
#undef CHECK
#endif
#define CHECK(condition)                                \
#define CHECK(condition)                                \
    LOG_ALWAYS_FATAL_IF(                                \
    LOG_ALWAYS_FATAL_IF(                                \
            !(condition),                               \
            !(condition),                               \
@@ -92,6 +95,15 @@ MAKE_COMPARATOR(GT,>)
        }                                                               \
        }                                                               \
    } while (false)
    } while (false)


#ifdef CHECK_EQ
#undef CHECK_EQ
#undef CHECK_NE
#undef CHECK_LE
#undef CHECK_LT
#undef CHECK_GE
#undef CHECK_GT
#endif

#define CHECK_EQ(x,y)   CHECK_OP(x,y,EQ,==)
#define CHECK_EQ(x,y)   CHECK_OP(x,y,EQ,==)
#define CHECK_NE(x,y)   CHECK_OP(x,y,NE,!=)
#define CHECK_NE(x,y)   CHECK_OP(x,y,NE,!=)
#define CHECK_LE(x,y)   CHECK_OP(x,y,LE,<=)
#define CHECK_LE(x,y)   CHECK_OP(x,y,LE,<=)