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
macos/v1.5.9
Emmanuele Bassi 8 years ago
parent 0ab213bf88
commit d35870f3b6
  1. 6
      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)

Loading…
Cancel
Save