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
diff --git a/media/libstagefright/include/foundation/ADebug.h b/media/libstagefright/include/foundation/ADebug.h
index 9ad45f3..b498c91 100644
--- a/media/libstagefright/include/foundation/ADebug.h
+++ b/media/libstagefright/include/foundation/ADebug.h
@@ -53,6 +53,9 @@
 #define LITERAL_TO_STRING_INTERNAL(x)    #x
 #define LITERAL_TO_STRING(x) LITERAL_TO_STRING_INTERNAL(x)
 
+#ifdef CHECK
+#undef CHECK
+#endif
 #define CHECK(condition)                                \
     LOG_ALWAYS_FATAL_IF(                                \
             !(condition),                               \
@@ -92,6 +95,15 @@
         }                                                               \
     } 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_NE(x,y)   CHECK_OP(x,y,NE,!=)
 #define CHECK_LE(x,y)   CHECK_OP(x,y,LE,<=)