From bf197e379bb46839f062bcb456c3f8e90b761d9a Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Mon, 10 Jul 2023 23:29:25 +0900 Subject: [PATCH] internal/glfw/glfw: refactoring: remove glfw/include --- internal/glfw/glfw/{glfw/LICENSE.md => LICENSE_glfw3} | 0 internal/glfw/glfw/build_cgo_hack.go | 1 - internal/glfw/glfw/context.go | 2 +- internal/glfw/glfw/error.go | 2 +- internal/glfw/glfw/glfw.go | 2 +- internal/glfw/glfw/glfw/include/GLFW/dummy.go | 4 ---- internal/glfw/glfw/glfw/include/dummy.go | 4 ---- internal/glfw/glfw/{glfw/include/GLFW => }/glfw3.h | 0 internal/glfw/glfw/{glfw/include/GLFW => }/glfw3native.h | 0 internal/glfw/glfw/input.go | 2 +- internal/glfw/glfw/monitor.go | 2 +- internal/glfw/glfw/native_darwin.go | 4 ++-- internal/glfw/glfw/native_linbsd_wayland.go | 4 ++-- internal/glfw/glfw/native_linbsd_x11.go | 4 ++-- internal/glfw/glfw/window.go | 2 +- 15 files changed, 12 insertions(+), 21 deletions(-) rename internal/glfw/glfw/{glfw/LICENSE.md => LICENSE_glfw3} (100%) delete mode 100644 internal/glfw/glfw/glfw/include/GLFW/dummy.go delete mode 100644 internal/glfw/glfw/glfw/include/dummy.go rename internal/glfw/glfw/{glfw/include/GLFW => }/glfw3.h (100%) rename internal/glfw/glfw/{glfw/include/GLFW => }/glfw3native.h (100%) diff --git a/internal/glfw/glfw/glfw/LICENSE.md b/internal/glfw/glfw/LICENSE_glfw3 similarity index 100% rename from internal/glfw/glfw/glfw/LICENSE.md rename to internal/glfw/glfw/LICENSE_glfw3 diff --git a/internal/glfw/glfw/build_cgo_hack.go b/internal/glfw/glfw/build_cgo_hack.go index 59a5053a6..d0e5cb5dc 100644 --- a/internal/glfw/glfw/build_cgo_hack.go +++ b/internal/glfw/glfw/build_cgo_hack.go @@ -16,6 +16,5 @@ package glfw // - this file is given a build to exclude it from the regular build. import ( // Prevent go tooling from stripping out the c source files. - _ "github.com/hajimehoshi/ebiten/v2/internal/glfw/glfw/glfw/include/GLFW" _ "github.com/hajimehoshi/ebiten/v2/internal/glfw/glfw/glfw/src" ) diff --git a/internal/glfw/glfw/context.go b/internal/glfw/glfw/context.go index f50967fd4..237c91e6e 100644 --- a/internal/glfw/glfw/context.go +++ b/internal/glfw/glfw/context.go @@ -8,7 +8,7 @@ package glfw //#include //#define GLFW_INCLUDE_NONE -//#include "glfw/include/GLFW/glfw3.h" +//#include "glfw3.h" import "C" import ( diff --git a/internal/glfw/glfw/error.go b/internal/glfw/glfw/error.go index 368b5bf5a..b309b03ad 100644 --- a/internal/glfw/glfw/error.go +++ b/internal/glfw/glfw/error.go @@ -7,7 +7,7 @@ package glfw // #define GLFW_INCLUDE_NONE -// #include "glfw/include/GLFW/glfw3.h" +// #include "glfw3.h" // // void goErrorCB(int code, char* desc); // diff --git a/internal/glfw/glfw/glfw.go b/internal/glfw/glfw/glfw.go index 13eff35c5..ff7236d7f 100644 --- a/internal/glfw/glfw/glfw.go +++ b/internal/glfw/glfw/glfw.go @@ -8,7 +8,7 @@ package glfw //#include //#define GLFW_INCLUDE_NONE -//#include "glfw/include/GLFW/glfw3.h" +//#include "glfw3.h" import "C" import "unsafe" diff --git a/internal/glfw/glfw/glfw/include/GLFW/dummy.go b/internal/glfw/glfw/glfw/include/GLFW/dummy.go deleted file mode 100644 index 0c3649eb6..000000000 --- a/internal/glfw/glfw/glfw/include/GLFW/dummy.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build required - -// Package dummy prevents go tooling from stripping the c dependencies. -package dummy diff --git a/internal/glfw/glfw/glfw/include/dummy.go b/internal/glfw/glfw/glfw/include/dummy.go deleted file mode 100644 index 0c3649eb6..000000000 --- a/internal/glfw/glfw/glfw/include/dummy.go +++ /dev/null @@ -1,4 +0,0 @@ -//go:build required - -// Package dummy prevents go tooling from stripping the c dependencies. -package dummy diff --git a/internal/glfw/glfw/glfw/include/GLFW/glfw3.h b/internal/glfw/glfw/glfw3.h similarity index 100% rename from internal/glfw/glfw/glfw/include/GLFW/glfw3.h rename to internal/glfw/glfw/glfw3.h diff --git a/internal/glfw/glfw/glfw/include/GLFW/glfw3native.h b/internal/glfw/glfw/glfw3native.h similarity index 100% rename from internal/glfw/glfw/glfw/include/GLFW/glfw3native.h rename to internal/glfw/glfw/glfw3native.h diff --git a/internal/glfw/glfw/input.go b/internal/glfw/glfw/input.go index e4eb1d779..e12af4a94 100644 --- a/internal/glfw/glfw/input.go +++ b/internal/glfw/glfw/input.go @@ -8,7 +8,7 @@ package glfw // #include // #define GLFW_INCLUDE_NONE -// #include "glfw/include/GLFW/glfw3.h" +// #include "glfw3.h" // // void goKeyCB(void* window, int key, int scancode, int action, int mods); // void goCharCB(void* window, unsigned int character); diff --git a/internal/glfw/glfw/monitor.go b/internal/glfw/glfw/monitor.go index 905e89b2c..0a477f850 100644 --- a/internal/glfw/glfw/monitor.go +++ b/internal/glfw/glfw/monitor.go @@ -7,7 +7,7 @@ package glfw // #define GLFW_INCLUDE_NONE -// #include "glfw/include/GLFW/glfw3.h" +// #include "glfw3.h" // // void goMonitorCB(void* monitor, int event); // diff --git a/internal/glfw/glfw/native_darwin.go b/internal/glfw/glfw/native_darwin.go index 4e2a39f1a..bda006011 100644 --- a/internal/glfw/glfw/native_darwin.go +++ b/internal/glfw/glfw/native_darwin.go @@ -7,8 +7,8 @@ package glfw /* #define GLFW_EXPOSE_NATIVE_COCOA #define GLFW_EXPOSE_NATIVE_NSGL -#include "glfw/include/GLFW/glfw3.h" -#include "glfw/include/GLFW/glfw3native.h" +#include "glfw3.h" +#include "glfw3native.h" // workaround wrappers needed due to a cgo and/or LLVM bug. // See: https://github.com/go-gl/glfw/issues/136 diff --git a/internal/glfw/glfw/native_linbsd_wayland.go b/internal/glfw/glfw/native_linbsd_wayland.go index 5b71529be..c892a8701 100644 --- a/internal/glfw/glfw/native_linbsd_wayland.go +++ b/internal/glfw/glfw/native_linbsd_wayland.go @@ -10,8 +10,8 @@ package glfw //#define GLFW_EXPOSE_NATIVE_WAYLAND //#define GLFW_EXPOSE_NATIVE_EGL //#define GLFW_INCLUDE_NONE -//#include "glfw/include/GLFW/glfw3.h" -//#include "glfw/include/GLFW/glfw3native.h" +//#include "glfw3.h" +//#include "glfw3native.h" import "C" func GetWaylandDisplay() *C.struct_wl_display { diff --git a/internal/glfw/glfw/native_linbsd_x11.go b/internal/glfw/glfw/native_linbsd_x11.go index 7fa9692d0..6c0e1bbed 100644 --- a/internal/glfw/glfw/native_linbsd_x11.go +++ b/internal/glfw/glfw/native_linbsd_x11.go @@ -10,8 +10,8 @@ package glfw //#define GLFW_EXPOSE_NATIVE_X11 //#define GLFW_EXPOSE_NATIVE_GLX //#define GLFW_INCLUDE_NONE -//#include "glfw/include/GLFW/glfw3.h" -//#include "glfw/include/GLFW/glfw3native.h" +//#include "glfw3.h" +//#include "glfw3native.h" import "C" import "unsafe" diff --git a/internal/glfw/glfw/window.go b/internal/glfw/glfw/window.go index 29661d8a1..8dad37ea6 100644 --- a/internal/glfw/glfw/window.go +++ b/internal/glfw/glfw/window.go @@ -8,7 +8,7 @@ package glfw // #include // #define GLFW_INCLUDE_NONE -// #include "glfw/include/GLFW/glfw3.h" +// #include "glfw3.h" // // void goWindowPosCB(void* window, int xpos, int ypos); // void goWindowSizeCB(void* window, int width, int height);