File 0001-Allow-building-with-older-SDL-versions.patch of Package sameboy
From 7efd26c548f3ce1f1969a53c7ce5b1ed96a42f7b Mon Sep 17 00:00:00 2001
From: Lior Halphon <LIJI32@gmail.com>
Date: Wed, 24 Aug 2022 23:59:38 +0300
Subject: [PATCH] Allow building with older SDL versions
References: 7efd26c548f3ce1f1969a53c7ce5b1ed96a42f7b
Upstream: originating
---
SDL/gui.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/SDL/gui.c b/SDL/gui.c
index 91519133..b637bd62 100644
--- a/SDL/gui.c
+++ b/SDL/gui.c
@@ -321,6 +321,25 @@ static void recalculate_menu_height(void)
}
}
+#if SDL_COMPILEDVERSION < 2014
+int SDL_OpenURL(const char *url)
+{
+ char *string = NULL;
+#ifdef __APPLE__
+ asprintf(&string, "open '%s'", url);
+#else
+#ifdef _WIN32
+ asprintf(&string, "explorer '%s'", url);
+#else
+ asprintf(&string, "xdg-open '%s'", url);
+#endif
+#endif
+ int ret = system(string);
+ free(string);
+ return ret;
+}
+#endif
+
static char audio_recording_menu_item[] = "Start Audio Recording";
static void sponsor(unsigned index)
--
2.37.2