From 7ed779203ee3345939070f6200dc3716381e35bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Micha=C3=ABl=20Celerier?= Date: Sun, 12 Jul 2026 13:38:00 -0400 Subject: [PATCH] config: use __declspec(dllexport) on all Windows, not just MSVC visibility("default") is ELF-only and inert for PE/COFF, so on MinGW/Clang libremidi exported none of its API. Key the dllexport branch on _WIN32 in both config.hpp and libremidi-c.h. --- include/libremidi/config.hpp | 2 +- include/libremidi/libremidi-c.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/libremidi/config.hpp b/include/libremidi/config.hpp index cd2e43ef..efb6f960 100644 --- a/include/libremidi/config.hpp +++ b/include/libremidi/config.hpp @@ -46,7 +46,7 @@ // Dynamic exports #if defined(LIBREMIDI_EXPORTS) || defined(LIBREMIDI_MODULE_BUILD) - #if defined(_MSC_VER) + #if defined(_WIN32) #define LIBREMIDI_EXPORT __declspec(dllexport) #elif defined(__GNUC__) || defined(__clang__) #define LIBREMIDI_EXPORT __attribute__((visibility("default"))) diff --git a/include/libremidi/libremidi-c.h b/include/libremidi/libremidi-c.h index bb9e60bc..14fa9f65 100644 --- a/include/libremidi/libremidi-c.h +++ b/include/libremidi/libremidi-c.h @@ -6,7 +6,7 @@ #include #if defined(LIBREMIDI_EXPORTS) - #if defined(_MSC_VER) + #if defined(_WIN32) #define LIBREMIDI_EXPORT __declspec(dllexport) #elif defined(__GNUC__) || defined(__clang__) #define LIBREMIDI_EXPORT __attribute__((visibility("default")))