SDL: Disable SDL dialogs for tvOS and iOS

From 335fa5d6e4c84fff79243d591468db80b54cff0d Mon Sep 17 00:00:00 2001
From: Semphris <[EMAIL REDACTED]>
Date: Sat, 30 Mar 2024 00:34:29 -0400
Subject: [PATCH] Disable SDL dialogs for tvOS and iOS

---
 src/dialog/cocoa/SDL_cocoadialog.m     | 7 +++++--
 src/dialog/dummy/SDL_dummydialog.c     | 2 --
 src/dialog/windows/SDL_windowsdialog.c | 3 ---
 3 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/src/dialog/cocoa/SDL_cocoadialog.m b/src/dialog/cocoa/SDL_cocoadialog.m
index 3d4a8a59bcd8e..64b4b35635cc6 100644
--- a/src/dialog/cocoa/SDL_cocoadialog.m
+++ b/src/dialog/cocoa/SDL_cocoadialog.m
@@ -20,8 +20,6 @@
 */
 #include "SDL_internal.h"
 
-/* TODO: Macro? */
-
 #import <Cocoa/Cocoa.h>
 
 typedef enum
@@ -33,6 +31,10 @@
 
 void show_file_dialog(cocoa_FileDialogType type, SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const SDL_DialogFileFilter *filters, const char* default_location, SDL_bool allow_many)
 {
+#if defined(SDL_PLATFORM_TVOS) || defined(SDL_PLATFORM_IOS)
+    SDL_SetError("tvOS and iOS don't support path-based file dialogs");
+    callback(userdata, NULL, -1);
+#else
     /* NSOpenPanel inherits from NSSavePanel */
     NSSavePanel *dialog;
     NSOpenPanel *dialog_as_open;
@@ -151,6 +153,7 @@ void show_file_dialog(cocoa_FileDialogType type, SDL_DialogFileCallback callback
             callback(userdata, files, -1);
         }
     }
+#endif // defined(SDL_PLATFORM_TVOS) || defined(SDL_PLATFORM_IOS)
 }
 
 void SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const SDL_DialogFileFilter *filters, const char* default_location, SDL_bool allow_many)
diff --git a/src/dialog/dummy/SDL_dummydialog.c b/src/dialog/dummy/SDL_dummydialog.c
index 8740f2f2d8ad2..057bb67d8bea1 100644
--- a/src/dialog/dummy/SDL_dummydialog.c
+++ b/src/dialog/dummy/SDL_dummydialog.c
@@ -20,8 +20,6 @@
 */
 #include "SDL_internal.h"
 
-/* TODO: Macro? */
-
 void SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const SDL_DialogFileFilter *filters, const char* default_location, SDL_bool allow_many)
 {
   SDL_Unsupported();
diff --git a/src/dialog/windows/SDL_windowsdialog.c b/src/dialog/windows/SDL_windowsdialog.c
index 57bfe8b63752a..93c5180c22b63 100644
--- a/src/dialog/windows/SDL_windowsdialog.c
+++ b/src/dialog/windows/SDL_windowsdialog.c
@@ -20,9 +20,6 @@
 */
 #include "SDL_internal.h"
 
-/* TODO: Macro? */
-
-/* TODO: Better includes? */
 #include <windows.h>
 #include <shlobj.h>
 #include "../../core/windows/SDL_windows.h"