client API: always export symbols on windows

Windows is weird and symbols weren't actually being exported. This is
because __GNUC__ is defined and picked up in the conditional, but
__attribute__((visibility("default"))) doesn't actually export anything
to the dll. Instead, just check if we have win32 defined first and then
always set __declspec(dllexport). Fixes #10171.
This commit is contained in:
Dudemanguy committed 2022-05-11 14:46:41 +00:00
1 parent 3458651010
commit 88120d4759
1 file changed
+3 -3
+3 -3
View File
@@ -27,10 +27,10 @@
#include <stdint.h>
/* New symbols must still be added to libmpv/mpv.def. */
#if defined(__GNUC__) || defined(__clang__)
#define MPV_EXPORT __attribute__((visibility("default")))
#elif defined(_MSC_VER)
#ifdef _WIN32
#define MPV_EXPORT __declspec(dllexport)
#elif defined(__GNUC__) || defined(__clang__)
#define MPV_EXPORT __attribute__((visibility("default")))
#else
#define MPV_EXPORT
#endif