game-music-emu: gme.h: duplicate BLARGG_EXPORT macros and remove blargg_source.h (87ebe)

From 87ebe8d2f03f00ef98c4b5673d5234efd0412da7 Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Wed, 20 Sep 2023 23:51:50 +0300
Subject: [PATCH] gme.h: duplicate BLARGG_EXPORT macros and remove
 blargg_source.h

Fixes: https://bitbucket.org/mpyne/game-music-emu/issues/244
---
 gme/CMakeLists.txt |  2 +-
 gme/gme.h          | 18 ++++++++++++++++--
 2 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/gme/CMakeLists.txt b/gme/CMakeLists.txt
index 96e4073..f6399c3 100644
--- a/gme/CMakeLists.txt
+++ b/gme/CMakeLists.txt
@@ -150,7 +150,7 @@ if (USE_GME_VGM)
 endif()
 
 # These headers are part of the generic gme interface.
-set (EXPORTED_HEADERS gme.h blargg_source.h)
+set (EXPORTED_HEADERS gme.h)
 
 # while building a macOS framework, exported headers must be in the source
 # list, or the header files aren't copied to the bundle.
diff --git a/gme/gme.h b/gme/gme.h
index f17954b..ef1d851 100644
--- a/gme/gme.h
+++ b/gme/gme.h
@@ -4,8 +4,6 @@
 #ifndef GME_H
 #define GME_H
 
-#include "blargg_source.h"
-
 #ifdef __cplusplus
 	extern "C" {
 #endif
@@ -19,6 +17,22 @@ typedef const char* gme_err_t;
 typedef struct Music_Emu Music_Emu;
 
 
+/* Setup compiler defines useful for exporting required public API symbols in gme.cpp */
+#ifndef BLARGG_EXPORT
+    #if defined (_WIN32)
+        #if defined(BLARGG_BUILD_DLL)
+            #define BLARGG_EXPORT __declspec(dllexport)
+        #else
+            #define BLARGG_EXPORT /* Leave blank: friendly with both static and shared linking */
+        #endif
+    #elif defined (LIBGME_VISIBILITY) && defined(__cplusplus)
+        #define BLARGG_EXPORT __attribute__((visibility ("default")))
+    #else
+        #define BLARGG_EXPORT
+    #endif
+#endif
+
+
 /******** Basic operations ********/
 
 /* Create emulator and load game music file/data into it. Sets *out to new emulator. */