From 8762b2fca1e0334f363d12481937fa6e4eb340cc Mon Sep 17 00:00:00 2001 From: Yiwei Zhang Date: Tue, 30 Jan 2024 14:03:49 -0800 Subject: [PATCH] egl: refactor to use DETECT_OS_ANDROID instead of ANDROID Signed-off-by: Yiwei Zhang Reviewed-by: Yonggang Luo Part-of: --- src/egl/main/eglapi.c | 3 ++- src/egl/main/eglcurrent.h | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c index 3ee3f1b598c..b96a152d3be 100644 --- a/src/egl/main/eglapi.c +++ b/src/egl/main/eglapi.c @@ -93,6 +93,7 @@ #include #include "c11/threads.h" #include "mapi/glapi/glapi.h" +#include "util/detect_os.h" #include "util/macros.h" #include "util/perf/cpu_trace.h" #include "util/u_debug.h" @@ -652,7 +653,7 @@ _eglComputeVersion(_EGLDisplay *disp) disp->Version = 15; /* For Android P and below limit the EGL version to 1.4 */ -#if defined(ANDROID) && ANDROID_API_LEVEL <= 28 +#if DETECT_OS_ANDROID && ANDROID_API_LEVEL <= 28 disp->Version = 14; #endif } diff --git a/src/egl/main/eglcurrent.h b/src/egl/main/eglcurrent.h index 270c7dde7a1..e0f6f7b6b12 100644 --- a/src/egl/main/eglcurrent.h +++ b/src/egl/main/eglcurrent.h @@ -30,6 +30,8 @@ #include +#include "util/detect_os.h" + #include "egltypedefs.h" #ifdef __cplusplus @@ -64,7 +66,7 @@ struct _egl_thread_info { static inline EGLBoolean _eglIsApiValid(EGLenum api) { -#if HAVE_OPENGL && !defined(ANDROID) +#if HAVE_OPENGL && !DETECT_OS_ANDROID /* OpenGL is not a valid/supported API on Android */ if (api == EGL_OPENGL_API) return true;