diff --git a/include/cxxopts.hpp b/include/cxxopts.hpp index 5a57448..8028b67 100644 --- a/include/cxxopts.hpp +++ b/include/cxxopts.hpp @@ -50,12 +50,12 @@ THE SOFTWARE. # define CXXOPTS_NO_REGEX true # endif #endif -#if defined(_MSC_VER) -#define CXXOPTS_LINKONCE_CONST __declspec(selectany) -#define CXXOPTS_LINKONCE __declspec(selectany) +#if defined(_MSC_VER) && !defined(__clang__) +#define CXXOPTS_LINKONCE_CONST __declspec(selectany) extern +#define CXXOPTS_LINKONCE __declspec(selectany) extern #else -#define CXXOPTS_LINKONCE_CONST const -#define CXXOPTS_LINKONCE +#define CXXOPTS_LINKONCE_CONST +#define CXXOPTS_LINKONCE #endif #ifndef CXXOPTS_NO_REGEX