diff --git a/include/epoxy/common.h b/include/epoxy/common.h index cf58ab2f..11ee1aa9 100644 --- a/include/epoxy/common.h +++ b/include/epoxy/common.h @@ -38,7 +38,7 @@ #endif #ifndef EPOXY_PUBLIC -# if defined(_MSC_VER) +# if defined(_MSC_VER) && defined(EPOXY_SHARED) # define EPOXY_PUBLIC __declspec(dllimport) extern # else # define EPOXY_PUBLIC extern diff --git a/meson.build b/meson.build index 76af8c59..3e58008d 100644 --- a/meson.build +++ b/meson.build @@ -142,6 +142,7 @@ libtype = get_option('default_library') # Visibility compiler flags; we only use this for shared libraries visibility_cflags = [] if libtype == 'shared' + common_cflags += [ '-DEPOXY_SHARED' ] if host_system == 'windows' conf.set('DLL_EXPORT', true) conf.set('EPOXY_PUBLIC', '__declspec(dllexport) extern')