[Mesa-dev] [PATCH] android: fix liblog API changes

Tapani Pälli tapani.palli at intel.com
Sun Aug 12 23:03:06 PDT 2012


android logging macros changed their name in JellyBean.

Signed-off-by: Bruce E. Robertson <bruce.e.robertson at intel.com>
Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
---
 src/egl/drivers/dri2/platform_android.c | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c
index 66142cd..7e57295 100644
--- a/src/egl/drivers/dri2/platform_android.c
+++ b/src/egl/drivers/dri2/platform_android.c
@@ -660,18 +660,29 @@ droid_open_device(void)
    return (fd >= 0) ? dup(fd) : -1;
 }
 
+/* support versions < JellyBean */
+#ifndef ALOGW
+#define ALOGW LOGW
+#endif
+#ifndef ALOGD
+#define ALOGD LOGD
+#endif
+#ifndef ALOGI
+#define ALOGI LOGI
+#endif
+
 static void
 droid_log(EGLint level, const char *msg)
 {
    switch (level) {
    case _EGL_DEBUG:
-      LOGD("%s", msg);
+      ALOGD("%s", msg);
       break;
    case _EGL_INFO:
-      LOGI("%s", msg);
+      ALOGI("%s", msg);
       break;
    case _EGL_WARNING:
-      LOGW("%s", msg);
+      ALOGW("%s", msg);
       break;
    case _EGL_FATAL:
       LOG_FATAL("%s", msg);
-- 
1.7.11.2



More information about the mesa-dev mailing list