diff --git a/include/boost/regex/config.hpp b/include/boost/regex/config.hpp index e4b21384..d55881a3 100644 --- a/include/boost/regex/config.hpp +++ b/include/boost/regex/config.hpp @@ -186,16 +186,19 @@ * ****************************************************************************/ -#if defined(BOOST_HAS_DECLSPEC) && (defined(BOOST_REGEX_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)) && !defined(BOOST_REGEX_STATIC_LINK) -# if defined(BOOST_REGEX_SOURCE) -# define BOOST_REGEX_DECL __declspec(dllexport) -# define BOOST_REGEX_BUILD_DLL -# else -# define BOOST_REGEX_DECL __declspec(dllimport) -# endif +#ifndef BOOST_SYMBOL_EXPORT +# define BOOST_SYMBOL_EXPORT +# define BOOST_SYMBOL_IMPORT #endif -#ifndef BOOST_REGEX_DECL +#if (defined(BOOST_REGEX_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)) && !defined(BOOST_REGEX_STATIC_LINK) +# if defined(BOOST_REGEX_SOURCE) +# define BOOST_REGEX_DECL BOOST_SYMBOL_EXPORT +# define BOOST_REGEX_BUILD_DLL +# else +# define BOOST_REGEX_DECL BOOST_SYMBOL_IMPORT +# endif +#else # define BOOST_REGEX_DECL #endif diff --git a/include/boost/regex/v4/instances.hpp b/include/boost/regex/v4/instances.hpp index d12dc6b2..c62d136f 100644 --- a/include/boost/regex/v4/instances.hpp +++ b/include/boost/regex/v4/instances.hpp @@ -118,10 +118,14 @@ template class BOOST_REGEX_TEMPLATE_DECL ::boost::re_detail::perl_matcher< std:: #undef BOOST_REGEX_TEMPLATE_DECL -#elif (defined(__GNUC__) && (__GNUC__ >= 3)) +#elif (defined(__GNUC__) && (__GNUC__ >= 3)) || !defined(BOOST_NO_EXTERN_TEMPLATE) # ifndef BOOST_REGEX_INSTANTIATE -# define template __extension__ extern template +# ifdef __GNUC__ +# define template __extension__ extern template +# else +# define template extern template +# endif # endif #if !defined(BOOST_NO_STD_LOCALE) && !defined(BOOST_REGEX_ICU_INSTANCES) diff --git a/test/c_compiler_checks/posix_api_check.c b/test/c_compiler_checks/posix_api_check.c index 9b72a131..c12525c8 100644 --- a/test/c_compiler_checks/posix_api_check.c +++ b/test/c_compiler_checks/posix_api_check.c @@ -54,7 +54,7 @@ int main() regfreeA(&re); return result; } - assert(matches[0].rm_so == matches[0].rm_eo == 1); + assert((matches[0].rm_so == matches[0].rm_eo) && (matches[0].rm_eo == 1)); regfreeA(&re); printf("no errors found\n"); return 0;