diff --git a/include/boost/regex/config.hpp b/include/boost/regex/config.hpp index a347bd34f..4fd1fd94a 100644 --- a/include/boost/regex/config.hpp +++ b/include/boost/regex/config.hpp @@ -42,6 +42,7 @@ # include BOOST_REGEX_USER_CONFIG # include +# include #else /* @@ -147,8 +148,14 @@ /* disable our own file-iterators and mapfiles if we can't * support them: */ -#if !defined(BOOST_HAS_DIRENT_H) && !(defined(_WIN32) && !defined(BOOST_REGEX_NO_W32)) -# define BOOST_REGEX_NO_FILEITER +#if defined(_WIN32) +# if defined(BOOST_REGEX_NO_W32) || BOOST_PLAT_WINDOWS_STORE +# define BOOST_REGEX_NO_FILEITER +# endif +#else // defined(_WIN32) +# if !defined(BOOST_HAS_DIRENT_H) +# define BOOST_REGEX_NO_FILEITER +# endif #endif /* backwards compatibitity: */ @@ -177,10 +184,20 @@ * with MSVC and the /Zc:wchar_t option we place some extra unsigned short versions * of the non-inline functions in the library, so that users can still link to the lib, * irrespective of whether their own code is built with /Zc:wchar_t. - * Note that this does NOT WORK with VC10 when the C++ locale is in effect as + * Note that this does NOT WORK with VC10 and VC14 when the C++ locale is in effect as * the locale's facets simply do not compile in that case. + * As we default to the C++ locale when compiling for the windows runtime we + * skip in this case aswell. */ -#if defined(__cplusplus) && (defined(BOOST_MSVC) || defined(__ICL)) && !defined(BOOST_NO_INTRINSIC_WCHAR_T) && defined(BOOST_WINDOWS) && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION) && !defined(BOOST_RWSTD_VER) && ((_MSC_VER < 1600) || !defined(BOOST_REGEX_USE_CPP_LOCALE)) +#if defined(__cplusplus) && \ + (defined(BOOST_MSVC) || defined(__ICL)) && \ + !defined(BOOST_NO_INTRINSIC_WCHAR_T) && \ + defined(BOOST_WINDOWS) && \ + !defined(__SGI_STL_PORT) && \ + !defined(_STLPORT_VERSION) && \ + !defined(BOOST_RWSTD_VER) && \ + ((_MSC_VER < 1600) || !defined(BOOST_REGEX_USE_CPP_LOCALE)) && \ + !BOOST_PLAT_WINDOWS_RUNTIME # define BOOST_REGEX_HAS_OTHER_WCHAR_T # ifdef BOOST_MSVC # pragma warning(push) @@ -278,8 +295,19 @@ # define BOOST_REGEX_USE_C_LOCALE #endif +/* use C++ locale when targeting windows store */ +#if BOOST_PLAT_WINDOWS_RUNTIME +# define BOOST_REGEX_USE_CPP_LOCALE +# define BOOST_REGEX_NO_WIN32_LOCALE +#endif + /* Win32 defaults to native Win32 locale: */ -#if defined(_WIN32) && !defined(BOOST_REGEX_USE_WIN32_LOCALE) && !defined(BOOST_REGEX_USE_C_LOCALE) && !defined(BOOST_REGEX_USE_CPP_LOCALE) && !defined(BOOST_REGEX_NO_W32) +#if defined(_WIN32) && \ + !defined(BOOST_REGEX_USE_WIN32_LOCALE) && \ + !defined(BOOST_REGEX_USE_C_LOCALE) && \ + !defined(BOOST_REGEX_USE_CPP_LOCALE) && \ + !defined(BOOST_REGEX_NO_W32) && \ + !defined(BOOST_REGEX_NO_WIN32_LOCALE) # define BOOST_REGEX_USE_WIN32_LOCALE #endif /* otherwise use C++ locale if supported: */ diff --git a/include/boost/regex/v4/w32_regex_traits.hpp b/include/boost/regex/v4/w32_regex_traits.hpp index 4a7995265..560cc217b 100644 --- a/include/boost/regex/v4/w32_regex_traits.hpp +++ b/include/boost/regex/v4/w32_regex_traits.hpp @@ -19,6 +19,8 @@ #ifndef BOOST_W32_REGEX_TRAITS_HPP_INCLUDED #define BOOST_W32_REGEX_TRAITS_HPP_INCLUDED +#ifndef BOOST_REGEX_NO_WIN32_LOCALE + #ifndef BOOST_RE_PAT_EXCEPT_HPP #include #endif @@ -736,4 +738,6 @@ static_mutex& w32_regex_traits::get_mutex_inst() #pragma warning(pop) #endif +#endif // BOOST_REGEX_NO_WIN32_LOCALE + #endif diff --git a/src/w32_regex_traits.cpp b/src/w32_regex_traits.cpp index fdf93052b..0f8257024 100644 --- a/src/w32_regex_traits.cpp +++ b/src/w32_regex_traits.cpp @@ -19,7 +19,7 @@ #define BOOST_REGEX_SOURCE #include -#if defined(_WIN32) && !defined(BOOST_REGEX_NO_W32) +#if defined(_WIN32) && !defined(BOOST_REGEX_NO_W32) && !defined(BOOST_REGEX_NO_WIN32_LOCALE) #include #include