From 3b461992b4edde07559939791e6f04c760df6ebd Mon Sep 17 00:00:00 2001 From: Mikael Olenfalk Date: Thu, 8 Oct 2015 09:36:26 +0200 Subject: [PATCH 1/5] regex: Add dependency on boost.predef --- include/boost/regex/config.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/include/boost/regex/config.hpp b/include/boost/regex/config.hpp index a347bd34f..3cea89987 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 /* From ffac6a20357437ea5a2ff0462c3f504a9a7a27b0 Mon Sep 17 00:00:00 2001 From: Mikael Olenfalk Date: Sun, 4 Oct 2015 22:24:27 +0200 Subject: [PATCH 2/5] universal-windows: Do not define BOOST_REGEX_HAS_OTHER_WCHAR_T Just as on VC10 this causes linker errors with std::collate::id. --- include/boost/regex/config.hpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/include/boost/regex/config.hpp b/include/boost/regex/config.hpp index 3cea89987..af2c2fa4c 100644 --- a/include/boost/regex/config.hpp +++ b/include/boost/regex/config.hpp @@ -178,10 +178,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) From c1d2d1a73646a4578eddfa71fbeec315e94fd5d6 Mon Sep 17 00:00:00 2001 From: Mikael Olenfalk Date: Thu, 8 Oct 2015 09:40:52 +0200 Subject: [PATCH 3/5] universal-windows: Use C++ locale --- include/boost/regex/config.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/boost/regex/config.hpp b/include/boost/regex/config.hpp index af2c2fa4c..90d012df6 100644 --- a/include/boost/regex/config.hpp +++ b/include/boost/regex/config.hpp @@ -289,6 +289,11 @@ # 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 +#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) # define BOOST_REGEX_USE_WIN32_LOCALE From 541bcde27fc0569218bf50c4c916955435a67531 Mon Sep 17 00:00:00 2001 From: Mikael Olenfalk Date: Thu, 8 Oct 2015 09:56:47 +0200 Subject: [PATCH 4/5] universal-windows: Disable deprecated fileiter --- include/boost/regex/config.hpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/boost/regex/config.hpp b/include/boost/regex/config.hpp index 90d012df6..1288f3c38 100644 --- a/include/boost/regex/config.hpp +++ b/include/boost/regex/config.hpp @@ -148,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: */ From 6d2be646d8c7033a23a30c9b56439a43206b0d18 Mon Sep 17 00:00:00 2001 From: Mikael Olenfalk Date: Thu, 8 Oct 2015 10:18:43 +0200 Subject: [PATCH 5/5] universal-windows: Do not build w32_regex_traits Since Vista LCID has been deprecated and locales are now using string-names, this makes the effort to support w32_regex_traits quite large, therefore we opt to disable w32_regex_traits right now when targeting universal-windows. --- include/boost/regex/config.hpp | 8 +++++++- include/boost/regex/v4/w32_regex_traits.hpp | 4 ++++ src/w32_regex_traits.cpp | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/include/boost/regex/config.hpp b/include/boost/regex/config.hpp index 1288f3c38..4fd1fd94a 100644 --- a/include/boost/regex/config.hpp +++ b/include/boost/regex/config.hpp @@ -298,10 +298,16 @@ /* 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