SDL: Move src/main/haiku/ to src/core/

From 63d3fb469dd4f8eb236854706c08969e6f0874ef Mon Sep 17 00:00:00 2001
From: Daniel Gibson <[EMAIL REDACTED]>
Date: Mon, 12 Dec 2022 21:41:05 +0100
Subject: [PATCH] Move src/main/haiku/ to src/core/

turns out that this wasn't even built as a static libSDLmain,
but as part of the (possibly dynamic) libSDL3
---
 CMakeLists.txt                        | 4 ++--
 include/SDL3/SDL_main_impl.h          | 2 --
 src/audio/haiku/SDL_haikuaudio.cc     | 2 +-
 src/{main => core}/haiku/SDL_BApp.h   | 0
 src/{main => core}/haiku/SDL_BeApp.cc | 0
 src/{main => core}/haiku/SDL_BeApp.h  | 0
 src/video/haiku/SDL_BWin.h            | 2 +-
 src/video/haiku/SDL_bframebuffer.cc   | 2 +-
 src/video/haiku/SDL_bmessagebox.cc    | 2 +-
 src/video/haiku/SDL_bmodes.cc         | 2 +-
 src/video/haiku/SDL_bopengl.cc        | 2 +-
 src/video/haiku/SDL_bvideo.cc         | 2 +-
 src/video/haiku/SDL_bvideo.h          | 2 +-
 13 files changed, 10 insertions(+), 12 deletions(-)
 rename src/{main => core}/haiku/SDL_BApp.h (100%)
 rename src/{main => core}/haiku/SDL_BeApp.cc (100%)
 rename src/{main => core}/haiku/SDL_BeApp.h (100%)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index a67f210e6982..5ef0f77eba60 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2350,8 +2350,8 @@ elseif(HAIKU)
     set(HAVE_SDL_LOCALE TRUE)
   endif()
 
