summaryrefslogtreecommitdiffstats
path: root/libmpv
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2022-05-10 10:02:38 -0500
committerDudemanguy <random342@airmail.cc>2022-05-11 14:46:41 +0000
commit88120d47599da61e17350da4d35b565d5c3e29aa (patch)
treee7904e4b1de4c0eed38c0b061e7b66d0e4ecbba5 /libmpv
parent3458651010a68c2384a19ba485e81e22c825782f (diff)
downloadmpv-88120d47599da61e17350da4d35b565d5c3e29aa.tar.bz2
mpv-88120d47599da61e17350da4d35b565d5c3e29aa.tar.xz
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.
Diffstat (limited to 'libmpv')
-rw-r--r--libmpv/client.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/libmpv/client.h b/libmpv/client.h
index 85d302a76a..07ab7d44bc 100644
--- a/libmpv/client.h
+++ b/libmpv/client.h
@@ -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