From b3485664f38cb224cedd72e2d8cdadf4e329572f Mon Sep 17 00:00:00 2001 From: Eric Engestrom Date: Sun, 22 Jan 2023 09:38:29 +0000 Subject: [PATCH] egl: only accept APIs that are compiled in Signed-off-by: Eric Engestrom Part-of: --- src/egl/main/eglcurrent.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/egl/main/eglcurrent.h b/src/egl/main/eglcurrent.h index c4d4041d713..270c7dde7a1 100644 --- a/src/egl/main/eglcurrent.h +++ b/src/egl/main/eglcurrent.h @@ -64,12 +64,16 @@ struct _egl_thread_info { static inline EGLBoolean _eglIsApiValid(EGLenum api) { -#ifdef ANDROID +#if HAVE_OPENGL && !defined(ANDROID) /* OpenGL is not a valid/supported API on Android */ - return api == EGL_OPENGL_ES_API; -#else - return (api == EGL_OPENGL_ES_API || api == EGL_OPENGL_API); + if (api == EGL_OPENGL_API) + return true; #endif +#if HAVE_OPENGL_ES_1 || HAVE_OPENGL_ES_2 + if (api == EGL_OPENGL_ES_API) + return true; +#endif + return false; } extern _EGLThreadInfo *