diff --git a/src/egl/main/egldisplay.c b/src/egl/main/egldisplay.c index aa0c2d3a332..739d7d0aac3 100644 --- a/src/egl/main/egldisplay.c +++ b/src/egl/main/egldisplay.c @@ -128,11 +128,10 @@ _eglNativePlatformDetectNativeDisplay(void *nativeDisplay) if (nativeDisplay == EGL_DEFAULT_DISPLAY) return _EGL_INVALID_PLATFORM; +#if defined(HAVE_WAYLAND_PLATFORM) || defined(HAVE_DRM_PLATFORM) if (_eglPointerIsDereferencable(nativeDisplay)) { void *first_pointer = *(void **) nativeDisplay; - (void) first_pointer; /* silence unused var warning */ - #ifdef HAVE_WAYLAND_PLATFORM /* wl_display is a wl_proxy, which is a wl_object. * wl_object's first element points to the interfacetype. */ @@ -146,6 +145,7 @@ _eglNativePlatformDetectNativeDisplay(void *nativeDisplay) return _EGL_PLATFORM_DRM; #endif } +#endif return _EGL_INVALID_PLATFORM; }