Replace USE_X11 macro with ENABLE_EGL_X11.

If x11 support is enabled, then the meson and configure scripts will set
a macro named ENABLE_EGL_X11 instead of USE_X11.

USE_X11 will also select the Xlib typedef of EGLNativeDisplayType in
eglplatform.h, and libglvnd does not need or want those.

Enabling or disabling X11 support for EGL only affects platform
detection in eglGetDisplay. The rest of libEGL is supposed to treat
EGLNativeDisplayType as an opaque void* pointer.
This commit is contained in:
Kyle Brenneman 2021-10-04 09:31:42 -06:00
parent 52747d70e0
commit fa9ef3971f
3 changed files with 6 additions and 6 deletions

View file

@ -203,7 +203,7 @@ AX_PTHREAD()
if test "x$enable_x11" = "xyes" ; then
PKG_CHECK_MODULES([X11], [x11])
AC_DEFINE([USE_X11], 1,
AC_DEFINE([ENABLE_EGL_X11], 1,
[Define to 1 if X11 support is enabled.])
fi
if test "x$enable_glx" = "xyes" ; then

View file

@ -95,7 +95,7 @@ endif
dep_x11_headers = dep_x11.partial_dependency(compile_args : true, includes : true)
if dep_x11.found()
add_project_arguments('-DUSE_X11', language : ['c'])
add_project_arguments('-DENABLE_EGL_X11', language : ['c'])
endif
dep_xext = dep_null

View file

@ -32,7 +32,7 @@
#include <unistd.h>
#include <sys/mman.h>
#if defined(USE_X11)
#if defined(ENABLE_EGL_X11)
#include <X11/Xlib.h>
#endif
@ -176,7 +176,7 @@ static EGLBoolean IsGbmDisplay(void *native_display)
static EGLBoolean IsX11Display(void *dpy)
{
#if defined(USE_X11)
#if defined(ENABLE_EGL_X11)
void *alloc;
void *handle;
void *XAllocID = NULL;
@ -193,9 +193,9 @@ static EGLBoolean IsX11Display(void *dpy)
}
return (XAllocID != NULL && XAllocID == alloc);
#else // defined(USE_X11)
#else // defined(ENABLE_EGL_X11)
return EGL_FALSE;
#endif // defined(USE_X11)
#endif // defined(ENABLE_EGL_X11)
}
static EGLBoolean IsWaylandDisplay(void *native_display)