From 9e039cfaf98339b31fae5f2287c43f603f56db8a Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 29 Jun 2018 05:39:42 +0300 Subject: [PATCH] Fix dllexport mismatch errors under clang++ --- include/boost/system/error_code.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/boost/system/error_code.hpp b/include/boost/system/error_code.hpp index 920d87e..81965fb 100644 --- a/include/boost/system/error_code.hpp +++ b/include/boost/system/error_code.hpp @@ -442,9 +442,19 @@ inline const error_category & generic_category() BOOST_SYSTEM_NOEXCEPT namespace detail { +#if defined(BOOST_SYSTEM_SOURCE) + +// clang++ requires a strictly matching declaration +BOOST_SYSTEM_DECL extern system_error_category system_category_instance; +BOOST_SYSTEM_DECL extern generic_error_category generic_category_instance; + +#else + extern system_error_category system_category_instance; extern generic_error_category generic_category_instance; +#endif + } // namespace detail constexpr const error_category & system_category() BOOST_SYSTEM_NOEXCEPT