Mesa (master): android: change include "cutils/log.h" to "log/log.h" on Android API >=26

Tapani Pälli tpalli at kemper.freedesktop.org
Mon May 14 05:11:37 UTC 2018


Module: Mesa
Branch: master
Commit: ff7521c9bac3d52f645c68deac7084e20b81b2f5
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ff7521c9bac3d52f645c68deac7084e20b81b2f5

Author: jenny.q.cao <jenny.q.cao at intel.com>
Date:   Fri Apr 27 10:11:36 2018 +0800

android: change include "cutils/log.h" to "log/log.h" on Android API >=26

There is a compile warning from Android 8 (API version 26) from "include cutils/log.h"
warning: "Deprecated: don't include cutils/log.h, use either android/log.h or log/log.h"-W#warnings,
Change to include "log/log.h" on Android 8 or later major version to avoid this warning

Signed-off-by: jenny.q.cao <jenny.q.cao at intel.com>
Reviewed-by: Tapani Pälli <tapani.palli at intel.com>

---

 src/broadcom/common/v3d_debug.h           | 4 ++++
 src/egl/main/egllog.c                     | 4 ++++
 src/intel/common/gen_debug.h              | 4 ++++
 src/mesa/drivers/dri/i915/intel_context.h | 4 ++++
 4 files changed, 16 insertions(+)

diff --git a/src/broadcom/common/v3d_debug.h b/src/broadcom/common/v3d_debug.h
index bdb9518548..75eb2718f3 100644
--- a/src/broadcom/common/v3d_debug.h
+++ b/src/broadcom/common/v3d_debug.h
@@ -57,7 +57,11 @@ extern uint32_t V3D_DEBUG;
 
 #ifdef HAVE_ANDROID_PLATFORM
 #define LOG_TAG "BROADCOM-MESA"
+#if ANDROID_API_LEVEL >= 26
+#include <log/log.h>
+#else
 #include <cutils/log.h>
+#endif /* use log/log.h start from android 8 major version */
 #ifndef ALOGW
 #define ALOGW LOGW
 #endif
diff --git a/src/egl/main/egllog.c b/src/egl/main/egllog.c
index 64ff474c65..c223f49b0f 100644
--- a/src/egl/main/egllog.c
+++ b/src/egl/main/egllog.c
@@ -47,7 +47,11 @@
 
 #ifdef HAVE_ANDROID_PLATFORM
 #define LOG_TAG "EGL-MAIN"
+#if ANDROID_API_LEVEL >= 26
+#include <log/log.h>
+#else
 #include <cutils/log.h>
+#endif /* use log/log.h start from android 8 major version */
 
 #endif /* HAVE_ANDROID_PLATFORM */
 
diff --git a/src/intel/common/gen_debug.h b/src/intel/common/gen_debug.h
index da5b5a569d..f6c44eeb91 100644
--- a/src/intel/common/gen_debug.h
+++ b/src/intel/common/gen_debug.h
@@ -86,7 +86,11 @@ extern uint64_t INTEL_DEBUG;
 
 #ifdef HAVE_ANDROID_PLATFORM
 #define LOG_TAG "INTEL-MESA"
+#if ANDROID_API_LEVEL >= 26
+#include <log/log.h>
+#else
 #include <cutils/log.h>
+#endif /* use log/log.h start from android 8 major version */
 #ifndef ALOGW
 #define ALOGW LOGW
 #endif
diff --git a/src/mesa/drivers/dri/i915/intel_context.h b/src/mesa/drivers/dri/i915/intel_context.h
index a219c7fb1d..a8339896f6 100644
--- a/src/mesa/drivers/dri/i915/intel_context.h
+++ b/src/mesa/drivers/dri/i915/intel_context.h
@@ -284,7 +284,11 @@ extern int INTEL_DEBUG;
 
 #ifdef HAVE_ANDROID_PLATFORM
 #define LOG_TAG "INTEL-MESA"
+#if ANDROID_API_LEVEL >= 26
+#include <log/log.h>
+#else
 #include <cutils/log.h>
+#endif /* use log/log.h start from android 8 major version */
 #ifndef ALOGW
 #define ALOGW LOGW
 #endif




More information about the mesa-commit mailing list