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 2022-05-10 10:02:38 -05:00
parent 3458651010
commit 88120d4759
1 changed files with 3 additions and 3 deletions

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