diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2017-02-08 16:47:39 +0000 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2017-02-08 16:52:01 +0000 |
commit | d35870f3b6951faeb6406c3f931e09901b05c82f (patch) | |
tree | ceb868a13d00c13378affd72710d5aa6f015a2a7 | |
parent | 0ab213bf8818446898b4a8680feb774a072f57ba (diff) | |
download | libepoxy-d35870f3b6951faeb6406c3f931e09901b05c82f.tar.gz |
Update the symbol visibility rules under MSVC
For the Visual Studio C compiler we need to annotate our public symbols
with `__declspec(dllimport)` to ensure they are visible when dynamically
linking to Epoxy's DLL.
This is needed because under Windows we use a dispatch table, instead of
wrapper functions, thus the symbol visibility rules change. Compiling
with MingW will automatically add `__declspec(dllimport)` for us.
Thanks to Nirbheek Chauhan for the help in debugging the issue.
Fixes #104
-rw-r--r-- | include/epoxy/common.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/include/epoxy/common.h b/include/epoxy/common.h index a0b30b2..902f9b2 100644 --- a/include/epoxy/common.h +++ b/include/epoxy/common.h @@ -38,7 +38,11 @@ #endif #ifndef EPOXY_PUBLIC -# define EPOXY_PUBLIC extern +# if defined(_MSC_VER) +# define EPOXY_PUBLIC __declspec(dllimport) extern +# else +# define EPOXY_PUBLIC extern +# endif #endif #if defined(_MSC_VER) && !defined(__bool_true_false_are_defined) && (_MSC_VER < 1800) |