From 6c42578d0bb7355821af662c0c73e12b342a1657 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Wed, 9 Oct 2024 11:20:36 -0700
Subject: [PATCH] Add stub native MIDI functions for iOS and tvOS
These shouldn't be built, but just in case it's accidentally enabled on those platforms.
---
src/codecs/native_midi/native_midi_macosx.c | 51 +++++++++++++++++++++
1 file changed, 51 insertions(+)
diff --git a/src/codecs/native_midi/native_midi_macosx.c b/src/codecs/native_midi/native_midi_macosx.c
index f0f2ef18..00f8b783 100644
--- a/src/codecs/native_midi/native_midi_macosx.c
+++ b/src/codecs/native_midi/native_midi_macosx.c
@@ -355,4 +355,55 @@ const char *native_midi_error(void)
return ""; /* !!! FIXME */
}
+#else
+
+#include "native_midi.h"
+
+bool native_midi_detect(void)
+{
+ return false;
+}
+
+NativeMidiSong *native_midi_loadsong_IO(SDL_IOStream *src, bool closeio)
+{
+ if (closeio) {
+ SDL_CloseIO(src);
+ }
+ SDL_Unsupported();
+ return NULL;
+}
+
+void native_midi_freesong(NativeMidiSong *song)
+{
+}
+
+void native_midi_start(NativeMidiSong *song, int loops)
+{
+}
+
+void native_midi_pause(void)
+{
+}
+
+void native_midi_resume(void)
+{
+}
+
+void native_midi_stop(void)
+{
+}
+
+bool native_midi_active(void)
+{
+}
+
+void native_midi_setvolume(int volume)
+{
+}
+
+const char *native_midi_error(void)
+{
+ return "";
+}
+
#endif /* Mac OS X native MIDI support */