From 312ecc4a521d249fa2745f872a869e86f72cd681 Mon Sep 17 00:00:00 2001
From: Daniel Gibson <[EMAIL REDACTED]>
Date: Tue, 8 Oct 2024 19:15:55 +0200
Subject: [PATCH] SDL_main.h: Remove dead code for hypothetical C++ platforms
If WinRT returns after all, or a similarly bad platforms turns up,
the code can still be found in the git history.
But keep in mind that it then will have to be added *before* the
#if ( defined(SDL_MAIN_USE_CALLBACKS) || defined(SDL_MAIN_NEEDED) ...
case for platforms that support plain C to work correctly
---
include/SDL3/SDL_main.h | 22 ++++------------------
1 file changed, 4 insertions(+), 18 deletions(-)
diff --git a/include/SDL3/SDL_main.h b/include/SDL3/SDL_main.h
index 63fbcf194b059..ecd8ffb3244ca 100644
--- a/include/SDL3/SDL_main.h
+++ b/include/SDL3/SDL_main.h
@@ -563,30 +563,16 @@ extern SDL_DECLSPEC void SDLCALL SDL_GDKSuspendComplete(void);
#if !defined(SDL_MAIN_HANDLED) && !defined(SDL_MAIN_NOIMPL)
/* include header-only SDL_main implementations
- * Note: currently Android is the only platform where we rename main() to SDL_main()
- * but do *not* use SDL_main_impl.h (because SDL_main() is called from external Java code)
+ * Note: currently Android is the only platform where we rename main() to SDL_main() but
+ * do *not* use SDL_main_impl.h (because SDL_main() is called from external Java code).
+ * If other platforms like that turn up, add them next to "defined(SDL_PLATFORM_ANDROID)"
*/
#if ( defined(SDL_MAIN_USE_CALLBACKS) || defined(SDL_MAIN_NEEDED) || defined(SDL_MAIN_AVAILABLE) ) && \
!defined(SDL_PLATFORM_ANDROID)
/* platforms which main (-equivalent) can be implemented in plain C */
#include <SDL3/SDL_main_impl.h>
-
- #elif 0 /* C++ platforms (currently none, this used to be here for WinRT, but is left for future platforms that might arrive. */
- #ifdef __cplusplus
- #include <SDL3/SDL_main_impl.h>
- #else
- /* Note: to get rid of the following warning, you can #define SDL_MAIN_NOIMPL before including SDL_main.h
- * in your C sourcefile that contains the standard main. Do *not* use SDL_MAIN_HANDLED for that, then SDL_main won't find your main()!
- */
- #ifdef _MSC_VER
- #pragma message("Note: Your platform needs the SDL_main implementation in a C++ source file. You can keep your main() in plain C (then continue including SDL_main.h there!) and create a fresh .cpp file that only contains #include <SDL3/SDL_main.h>")
- #elif defined(__GNUC__) /* gcc, clang, mingw and compatible are matched by this and have #warning */
- #warning "Note: Your platform needs the SDL_main implementation in a C++ source file. You can keep your main() in plain C and create a fresh .cpp file that only contains #include <SDL3/SDL_main.h>"
- #endif /* __GNUC__ */
- #endif /* __cplusplus */
-
- #endif /* C++ platforms */
+ #endif
#endif
#endif /* SDL_main_h_ */