From 5fb0343fa8a882823e95422eafc3d42bedf21ff7 Mon Sep 17 00:00:00 2001 From: Beman Date: Wed, 9 Jul 2014 21:18:31 -0400 Subject: [PATCH 01/11] Initial commit --- include/boost/cxx11_char_types.hpp | 70 ++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 include/boost/cxx11_char_types.hpp diff --git a/include/boost/cxx11_char_types.hpp b/include/boost/cxx11_char_types.hpp new file mode 100644 index 00000000..eab46a46 --- /dev/null +++ b/include/boost/cxx11_char_types.hpp @@ -0,0 +1,70 @@ +// boost cxx11_char_types.hpp --------------------------------------------------------// + +// Copyright Beman Dawes 2011 + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + +//--------------------------------------------------------------------------------------// +// // +// The purpose of this header is to emulate the C++11 char16_t and char32_t // +// character and string types so that they can be used in both C++11 and C++03 // +// programs. // +// // +// The emulation names use char16/char32 rather than char16_t/char32_t to avoid use // +// of names that are keywords in C++11. // +// // +// The emulation names are placed in namespace boost, as is usual for Boost C++11 // +// emulation names such as those in header . // +// // +// An alternative would would have been to place the C++11 emulation names at global // +// scope, and put the C++11 string types in namespace std. That is the approach taken // +// by Microsoft Visual Studio 2010, but is controversion with some Boost users and // +// developers, and runs counter to usual Boost practice. // +// // +// Thanks to Mathias Gaunard and others for discussions leading to the final form // +// of these typedefs. // +// // +// Boost C++11 C++03 // +// ---------------- -------------- -------------------------------- // +// boost::char16 char16_t uint16_t // +// boost::char32 char32_t uint32_t // +// boost::u16string std::u16string std::basic_string // +// boost::u32string std::u32string std::basic_string // +// // +// Uses the typedefs provided by Microsoft Visual C++ 2010 if present // +// // +// Thanks to Mathias Gaunard and others for discussions leading to the final form // +// of these typedefs. // +// // +//--------------------------------------------------------------------------------------// + +#if !defined(BOOST_CXX11_CHAR_TYPES_HPP) +# define BOOST_CXX11_CHAR_TYPES_HPP + +# include +# include +# include + +namespace boost +{ + +# if defined(BOOST_NO_CHAR16_T) && (!defined(_MSC_VER) || _MSC_VER < 1600) // 1600 == VC++10 + typedef boost::uint_least16_t char16; + typedef std::basic_string u16string; +# else + typedef char16_t char16; + typedef std::u16string u16string; +# endif + +# if defined(BOOST_NO_CHAR32_T) && (!defined(_MSC_VER) || _MSC_VER < 1600) // 1600 == VC++10 + typedef boost::uint_least32_t char32; + typedef std::basic_string u32string; +# else + typedef char32_t char32; + typedef std::u32string u32string; +# endif + +} // namespace boost + +#endif // !defined(BOOST_CXX11_CHAR_TYPES_HPP) From db66a9f051ce5c8de48c28f67f117a9bc250bf01 Mon Sep 17 00:00:00 2001 From: morinmorin Date: Sun, 26 Oct 2014 11:16:53 +0900 Subject: [PATCH 02/11] Remove `__has_extension` macros for features that emit warnings. Variable templates can be used in C++03/11 and initialized lambda captures can be used in C++11 as language extensions, but they trigger "extension" warnings. Disallow these extensions to prevent the warning. --- include/boost/config/compiler/clang.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/config/compiler/clang.hpp b/include/boost/config/compiler/clang.hpp index 95ddcbef..a2f9e323 100644 --- a/include/boost/config/compiler/clang.hpp +++ b/include/boost/config/compiler/clang.hpp @@ -217,7 +217,7 @@ # define BOOST_NO_CXX14_AGGREGATE_NSDMI #endif -#if !(__has_feature(cxx_init_captures) || __has_extension(cxx_init_captures)) +#if !__has_feature(cxx_init_captures) # define BOOST_NO_CXX14_INITIALIZED_LAMBDA_CAPTURES #endif @@ -248,7 +248,7 @@ # define BOOST_NO_CXX14_RETURN_TYPE_DEDUCTION #endif -#if !(__has_feature(cxx_variable_templates) || __has_extension(cxx_variable_templates)) +#if !__has_feature(cxx_variable_templates) # define BOOST_NO_CXX14_VARIABLE_TEMPLATES #endif From 5050ae481f157c80f9f3be72e1daf6a5da8c2d95 Mon Sep 17 00:00:00 2001 From: morinmorin Date: Sun, 26 Oct 2014 18:42:35 +0900 Subject: [PATCH 03/11] Use feature names with double underscores to avoid macro interference. --- include/boost/config/compiler/clang.hpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/include/boost/config/compiler/clang.hpp b/include/boost/config/compiler/clang.hpp index a2f9e323..6cc8b22f 100644 --- a/include/boost/config/compiler/clang.hpp +++ b/include/boost/config/compiler/clang.hpp @@ -205,23 +205,23 @@ # define BOOST_NO_CXX11_FINAL #endif -#if !(__has_feature(cxx_binary_literals) || __has_extension(cxx_binary_literals)) +#if !(__has_feature(__cxx_binary_literals__) || __has_extension(__cxx_binary_literals__)) # define BOOST_NO_CXX14_BINARY_LITERALS #endif -#if !(__has_feature(cxx_decltype_auto) || __has_extension(cxx_decltype_auto)) +#if !(__has_feature(__cxx_decltype_auto__) || __has_extension(__cxx_decltype_auto__)) # define BOOST_NO_CXX14_DECLTYPE_AUTO #endif -#if !(__has_feature(cxx_aggregate_nsdmi) || __has_extension(cxx_aggregate_nsdmi)) +#if !(__has_feature(__cxx_aggregate_nsdmi__) || __has_extension(__cxx_aggregate_nsdmi__)) # define BOOST_NO_CXX14_AGGREGATE_NSDMI #endif -#if !__has_feature(cxx_init_captures) +#if !__has_feature(__cxx_init_captures__) # define BOOST_NO_CXX14_INITIALIZED_LAMBDA_CAPTURES #endif -#if !(__has_feature(cxx_generic_lambdas) || __has_extension(cxx_generic_lambdas)) +#if !(__has_feature(__cxx_generic_lambdas__) || __has_extension(__cxx_generic_lambdas__)) # define BOOST_NO_CXX14_GENERIC_LAMBDAS #endif @@ -239,16 +239,16 @@ // so instead verify that we have a feature that was introduced at the same time as working C++14 // constexpr (generic lambda's in this case): // -#if !__has_feature(cxx_generic_lambdas) \ - || !(__has_feature(cxx_relaxed_constexpr) || __has_extension(cxx_relaxed_constexpr)) +#if !__has_feature(__cxx_generic_lambdas__) \ + || !(__has_feature(__cxx_relaxed_constexpr__) || __has_extension(__cxx_relaxed_constexpr__)) # define BOOST_NO_CXX14_CONSTEXPR #endif -#if !(__has_feature(cxx_return_type_deduction) || __has_extension(cxx_return_type_deduction)) +#if !(__has_feature(__cxx_return_type_deduction__) || __has_extension(__cxx_return_type_deduction__)) # define BOOST_NO_CXX14_RETURN_TYPE_DEDUCTION #endif -#if !__has_feature(cxx_variable_templates) +#if !__has_feature(__cxx_variable_templates__) # define BOOST_NO_CXX14_VARIABLE_TEMPLATES #endif From 70096c5d80db22afb8806cac560e96a8c4f19e41 Mon Sep 17 00:00:00 2001 From: morinmorin Date: Sun, 26 Oct 2014 21:06:49 +0900 Subject: [PATCH 04/11] Remove `__has_extension` checks for features that are not available as extensions. For those features, `__has_extension` checks are equivalent to `__has_feature` checks and thus they are unnecessary. --- include/boost/config/compiler/clang.hpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/include/boost/config/compiler/clang.hpp b/include/boost/config/compiler/clang.hpp index 6cc8b22f..47ea65b0 100644 --- a/include/boost/config/compiler/clang.hpp +++ b/include/boost/config/compiler/clang.hpp @@ -189,7 +189,7 @@ # define BOOST_NO_CXX11_USER_DEFINED_LITERALS #endif -#if !(__has_feature(cxx_alignas) || __has_extension(cxx_alignas)) +#if !__has_feature(cxx_alignas) # define BOOST_NO_CXX11_ALIGNAS #endif @@ -209,11 +209,11 @@ # define BOOST_NO_CXX14_BINARY_LITERALS #endif -#if !(__has_feature(__cxx_decltype_auto__) || __has_extension(__cxx_decltype_auto__)) +#if !__has_feature(__cxx_decltype_auto__) # define BOOST_NO_CXX14_DECLTYPE_AUTO #endif -#if !(__has_feature(__cxx_aggregate_nsdmi__) || __has_extension(__cxx_aggregate_nsdmi__)) +#if !__has_feature(__cxx_aggregate_nsdmi__) # define BOOST_NO_CXX14_AGGREGATE_NSDMI #endif @@ -221,7 +221,7 @@ # define BOOST_NO_CXX14_INITIALIZED_LAMBDA_CAPTURES #endif -#if !(__has_feature(__cxx_generic_lambdas__) || __has_extension(__cxx_generic_lambdas__)) +#if !__has_feature(__cxx_generic_lambdas__) # define BOOST_NO_CXX14_GENERIC_LAMBDAS #endif @@ -239,12 +239,11 @@ // so instead verify that we have a feature that was introduced at the same time as working C++14 // constexpr (generic lambda's in this case): // -#if !__has_feature(__cxx_generic_lambdas__) \ - || !(__has_feature(__cxx_relaxed_constexpr__) || __has_extension(__cxx_relaxed_constexpr__)) +#if !__has_feature(__cxx_generic_lambdas__) || !__has_feature(__cxx_relaxed_constexpr__) # define BOOST_NO_CXX14_CONSTEXPR #endif -#if !(__has_feature(__cxx_return_type_deduction__) || __has_extension(__cxx_return_type_deduction__)) +#if !__has_feature(__cxx_return_type_deduction__) # define BOOST_NO_CXX14_RETURN_TYPE_DEDUCTION #endif From b8bfae2e75c0ca940e7fdbb2761eaa0b075be5d2 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Wed, 29 Oct 2014 23:41:06 +0300 Subject: [PATCH 05/11] Fix 'unknown pragma' warnings with MSVC 9 #pragma detect_mismatch is only supported since MSVC 10. --- include/boost/config/compiler/visualc.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/config/compiler/visualc.hpp b/include/boost/config/compiler/visualc.hpp index 57b617d1..69a4330f 100644 --- a/include/boost/config/compiler/visualc.hpp +++ b/include/boost/config/compiler/visualc.hpp @@ -104,7 +104,7 @@ #if (_MSC_VER >= 1400) && !defined(_DEBUG) # define BOOST_HAS_NRVO #endif -#if _MSC_VER >= 1500 // 150X == VC++ 9.0 +#if _MSC_VER >= 1600 // 160X == VC++ 10.0 # define BOOST_HAS_PRAGMA_DETECT_MISMATCH #endif // From 85fea8fe0a2813e9876394faaa271dd800b9698c Mon Sep 17 00:00:00 2001 From: Daniel James Date: Wed, 5 Nov 2014 00:42:37 +0000 Subject: [PATCH 06/11] Version bump --- include/boost/version.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/version.hpp b/include/boost/version.hpp index c156fd79..0cadccc8 100644 --- a/include/boost/version.hpp +++ b/include/boost/version.hpp @@ -19,7 +19,7 @@ // BOOST_VERSION / 100 % 1000 is the minor version // BOOST_VERSION / 100000 is the major version -#define BOOST_VERSION 105700 +#define BOOST_VERSION 105800 // // BOOST_LIB_VERSION must be defined to be the same as BOOST_VERSION @@ -27,6 +27,6 @@ // number, y is the minor version number, and z is the patch level if not 0. // This is used by to select which library version to link to. -#define BOOST_LIB_VERSION "1_57" +#define BOOST_LIB_VERSION "1_58" #endif From c329a34407d946c9dcd6d8efbc85a7690e91300a Mon Sep 17 00:00:00 2001 From: Marcel Raad Date: Thu, 13 Nov 2014 16:40:55 +0100 Subject: [PATCH 07/11] Update vor MSVC14 Preview According to the release notes, the following new language features are supported: - char16_t, char32_t, and unicode literals - binary literals - generic lambdas All Boost libraries build successfully, all config tests pass, and all projects I compiled worked correctly. Reference: http://www.visualstudio.com/news/vs2015-preview-vs#C++ --- include/boost/config/compiler/visualc.hpp | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/include/boost/config/compiler/visualc.hpp b/include/boost/config/compiler/visualc.hpp index 69a4330f..772dd955 100644 --- a/include/boost/config/compiler/visualc.hpp +++ b/include/boost/config/compiler/visualc.hpp @@ -172,26 +172,28 @@ # define BOOST_NO_CXX11_DECLTYPE_N3276 #endif -// C++11 features supported by VC++ 14 (aka 2014) CTP1 +// C++11 features supported by VC++ 14 (aka 2015) Preview // Because the CTP is unsupported, unrelease, and only alpha quality, // it is only supported if BOOST_MSVC_ENABLE_2014_JUN_CTP is defined. // -#if (_MSC_FULL_VER < 190021730) || !defined(BOOST_MSVC_ENABLE_2014_JUN_CTP) +#if (_MSC_FULL_VER < 190022310) || !defined(BOOST_MSVC_ENABLE_2014_JUN_CTP) # define BOOST_NO_CXX11_NOEXCEPT # define BOOST_NO_CXX11_REF_QUALIFIERS # define BOOST_NO_CXX11_USER_DEFINED_LITERALS # define BOOST_NO_CXX11_ALIGNAS # define BOOST_NO_CXX11_INLINE_NAMESPACES +# define BOOST_NO_CXX11_CHAR16_T +# define BOOST_NO_CXX11_CHAR32_T +# define BOOST_NO_CXX11_UNICODE_LITERALS # define BOOST_NO_CXX14_DECLTYPE_AUTO # define BOOST_NO_CXX14_INITIALIZED_LAMBDA_CAPTURES # define BOOST_NO_CXX14_RETURN_TYPE_DEDUCTION +# define BOOST_NO_CXX14_BINARY_LITERALS +# define BOOST_NO_CXX14_GENERIC_LAMBDAS #endif // C++11 features not supported by any versions -#define BOOST_NO_CXX11_CHAR16_T -#define BOOST_NO_CXX11_CHAR32_T #define BOOST_NO_CXX11_CONSTEXPR -#define BOOST_NO_CXX11_UNICODE_LITERALS #define BOOST_NO_SFINAE_EXPR #define BOOST_NO_TWO_PHASE_NAME_LOOKUP @@ -199,18 +201,12 @@ #if !defined(__cpp_aggregate_nsdmi) || (__cpp_aggregate_nsdmi < 201304) # define BOOST_NO_CXX14_AGGREGATE_NSDMI #endif -#if !defined(__cpp_binary_literals) || (__cpp_binary_literals < 201304) -# define BOOST_NO_CXX14_BINARY_LITERALS -#endif #if !defined(__cpp_constexpr) || (__cpp_constexpr < 201304) # define BOOST_NO_CXX14_CONSTEXPR #endif #if (__cplusplus < 201304) // There's no SD6 check for this.... # define BOOST_NO_CXX14_DIGIT_SEPARATORS #endif -#if !defined(__cpp_generic_lambdas) || (__cpp_generic_lambdas < 201304) -# define BOOST_NO_CXX14_GENERIC_LAMBDAS -#endif #if !defined(__cpp_variable_templates) || (__cpp_variable_templates < 201304) # define BOOST_NO_CXX14_VARIABLE_TEMPLATES #endif @@ -290,8 +286,8 @@ #endif // -// last known and checked version is 19.00.22129 (VC14 CTP4): -#if (_MSC_VER > 1800 && _MSC_FULL_VER > 190022129) +// last known and checked version is 19.00.22129 (VC14 Preview): +#if (_MSC_VER > 1800 && _MSC_FULL_VER > 190022310) # if defined(BOOST_ASSERT_CONFIG) # error "Unknown compiler version - please run the configure tests and report the results" # else From 6038d5fd7e86ecb46708c921b9e77eda9869eae4 Mon Sep 17 00:00:00 2001 From: Jessica Hamilton Date: Sun, 16 Nov 2014 13:28:57 +1300 Subject: [PATCH 08/11] haiku: add platform support --- include/boost/config/platform/haiku.hpp | 34 +++++++++++++++++++ .../boost/config/select_platform_config.hpp | 4 +++ include/boost/config/stdlib/libstdcpp3.hpp | 3 +- 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 include/boost/config/platform/haiku.hpp diff --git a/include/boost/config/platform/haiku.hpp b/include/boost/config/platform/haiku.hpp new file mode 100644 index 00000000..5b2cd03f --- /dev/null +++ b/include/boost/config/platform/haiku.hpp @@ -0,0 +1,34 @@ +// (C) Copyright John Maddock 2001. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// See http://www.boost.org for most recent version. + +// Haiku specific config options: + +#define BOOST_PLATFORM "Haiku" + +#define BOOST_HAS_UNISTD_H +#define GLIBC_HAVE_LONG_LONG +#define BOOST_HAS_STDINT_H +#define BOOST_HASH_NO_EXTENSIONS + +#ifndef BOOST_DISABLE_THREADS +# define BOOST_HAS_THREADS +#endif + +#define BOOST_NO_CXX11_HDR_TYPE_TRAITS +#define BOOST_NO_CXX11_ATOMIC_SMART_PTR +#define BOOST_NO_CXX11_STATIC_ASSERT +#define BOOST_NO_CXX11_VARIADIC_MACROS + +// +// thread API's not auto detected: +// +#define BOOST_HAS_SCHED_YIELD +#define BOOST_HAS_PTHREAD_YIELD +#define BOOST_HAS_GETTIMEOFDAY + +// boilerplate code: +#include diff --git a/include/boost/config/select_platform_config.hpp b/include/boost/config/select_platform_config.hpp index 2dddc6a2..acd1409e 100644 --- a/include/boost/config/select_platform_config.hpp +++ b/include/boost/config/select_platform_config.hpp @@ -41,6 +41,10 @@ // win32: # define BOOST_PLATFORM_CONFIG "boost/config/platform/win32.hpp" +#elif defined(__HAIKU__) +// Haiku +# define BOOST_PLATFORM_CONFIG "boost/config/platform/haiku.hpp" + #elif defined(__BEOS__) // BeOS # define BOOST_PLATFORM_CONFIG "boost/config/platform/beos.hpp" diff --git a/include/boost/config/stdlib/libstdcpp3.hpp b/include/boost/config/stdlib/libstdcpp3.hpp index b26d1ff9..24c768cb 100644 --- a/include/boost/config/stdlib/libstdcpp3.hpp +++ b/include/boost/config/stdlib/libstdcpp3.hpp @@ -36,7 +36,8 @@ || defined(_GLIBCXX__PTHREADS) \ || defined(_GLIBCXX_HAS_GTHREADS) \ || defined(_WIN32) \ - || defined(_AIX) + || defined(_AIX) \ + || defined(__HAIKU__) // // If the std lib has thread support turned on, then turn it on in Boost // as well. We do this because some gcc-3.4 std lib headers define _REENTANT From 1b6d6d9aa1daec00e8f33f229077974d15739ff4 Mon Sep 17 00:00:00 2001 From: Jessica Hamilton Date: Sun, 16 Nov 2014 21:43:03 +1300 Subject: [PATCH 09/11] haiku: fix copyright --- include/boost/config/platform/haiku.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/config/platform/haiku.hpp b/include/boost/config/platform/haiku.hpp index 5b2cd03f..7b296000 100644 --- a/include/boost/config/platform/haiku.hpp +++ b/include/boost/config/platform/haiku.hpp @@ -1,4 +1,4 @@ -// (C) Copyright John Maddock 2001. +// (C) Copyright Jessica Hamilton 2014. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) From 44028a148c0eb7f7a9239523a0f5fc90670b87f1 Mon Sep 17 00:00:00 2001 From: Jessica Hamilton Date: Sun, 16 Nov 2014 21:56:05 +1300 Subject: [PATCH 10/11] haiku: remove spurious GLIBC define --- include/boost/config/platform/haiku.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/include/boost/config/platform/haiku.hpp b/include/boost/config/platform/haiku.hpp index 7b296000..e3910d84 100644 --- a/include/boost/config/platform/haiku.hpp +++ b/include/boost/config/platform/haiku.hpp @@ -10,7 +10,6 @@ #define BOOST_PLATFORM "Haiku" #define BOOST_HAS_UNISTD_H -#define GLIBC_HAVE_LONG_LONG #define BOOST_HAS_STDINT_H #define BOOST_HASH_NO_EXTENSIONS From 06aa40a5d1e1225b677f5fdb1e6b460a73cf758f Mon Sep 17 00:00:00 2001 From: Beman Date: Tue, 18 Nov 2014 15:21:34 -0500 Subject: [PATCH 11/11] Remove requirement that BOOST_MSVC_ENABLE_2014_JUN_CTP be defined to get the correct BOOST_NO_CXX11_* macros for VC++ 14.0 (aka 2015). --- include/boost/config/compiler/visualc.hpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/include/boost/config/compiler/visualc.hpp b/include/boost/config/compiler/visualc.hpp index 772dd955..ce6bbeec 100644 --- a/include/boost/config/compiler/visualc.hpp +++ b/include/boost/config/compiler/visualc.hpp @@ -173,10 +173,8 @@ #endif // C++11 features supported by VC++ 14 (aka 2015) Preview -// Because the CTP is unsupported, unrelease, and only alpha quality, -// it is only supported if BOOST_MSVC_ENABLE_2014_JUN_CTP is defined. // -#if (_MSC_FULL_VER < 190022310) || !defined(BOOST_MSVC_ENABLE_2014_JUN_CTP) +#if (_MSC_FULL_VER < 190022310) # define BOOST_NO_CXX11_NOEXCEPT # define BOOST_NO_CXX11_REF_QUALIFIERS # define BOOST_NO_CXX11_USER_DEFINED_LITERALS