-  file(GLOB MAIN_SOURCES ${SDL3_SOURCE_DIR}/src/main/haiku/*.cc)
-  list(APPEND SOURCE_FILES ${MAIN_SOURCES})
+  file(GLOB HAIKU_CORE_SOURCES ${SDL3_SOURCE_DIR}/src/core/haiku/*.cc)
+  list(APPEND SOURCE_FILES ${HAIKU_CORE_SOURCES})
 
   CheckPTHREAD()
   list(APPEND EXTRA_LIBS root be media game device textencoding)
diff --git a/include/SDL3/SDL_main_impl.h b/include/SDL3/SDL_main_impl.h
index b3c056de6ae9..9c0b9c37bd82 100644
--- a/include/SDL3/SDL_main_impl.h
+++ b/include/SDL3/SDL_main_impl.h
@@ -169,8 +169,6 @@ TInt E32Main()
 
 /* end of __NGAGE__ impl */
 
-/* TODO: remaining platforms */
-
 #else /* platforms that use a standard main() and just call SDL_RunApp(), like iOS and 3DS */
 
 #include <SDL3/begin_code.h>
diff --git a/src/audio/haiku/SDL_haikuaudio.cc b/src/audio/haiku/SDL_haikuaudio.cc
index 0ebacd3220e3..5440e6c3ab94 100644
--- a/src/audio/haiku/SDL_haikuaudio.cc
+++ b/src/audio/haiku/SDL_haikuaudio.cc
@@ -27,7 +27,7 @@
 #include <SoundPlayer.h>
 #include <signal.h>
 
-#include "../../main/haiku/SDL_BeApp.h"
+#include "../../core/haiku/SDL_BeApp.h"
 
 extern "C"
 {
diff --git a/src/main/haiku/SDL_BApp.h b/src/core/haiku/SDL_BApp.h
similarity index 100%
rename from src/main/haiku/SDL_BApp.h
rename to src/core/haiku/SDL_BApp.h
diff --git a/src/main/haiku/SDL_BeApp.cc b/src/core/haiku/SDL_BeApp.cc
similarity index 100%
rename from src/main/haiku/SDL_BeApp.cc
rename to src/core/haiku/SDL_BeApp.cc
diff --git a/src/main/haiku/SDL_BeApp.h b/src/core/haiku/SDL_BeApp.h
similarity index 100%
rename from src/main/haiku/SDL_BeApp.h
rename to src/core/haiku/SDL_BeApp.h
diff --git a/src/video/haiku/SDL_BWin.h b/src/video/haiku/SDL_BWin.h
index 55df3c3dbeea..011936f38112 100644
--- a/src/video/haiku/SDL_BWin.h
+++ b/src/video/haiku/SDL_BWin.h
@@ -42,7 +42,7 @@ extern "C" {
 #if SDL_VIDEO_OPENGL
 #include <opengl/GLView.h>
 #endif
-#include "../../main/haiku/SDL_BApp.h"
+#include "../../core/haiku/SDL_BApp.h"
 
 enum WinCommands
 {
diff --git a/src/video/haiku/SDL_bframebuffer.cc b/src/video/haiku/SDL_bframebuffer.cc
index 30e026efcabe..5e04f5eec2d0 100644
--- a/src/video/haiku/SDL_bframebuffer.cc
+++ b/src/video/haiku/SDL_bframebuffer.cc
@@ -29,7 +29,7 @@
 #include "SDL_bmodes.h"
 #include "SDL_BWin.h"
 
-#include "../../main/haiku/SDL_BApp.h"
+#include "../../core/haiku/SDL_BApp.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/src/video/haiku/SDL_bmessagebox.cc b/src/video/haiku/SDL_bmessagebox.cc
index e7b5f9314483..2d675fea2607 100644
--- a/src/video/haiku/SDL_bmessagebox.cc
+++ b/src/video/haiku/SDL_bmessagebox.cc
@@ -26,7 +26,7 @@
 
 
 /* For application signature. */
-#include "../../main/haiku/SDL_BeApp.h"
+#include "../../core/haiku/SDL_BeApp.h"
 
 #include <Alert.h>
 #include <Application.h>
diff --git a/src/video/haiku/SDL_bmodes.cc b/src/video/haiku/SDL_bmodes.cc
index 47b2c5233d5b..27c057f97710 100644
--- a/src/video/haiku/SDL_bmodes.cc
+++ b/src/video/haiku/SDL_bmodes.cc
@@ -31,7 +31,7 @@
 #include "SDL_bopengl.h"
 #endif
 
-#include "../../main/haiku/SDL_BApp.h"
+#include "../../core/haiku/SDL_BApp.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/src/video/haiku/SDL_bopengl.cc b/src/video/haiku/SDL_bopengl.cc
index e373a1c2434b..ebf1b696d8bb 100644
--- a/src/video/haiku/SDL_bopengl.cc
+++ b/src/video/haiku/SDL_bopengl.cc
@@ -28,7 +28,7 @@
 #include <KernelKit.h>
 #include <OpenGLKit.h>
 #include "SDL_BWin.h"
-#include "../../main/haiku/SDL_BApp.h"
+#include "../../core/haiku/SDL_BApp.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/src/video/haiku/SDL_bvideo.cc b/src/video/haiku/SDL_bvideo.cc
index c03bec79310a..3d29e7455f5e 100644
--- a/src/video/haiku/SDL_bvideo.cc
+++ b/src/video/haiku/SDL_bvideo.cc
@@ -20,7 +20,7 @@
 */
 
 #include "SDL_internal.h"
-#include "../../main/haiku/SDL_BApp.h"
+#include "../../core/haiku/SDL_BApp.h"
 
 #if SDL_VIDEO_DRIVER_HAIKU
 
diff --git a/src/video/haiku/SDL_bvideo.h b/src/video/haiku/SDL_bvideo.h
index 94b86b02f46c..a81b3bb648e2 100644
--- a/src/video/haiku/SDL_bvideo.h
+++ b/src/video/haiku/SDL_bvideo.h
@@ -26,7 +26,7 @@
 extern "C" {
 #endif
 
-#include "../../main/haiku/SDL_BeApp.h"
+#include "../../core/haiku/SDL_BeApp.h"
 #include "../SDL_sysvideo.h"
 
 extern void HAIKU_VideoQuit(_THIS);