From bccb33236fc41e4cd6d33865a71ae9d52a88493b Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Thu, 20 Jul 2023 23:25:16 +0900 Subject: [PATCH] internal/glfw/glfw: move xkb_unicode.* and X11 files --- internal/glfw/glfw/c_glfw_linbsd.go | 2 -- internal/glfw/glfw/glfw/src/wl_platform.h | 2 +- internal/glfw/glfw/glfw/src/x11_platform.h | 4 ++-- .../glfw/{glfw/src/glx_context.c => glx_context_linbsd.c} | 2 ++ .../glfw/{glfw/src/glx_context.h => glx_context_linbsd.h} | 2 ++ .../glfw/{glfw/src/xkb_unicode.c => xkb_unicode_linbsd.c} | 2 ++ .../glfw/{glfw/src/xkb_unicode.h => xkb_unicode_linbsd.h} | 2 ++ 7 files changed, 11 insertions(+), 5 deletions(-) rename internal/glfw/glfw/{glfw/src/glx_context.c => glx_context_linbsd.c} (99%) rename internal/glfw/glfw/{glfw/src/glx_context.h => glx_context_linbsd.h} (99%) rename internal/glfw/glfw/{glfw/src/xkb_unicode.c => xkb_unicode_linbsd.c} (99%) rename internal/glfw/glfw/{glfw/src/xkb_unicode.h => xkb_unicode_linbsd.h} (96%) diff --git a/internal/glfw/glfw/c_glfw_linbsd.go b/internal/glfw/glfw/c_glfw_linbsd.go index fb7d0b06e..924a2181e 100644 --- a/internal/glfw/glfw/c_glfw_linbsd.go +++ b/internal/glfw/glfw/c_glfw_linbsd.go @@ -22,8 +22,6 @@ package glfw #include "glfw/src/x11_init.c" #include "glfw/src/x11_monitor.c" #include "glfw/src/x11_window.c" - #include "glfw/src/glx_context.c" #endif -#include "glfw/src/xkb_unicode.c" */ import "C" diff --git a/internal/glfw/glfw/glfw/src/wl_platform.h b/internal/glfw/glfw/glfw/src/wl_platform.h index cdf4d3231..d38f33457 100644 --- a/internal/glfw/glfw/glfw/src/wl_platform.h +++ b/internal/glfw/glfw/glfw/src/wl_platform.h @@ -31,7 +31,7 @@ #include "posix_thread.h" #include "posix_time_linbsd.h" -#include "xkb_unicode.h" +#include "xkb_unicode_linbsd.h" #include "egl_context.h" #include "osmesa_context.h" diff --git a/internal/glfw/glfw/glfw/src/x11_platform.h b/internal/glfw/glfw/glfw/src/x11_platform.h index 0b7c0fb35..83e2b9638 100644 --- a/internal/glfw/glfw/glfw/src/x11_platform.h +++ b/internal/glfw/glfw/glfw/src/x11_platform.h @@ -125,8 +125,8 @@ typedef XRenderPictFormat* (* PFN_XRenderFindVisualFormat)(Display*,Visual const #include "posix_thread.h" #include "posix_time_linbsd.h" -#include "xkb_unicode.h" -#include "glx_context.h" +#include "xkb_unicode_linbsd.h" +#include "glx_context_linbsd.h" #include "egl_context.h" #include "osmesa_context.h" diff --git a/internal/glfw/glfw/glfw/src/glx_context.c b/internal/glfw/glfw/glx_context_linbsd.c similarity index 99% rename from internal/glfw/glfw/glfw/src/glx_context.c rename to internal/glfw/glfw/glx_context_linbsd.c index 1b1b3f90d..e935fce9c 100644 --- a/internal/glfw/glfw/glfw/src/glx_context.c +++ b/internal/glfw/glfw/glx_context_linbsd.c @@ -27,6 +27,8 @@ // It is fine to use C99 in this file because it will not be built with VS //======================================================================== +//go:build (freebsd || linux || netbsd || openbsd) && !wayland + #include "internal.h" #include diff --git a/internal/glfw/glfw/glfw/src/glx_context.h b/internal/glfw/glfw/glx_context_linbsd.h similarity index 99% rename from internal/glfw/glfw/glfw/src/glx_context.h rename to internal/glfw/glfw/glx_context_linbsd.h index df0233eba..e93c78593 100644 --- a/internal/glfw/glfw/glfw/src/glx_context.h +++ b/internal/glfw/glfw/glx_context_linbsd.h @@ -25,6 +25,8 @@ // //======================================================================== +//go:build (freebsd || linux || netbsd || openbsd) && !wayland + #define GLX_VENDOR 1 #define GLX_RGBA_BIT 0x00000001 #define GLX_WINDOW_BIT 0x00000001 diff --git a/internal/glfw/glfw/glfw/src/xkb_unicode.c b/internal/glfw/glfw/xkb_unicode_linbsd.c similarity index 99% rename from internal/glfw/glfw/glfw/src/xkb_unicode.c rename to internal/glfw/glfw/xkb_unicode_linbsd.c index 859bedcae..38718366a 100644 --- a/internal/glfw/glfw/glfw/src/xkb_unicode.c +++ b/internal/glfw/glfw/xkb_unicode_linbsd.c @@ -27,6 +27,8 @@ // It is fine to use C99 in this file because it will not be built with VS //======================================================================== +//go:build freebsd || linux || netbsd || openbsd + #include "internal.h" diff --git a/internal/glfw/glfw/glfw/src/xkb_unicode.h b/internal/glfw/glfw/xkb_unicode_linbsd.h similarity index 96% rename from internal/glfw/glfw/glfw/src/xkb_unicode.h rename to internal/glfw/glfw/xkb_unicode_linbsd.h index be97cdcb8..ee557b6ac 100644 --- a/internal/glfw/glfw/glfw/src/xkb_unicode.h +++ b/internal/glfw/glfw/xkb_unicode_linbsd.h @@ -24,6 +24,8 @@ // //======================================================================== +//go:build freebsd || linux || netbsd || openbsd + #define GLFW_INVALID_CODEPOINT 0xffffffffu uint32_t _glfwKeySym2Unicode(unsigned int keysym);