From f6e5d2eca6b2fdf400272ed627068719e194ff44 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Fri, 21 Jul 2023 00:00:56 +0900 Subject: [PATCH] internal/glfw/glfw: remove unnecessary files --- internal/glfw/glfw/c_glfw_linbsd.go | 5 ----- internal/glfw/glfw/internal.h | 2 +- .../glfw/glfw/{glfw/src/x11_init.c => x11_init_linbsd.c} | 2 ++ .../glfw/{glfw/src/x11_monitor.c => x11_monitor_linbsd.c} | 2 ++ .../glfw/{glfw/src/x11_platform.h => x11_platform_linbsd.h} | 4 +++- .../glfw/glfw/{glfw/src/x11_window.c => x11_window_linbsd.c} | 2 ++ 6 files changed, 10 insertions(+), 7 deletions(-) rename internal/glfw/glfw/{glfw/src/x11_init.c => x11_init_linbsd.c} (99%) rename internal/glfw/glfw/{glfw/src/x11_monitor.c => x11_monitor_linbsd.c} (99%) rename internal/glfw/glfw/{glfw/src/x11_platform.h => x11_platform_linbsd.h} (99%) rename internal/glfw/glfw/{glfw/src/x11_window.c => x11_window_linbsd.c} (99%) diff --git a/internal/glfw/glfw/c_glfw_linbsd.go b/internal/glfw/glfw/c_glfw_linbsd.go index 924a2181e..07b5eb54f 100644 --- a/internal/glfw/glfw/c_glfw_linbsd.go +++ b/internal/glfw/glfw/c_glfw_linbsd.go @@ -18,10 +18,5 @@ package glfw #include "glfw/src/wayland-xdg-decoration-unstable-v1-client-protocol.c" #include "glfw/src/wayland-xdg-shell-client-protocol.c" #endif -#ifdef _GLFW_X11 - #include "glfw/src/x11_init.c" - #include "glfw/src/x11_monitor.c" - #include "glfw/src/x11_window.c" -#endif */ import "C" diff --git a/internal/glfw/glfw/internal.h b/internal/glfw/glfw/internal.h index d369c750f..62fb4c2a4 100644 --- a/internal/glfw/glfw/internal.h +++ b/internal/glfw/glfw/internal.h @@ -115,7 +115,7 @@ typedef const GLubyte* (APIENTRY * PFNGLGETSTRINGIPROC)(GLenum,GLuint); #if defined(_GLFW_COCOA) #include "cocoa_platform_darwin.h" #elif defined(_GLFW_X11) - #include "./glfw/src/x11_platform.h" + #include "x11_platform_linbsd.h" #elif defined(_GLFW_WAYLAND) #include "./glfw/src/wl_platform.h" #elif defined(_GLFW_OSMESA) diff --git a/internal/glfw/glfw/glfw/src/x11_init.c b/internal/glfw/glfw/x11_init_linbsd.c similarity index 99% rename from internal/glfw/glfw/glfw/src/x11_init.c rename to internal/glfw/glfw/x11_init_linbsd.c index 181691383..228771189 100644 --- a/internal/glfw/glfw/glfw/src/x11_init.c +++ b/internal/glfw/glfw/x11_init_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 + #if !defined(_GNU_SOURCE) #define _GNU_SOURCE #endif diff --git a/internal/glfw/glfw/glfw/src/x11_monitor.c b/internal/glfw/glfw/x11_monitor_linbsd.c similarity index 99% rename from internal/glfw/glfw/glfw/src/x11_monitor.c rename to internal/glfw/glfw/x11_monitor_linbsd.c index fb3a67bac..fdba94589 100644 --- a/internal/glfw/glfw/glfw/src/x11_monitor.c +++ b/internal/glfw/glfw/x11_monitor_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/x11_platform.h b/internal/glfw/glfw/x11_platform_linbsd.h similarity index 99% rename from internal/glfw/glfw/glfw/src/x11_platform.h rename to internal/glfw/glfw/x11_platform_linbsd.h index 83e2b9638..512209bcb 100644 --- a/internal/glfw/glfw/glfw/src/x11_platform.h +++ b/internal/glfw/glfw/x11_platform_linbsd.h @@ -25,6 +25,8 @@ // //======================================================================== +//go:build (freebsd || linux || netbsd || openbsd) && !wayland + #include #include #include @@ -128,7 +130,7 @@ typedef XRenderPictFormat* (* PFN_XRenderFindVisualFormat)(Display*,Visual const #include "xkb_unicode_linbsd.h" #include "glx_context_linbsd.h" #include "egl_context.h" -#include "osmesa_context.h" +#include "./glfw/src/osmesa_context.h" #define _glfw_dlopen(name) dlopen(name, RTLD_LAZY | RTLD_LOCAL) #define _glfw_dlclose(handle) dlclose(handle) diff --git a/internal/glfw/glfw/glfw/src/x11_window.c b/internal/glfw/glfw/x11_window_linbsd.c similarity index 99% rename from internal/glfw/glfw/glfw/src/x11_window.c rename to internal/glfw/glfw/x11_window_linbsd.c index 319c4cae3..f41e2452d 100644 --- a/internal/glfw/glfw/glfw/src/x11_window.c +++ b/internal/glfw/glfw/x11_window_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 + #if !defined(_GNU_SOURCE) #define _GNU_SOURCE #endif