summaryrefslogtreecommitdiffstats
path: root/platform/linuxbsd/x11/detect_prime_x11.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'platform/linuxbsd/x11/detect_prime_x11.cpp')
-rw-r--r--platform/linuxbsd/x11/detect_prime_x11.cpp23
1 files changed, 14 insertions, 9 deletions
diff --git a/platform/linuxbsd/x11/detect_prime_x11.cpp b/platform/linuxbsd/x11/detect_prime_x11.cpp
index 8d586599e6..2b5776ce54 100644
--- a/platform/linuxbsd/x11/detect_prime_x11.cpp
+++ b/platform/linuxbsd/x11/detect_prime_x11.cpp
@@ -28,23 +28,26 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
-#ifdef X11_ENABLED
-#if defined(GLES3_ENABLED)
+#if defined(X11_ENABLED) && defined(GLES3_ENABLED)
#include "detect_prime_x11.h"
#include "core/string/print_string.h"
#include "core/string/ustring.h"
-#include <stdlib.h>
-
#include "thirdparty/glad/glad/gl.h"
#include "thirdparty/glad/glad/glx.h"
-#include "dynwrappers/xlib-so_wrap.h"
-
-#include <cstring>
+#ifdef SOWRAP_ENABLED
+#include "x11/dynwrappers/xlib-so_wrap.h"
+#else
+#include <X11/XKBlib.h>
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
@@ -54,6 +57,9 @@
typedef GLXContext (*GLXCREATECONTEXTATTRIBSARBPROC)(Display *, GLXFBConfig, GLXContext, Bool, const int *);
+// To prevent shadowing warnings
+#undef glGetString
+
struct vendor {
const char *glxvendor = nullptr;
int priority = 0;
@@ -256,5 +262,4 @@ int detect_prime() {
return preferred;
}
-#endif
-#endif
+#endif // X11_ENABLED && GLES3_ENABLED