summaryrefslogtreecommitdiff
path: root/boost/regex/config.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/regex/config.hpp')
-rw-r--r--boost/regex/config.hpp58
1 files changed, 50 insertions, 8 deletions
diff --git a/boost/regex/config.hpp b/boost/regex/config.hpp
index 7e6cc51969..4fd1fd94a8 100644
--- a/boost/regex/config.hpp
+++ b/boost/regex/config.hpp
@@ -25,6 +25,7 @@
#if defined(__BORLANDC__)
# include <boost/regex/config/borland.hpp>
#endif
+#include <boost/version.hpp>
/*****************************************************************************
*
@@ -41,6 +42,7 @@
# include BOOST_REGEX_USER_CONFIG
# include <boost/config.hpp>
+# include <boost/predef.h>
#else
/*
@@ -69,6 +71,13 @@
#define UNICODE
#endif
+
+/*
+* Define a macro for the namespace that details are placed in, this includes the Boost
+* version number to avoid mismatched header and library versions:
+*/
+#define BOOST_REGEX_DETAIL_NS BOOST_JOIN(re_detail_, BOOST_VERSION)
+
/*
* Fix for gcc prior to 3.4: std::ctype<wchar_t> doesn't allow
* masks to be combined, for example:
@@ -92,7 +101,13 @@
#if defined(_MSC_VER) && !defined(_MSC_EXTENSIONS)
# define BOOST_REGEX_NO_EXTERNAL_TEMPLATES
#endif
-/*
+ /*
+ * Oracle compiler in C++11 mode doesn't like external templates for some reason:
+ */
+#ifdef __SUNPRO_CC
+# define BOOST_REGEX_NO_EXTERNAL_TEMPLATES
+#endif
+ /*
* Shared regex lib will crash without this, frankly it looks a lot like a gcc bug:
*/
#if defined(__MINGW32__)
@@ -133,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: */
@@ -163,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)
@@ -264,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: */
@@ -334,7 +376,7 @@ if(0 == (x))\
#if defined(__cplusplus) && defined(BOOST_REGEX_HAS_MS_STACK_GUARD)
namespace boost{
-namespace re_detail{
+namespace BOOST_REGEX_DETAIL_NS{
BOOST_REGEX_DECL void BOOST_REGEX_CALL reset_stack_guard_page();
@@ -387,7 +429,7 @@ BOOST_REGEX_DECL void BOOST_REGEX_CALL reset_stack_guard_page();
****************************************************************************/
#if defined(__cplusplus) && defined(BOOST_REGEX_NON_RECURSIVE)
-namespace boost{ namespace re_detail{
+namespace boost{ namespace BOOST_REGEX_DETAIL_NS{
BOOST_REGEX_DECL void* BOOST_REGEX_CALL get_mem_block();
BOOST_REGEX_DECL void BOOST_REGEX_CALL put_mem_block(void*);