Skip to content

Universal windows #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Oct 8, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 33 additions & 5 deletions include/boost/regex/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
# include BOOST_REGEX_USER_CONFIG

# include <boost/config.hpp>
# include <boost/predef.h>

#else
/*
Expand Down Expand Up @@ -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: */
Expand Down Expand Up @@ -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 <unsigned short> 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)
Expand Down Expand Up @@ -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: */
Expand Down
4 changes: 4 additions & 0 deletions include/boost/regex/v4/w32_regex_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <boost/regex/pattern_except.hpp>
#endif
Expand Down Expand Up @@ -736,4 +738,6 @@ static_mutex& w32_regex_traits<charT>::get_mutex_inst()
#pragma warning(pop)
#endif

#endif // BOOST_REGEX_NO_WIN32_LOCALE

#endif
2 changes: 1 addition & 1 deletion src/w32_regex_traits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#define BOOST_REGEX_SOURCE
#include <boost/regex/config.hpp>

#if defined(_WIN32) && !defined(BOOST_REGEX_NO_W32)
#if defined(_WIN32) && !defined(BOOST_REGEX_NO_W32) && !defined(BOOST_REGEX_NO_WIN32_LOCALE)
#include <boost/regex/regex_traits.hpp>
#include <boost/regex/pattern_except.hpp>

Expand Down