diff --git a/doc/ratio.qbk b/doc/ratio.qbk index eda13bf..408228e 100644 --- a/doc/ratio.qbk +++ b/doc/ratio.qbk @@ -1205,10 +1205,6 @@ The primary template provides generic strings. Specializations provide the same [section:spe Specializations for `ratio_string<>`] - -With compilers supporting char16_t and char32_t and with a standard library don't providing std::u16string and std::u32string you will need to -define the macros BOOST_NO_CXX11_U16STRING and BOOST_NO_CXX11_U32STRING until Boost.Config defines them. - For each specialization the table gives the return value for `prefix()` and `symbol()`. [table The return values of specializations of ratio_string @@ -1863,10 +1859,6 @@ The specialization relays on the __ratio_greater_equal template class. The ratio_string<>::short_name and ratio_string<>::long_name are deprecated. Use ratio_string<>::symbol and ratio_string<>::prefix respectively. These functions be removed in 1.55. -[*Fixes:] - -* [@http://svn.boost.org/trac/boost/ticket/7478 #7478] Compiles fails with compilers supporting char16_t and char32_t fails if the library doesn't provides std::u16string and std::u32string. - [endsect] [section [*Version 1.0.3, August 1, 2012 - 1.51] ] diff --git a/example/config.hpp b/example/config.hpp index 395ee80..0965dc6 100644 --- a/example/config.hpp +++ b/example/config.hpp @@ -91,7 +91,7 @@ // define constexpr related macros ------------------------------// //~ #include -#if defined(BOOST_NO_CONSTEXPR) +#if defined(BOOST_NO_CXX11_CONSTEXPR) #define BOOST_EX_CHRONO_CONSTEXPR #define BOOST_EX_CHRONO_CONST_REF const& #else diff --git a/example/duration.hpp b/example/duration.hpp index 48bb5f3..bede808 100644 --- a/example/duration.hpp +++ b/example/duration.hpp @@ -55,7 +55,7 @@ time2_demo contained this comment: #include #include -#if !defined(BOOST_NO_STATIC_ASSERT) || !defined(BOOST_EX_CHRONO_USES_MPL_ASSERT) +#if !defined(BOOST_NO_CXX11_STATIC_ASSERT) || !defined(BOOST_EX_CHRONO_USES_MPL_ASSERT) #define BOOST_EX_CHRONO_A_DURATION_REPRESENTATION_CAN_NOT_BE_A_DURATION "A duration representation can not be a duration" #define BOOST_EX_CHRONO_SECOND_TEMPLATE_PARAMETER_OF_DURATION_MUST_BE_A_STD_RATIO "Second template parameter of duration must be a boost::ratio" #define BOOST_EX_CHRONO_DURATION_PERIOD_MUST_BE_POSITIVE "duration period must be positive" diff --git a/example/static_assert.hpp b/example/static_assert.hpp index 6d257b3..b2d912e 100644 --- a/example/static_assert.hpp +++ b/example/static_assert.hpp @@ -11,7 +11,7 @@ #include "config.hpp" -#ifndef BOOST_NO_STATIC_ASSERT +#ifndef BOOST_NO_CXX11_STATIC_ASSERT #define BOOST_EX_CHRONO_STATIC_ASSERT(CND, MSG, TYPES) static_assert(CND,MSG) #elif defined(BOOST_CHRONO_USES_STATIC_ASSERT) #include diff --git a/example/type_traits/add_rvalue_reference.hpp b/example/type_traits/add_rvalue_reference.hpp index 32d778b..28258a0 100644 --- a/example/type_traits/add_rvalue_reference.hpp +++ b/example/type_traits/add_rvalue_reference.hpp @@ -42,7 +42,7 @@ namespace type_traits_detail { template struct add_rvalue_reference_helper { -#if !defined(BOOST_NO_RVALUE_REFERENCES) +#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) typedef T&& type; #else typedef T type; diff --git a/example/type_traits/common_type.hpp b/example/type_traits/common_type.hpp index 8648d48..0e8cec2 100644 --- a/example/type_traits/common_type.hpp +++ b/example/type_traits/common_type.hpp @@ -12,18 +12,18 @@ #include //----------------------------------------------------------------------------// -#if defined(BOOST_NO_VARIADIC_TEMPLATES) +#if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) #define BOOST_EX_COMMON_TYPE_ARITY 3 #endif //----------------------------------------------------------------------------// -#if defined(BOOST_NO_DECLTYPE) && !defined(BOOST_EX_COMMON_TYPE_DONT_USE_TYPEOF) +#if defined(BOOST_NO_CXX11_DECLTYPE) && !defined(BOOST_EX_COMMON_TYPE_DONT_USE_TYPEOF) #define BOOST_TYPEOF_SILENT #include // boost wonders never cease! #endif //----------------------------------------------------------------------------// -#ifndef BOOST_NO_STATIC_ASSERT +#ifndef BOOST_NO_CXX11_STATIC_ASSERT #define BOOST_EX_COMMON_TYPE_STATIC_ASSERT(CND, MSG, TYPES) static_assert(CND,MSG) #elif defined(BOOST_EX_COMMON_TYPE_USES_STATIC_ASSERT) #include @@ -41,11 +41,11 @@ //~ #define BOOST_EX_COMMON_TYPE_STATIC_ASSERT(CND, MSG, TYPES) #endif -#if !defined(BOOST_NO_STATIC_ASSERT) || !defined(BOOST_EX_COMMON_TYPE_USES_MPL_ASSERT) +#if !defined(BOOST_NO_CXX11_STATIC_ASSERT) || !defined(BOOST_EX_COMMON_TYPE_USES_MPL_ASSERT) #define BOOST_EX_COMMON_TYPE_MUST_BE_A_COMPLE_TYPE "must be complete type" #endif -#if defined(BOOST_NO_DECLTYPE) && defined(BOOST_EX_COMMON_TYPE_DONT_USE_TYPEOF) +#if defined(BOOST_NO_CXX11_DECLTYPE) && defined(BOOST_EX_COMMON_TYPE_DONT_USE_TYPEOF) #include "detail/common_type.hpp" #include #endif @@ -64,7 +64,7 @@ namespace boost_ex { // prototype -#if !defined(BOOST_NO_VARIADIC_TEMPLATES) +#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) template struct common_type; #else // or no specialization @@ -79,7 +79,7 @@ namespace boost_ex { // 1 arg template -#if !defined(BOOST_NO_VARIADIC_TEMPLATES) +#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) struct common_type #else struct common_type @@ -104,7 +104,7 @@ namespace type_traits_detail { static typename add_rvalue_reference::type declval_T(); // workaround gcc bug; not required by std static typename add_rvalue_reference::type declval_U(); // workaround gcc bug; not required by std -#if !defined(BOOST_NO_DECLTYPE) +#if !defined(BOOST_NO_CXX11_DECLTYPE) public: typedef decltype(declval() ? declval() : declval()) type; #elif defined(BOOST_EX_COMMON_TYPE_DONT_USE_TYPEOF) @@ -127,7 +127,7 @@ namespace type_traits_detail { }; } -#if !defined(BOOST_NO_VARIADIC_TEMPLATES) +#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) template struct common_type #else @@ -139,7 +139,7 @@ namespace type_traits_detail { // 3 or more args -#if !defined(BOOST_NO_VARIADIC_TEMPLATES) +#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) template struct common_type { public: diff --git a/include/boost/ratio/config.hpp b/include/boost/ratio/config.hpp index 67a60fc..992a256 100644 --- a/include/boost/ratio/config.hpp +++ b/include/boost/ratio/config.hpp @@ -49,6 +49,12 @@ #define BOOST_RATIO_INTMAX_C(a) a##LL #endif +#ifdef UINTMAX_C +#define BOOST_RATIO_UINTMAX_C(a) UINTMAX_C(a) +#else +#define BOOST_RATIO_UINTMAX_C(a) a##ULL +#endif + #define BOOST_RATIO_INTMAX_T_MAX (0x7FFFFFFFFFFFFFFELL) diff --git a/include/boost/ratio/detail/overflow_helpers.hpp b/include/boost/ratio/detail/overflow_helpers.hpp index 0e292fa..8df3b1f 100644 --- a/include/boost/ratio/detail/overflow_helpers.hpp +++ b/include/boost/ratio/detail/overflow_helpers.hpp @@ -133,7 +133,7 @@ namespace ratio_detail class br_mul { static const boost::intmax_t nan = - (BOOST_RATIO_INTMAX_C(1) << (sizeof(boost::intmax_t) * CHAR_BIT - 1)); + boost::intmax_t(BOOST_RATIO_UINTMAX_C(1) << (sizeof(boost::intmax_t) * CHAR_BIT - 1)); static const boost::intmax_t min = boost::integer_traits::const_min; static const boost::intmax_t max = boost::integer_traits::const_max; @@ -172,7 +172,7 @@ namespace ratio_detail template class br_div { - static const boost::intmax_t nan = (1LL << (sizeof(boost::intmax_t) * CHAR_BIT - 1)); + static const boost::intmax_t nan = boost::intmax_t(BOOST_RATIO_UINTMAX_C(1) << (sizeof(boost::intmax_t) * CHAR_BIT - 1)); static const boost::intmax_t min = boost::integer_traits::const_min; static const boost::intmax_t max = boost::integer_traits::const_max; diff --git a/test/ratio_arithmetic/ratio_add_fail.cpp b/test/ratio_arithmetic/ratio_add_fail.cpp index 80964a2..57ec0d4 100644 --- a/test/ratio_arithmetic/ratio_add_fail.cpp +++ b/test/ratio_arithmetic/ratio_add_fail.cpp @@ -14,7 +14,7 @@ #include #include -#if !defined(BOOST_NO_STATIC_ASSERT) +#if !defined(BOOST_NO_CXX11_STATIC_ASSERT) #define NOTHING "" #endif diff --git a/test/ratio_arithmetic/ratio_add_pass.cpp b/test/ratio_arithmetic/ratio_add_pass.cpp index 736d3df..e13c457 100644 --- a/test/ratio_arithmetic/ratio_add_pass.cpp +++ b/test/ratio_arithmetic/ratio_add_pass.cpp @@ -14,7 +14,7 @@ // test ratio_add #include -#if !defined(BOOST_NO_STATIC_ASSERT) +#if !defined(BOOST_NO_CXX11_STATIC_ASSERT) #define NOTHING "" #endif diff --git a/test/ratio_arithmetic/ratio_divide_pass.cpp b/test/ratio_arithmetic/ratio_divide_pass.cpp index 2cca8db..5eedc4b 100644 --- a/test/ratio_arithmetic/ratio_divide_pass.cpp +++ b/test/ratio_arithmetic/ratio_divide_pass.cpp @@ -14,7 +14,7 @@ // test ratio_divide #include -#if !defined(BOOST_NO_STATIC_ASSERT) +#if !defined(BOOST_NO_CXX11_STATIC_ASSERT) #define NOTHING "" #endif diff --git a/test/ratio_arithmetic/ratio_multiply_pass.cpp b/test/ratio_arithmetic/ratio_multiply_pass.cpp index 30fbe2e..42083b8 100644 --- a/test/ratio_arithmetic/ratio_multiply_pass.cpp +++ b/test/ratio_arithmetic/ratio_multiply_pass.cpp @@ -14,7 +14,7 @@ // test ratio_multiply #include -#if !defined(BOOST_NO_STATIC_ASSERT) +#if !defined(BOOST_NO_CXX11_STATIC_ASSERT) #define NOTHING "" #endif diff --git a/test/ratio_arithmetic/ratio_subtract_pass.cpp b/test/ratio_arithmetic/ratio_subtract_pass.cpp index 4c5334a..7fa344e 100644 --- a/test/ratio_arithmetic/ratio_subtract_pass.cpp +++ b/test/ratio_arithmetic/ratio_subtract_pass.cpp @@ -14,7 +14,7 @@ // test ratio_subtract #include -#if !defined(BOOST_NO_STATIC_ASSERT) +#if !defined(BOOST_NO_CXX11_STATIC_ASSERT) #define NOTHING "" #endif diff --git a/test/ratio_comparison/ratio_equal_pass.cpp b/test/ratio_comparison/ratio_equal_pass.cpp index 4298ff6..355cfa0 100644 --- a/test/ratio_comparison/ratio_equal_pass.cpp +++ b/test/ratio_comparison/ratio_equal_pass.cpp @@ -14,7 +14,7 @@ // test ratio_equal #include -#if !defined(BOOST_NO_STATIC_ASSERT) +#if !defined(BOOST_NO_CXX11_STATIC_ASSERT) #define NOTHING "" #endif diff --git a/test/ratio_comparison/ratio_greater_equal_pass.cpp b/test/ratio_comparison/ratio_greater_equal_pass.cpp index f6b894c..dbe6a53 100644 --- a/test/ratio_comparison/ratio_greater_equal_pass.cpp +++ b/test/ratio_comparison/ratio_greater_equal_pass.cpp @@ -12,7 +12,7 @@ // See http://www.boost.org/LICENSE_1_0.txt #include -#if !defined(BOOST_NO_STATIC_ASSERT) +#if !defined(BOOST_NO_CXX11_STATIC_ASSERT) #define NOTHING "" #endif diff --git a/test/ratio_comparison/ratio_greater_pass.cpp b/test/ratio_comparison/ratio_greater_pass.cpp index a2111d5..cf34d2f 100644 --- a/test/ratio_comparison/ratio_greater_pass.cpp +++ b/test/ratio_comparison/ratio_greater_pass.cpp @@ -12,7 +12,7 @@ // See http://www.boost.org/LICENSE_1_0.txt #include -#if !defined(BOOST_NO_STATIC_ASSERT) +#if !defined(BOOST_NO_CXX11_STATIC_ASSERT) #define NOTHING "" #endif diff --git a/test/ratio_comparison/ratio_less_equal_pass.cpp b/test/ratio_comparison/ratio_less_equal_pass.cpp index 7f5fee4..9310fd9 100644 --- a/test/ratio_comparison/ratio_less_equal_pass.cpp +++ b/test/ratio_comparison/ratio_less_equal_pass.cpp @@ -12,7 +12,7 @@ // See http://www.boost.org/LICENSE_1_0.txt #include -#if !defined(BOOST_NO_STATIC_ASSERT) +#if !defined(BOOST_NO_CXX11_STATIC_ASSERT) #define NOTHING "" #endif diff --git a/test/ratio_comparison/ratio_less_pass.cpp b/test/ratio_comparison/ratio_less_pass.cpp index 9cbc34e..652a474 100644 --- a/test/ratio_comparison/ratio_less_pass.cpp +++ b/test/ratio_comparison/ratio_less_pass.cpp @@ -12,7 +12,7 @@ // See http://www.boost.org/LICENSE_1_0.txt #include -#if !defined(BOOST_NO_STATIC_ASSERT) +#if !defined(BOOST_NO_CXX11_STATIC_ASSERT) #define NOTHING "" #endif diff --git a/test/ratio_comparison/ratio_not_equal_pass.cpp b/test/ratio_comparison/ratio_not_equal_pass.cpp index d055373..c1af8ab 100644 --- a/test/ratio_comparison/ratio_not_equal_pass.cpp +++ b/test/ratio_comparison/ratio_not_equal_pass.cpp @@ -12,7 +12,7 @@ // See http://www.boost.org/LICENSE_1_0.txt #include -#if !defined(BOOST_NO_STATIC_ASSERT) +#if !defined(BOOST_NO_CXX11_STATIC_ASSERT) #define NOTHING "" #endif diff --git a/test/ratio_extensions/mpl_abs_pass.cpp b/test/ratio_extensions/mpl_abs_pass.cpp index de53b13..35d0cea 100644 --- a/test/ratio_extensions/mpl_abs_pass.cpp +++ b/test/ratio_extensions/mpl_abs_pass.cpp @@ -16,7 +16,7 @@ #define BOOST_RATIO_EXTENSIONS #include -#if !defined(BOOST_NO_STATIC_ASSERT) +#if !defined(BOOST_NO_CXX11_STATIC_ASSERT) #define NOTHING "" #endif diff --git a/test/ratio_extensions/mpl_divides_pass.cpp b/test/ratio_extensions/mpl_divides_pass.cpp index 9db6e24..2afdf9e 100644 --- a/test/ratio_extensions/mpl_divides_pass.cpp +++ b/test/ratio_extensions/mpl_divides_pass.cpp @@ -16,7 +16,7 @@ #define BOOST_RATIO_EXTENSIONS #include -#if !defined(BOOST_NO_STATIC_ASSERT) +#if !defined(BOOST_NO_CXX11_STATIC_ASSERT) #define NOTHING "" #endif diff --git a/test/ratio_extensions/mpl_equal_to_pass.cpp b/test/ratio_extensions/mpl_equal_to_pass.cpp index 704d889..e86c31c 100644 --- a/test/ratio_extensions/mpl_equal_to_pass.cpp +++ b/test/ratio_extensions/mpl_equal_to_pass.cpp @@ -16,7 +16,7 @@ #define BOOST_RATIO_EXTENSIONS #include -#if !defined(BOOST_NO_STATIC_ASSERT) +#if !defined(BOOST_NO_CXX11_STATIC_ASSERT) #define NOTHING "" #endif diff --git a/test/ratio_extensions/mpl_greater_equal_pass.cpp b/test/ratio_extensions/mpl_greater_equal_pass.cpp index 1661003..e9c3306 100644 --- a/test/ratio_extensions/mpl_greater_equal_pass.cpp +++ b/test/ratio_extensions/mpl_greater_equal_pass.cpp @@ -14,7 +14,7 @@ #define BOOST_RATIO_EXTENSIONS #include -#if !defined(BOOST_NO_STATIC_ASSERT) +#if !defined(BOOST_NO_CXX11_STATIC_ASSERT) #define NOTHING "" #endif diff --git a/test/ratio_extensions/mpl_greater_pass.cpp b/test/ratio_extensions/mpl_greater_pass.cpp index 99f4795..dd91083 100644 --- a/test/ratio_extensions/mpl_greater_pass.cpp +++ b/test/ratio_extensions/mpl_greater_pass.cpp @@ -14,7 +14,7 @@ #define BOOST_RATIO_EXTENSIONS #include -#if !defined(BOOST_NO_STATIC_ASSERT) +#if !defined(BOOST_NO_CXX11_STATIC_ASSERT) #define NOTHING "" #endif diff --git a/test/ratio_extensions/mpl_less_equal_pass.cpp b/test/ratio_extensions/mpl_less_equal_pass.cpp index 9682ce8..2443c25 100644 --- a/test/ratio_extensions/mpl_less_equal_pass.cpp +++ b/test/ratio_extensions/mpl_less_equal_pass.cpp @@ -14,7 +14,7 @@ #define BOOST_RATIO_EXTENSIONS #include -#if !defined(BOOST_NO_STATIC_ASSERT) +#if !defined(BOOST_NO_CXX11_STATIC_ASSERT) #define NOTHING "" #endif diff --git a/test/ratio_extensions/mpl_less_pass.cpp b/test/ratio_extensions/mpl_less_pass.cpp index ed2223d..89032e1 100644 --- a/test/ratio_extensions/mpl_less_pass.cpp +++ b/test/ratio_extensions/mpl_less_pass.cpp @@ -14,7 +14,7 @@ #define BOOST_RATIO_EXTENSIONS #include -#if !defined(BOOST_NO_STATIC_ASSERT) +#if !defined(BOOST_NO_CXX11_STATIC_ASSERT) #define NOTHING "" #endif diff --git a/test/ratio_extensions/mpl_minus_pass.cpp b/test/ratio_extensions/mpl_minus_pass.cpp index 0198206..ca33571 100644 --- a/test/ratio_extensions/mpl_minus_pass.cpp +++ b/test/ratio_extensions/mpl_minus_pass.cpp @@ -16,7 +16,7 @@ #define BOOST_RATIO_EXTENSIONS #include -#if !defined(BOOST_NO_STATIC_ASSERT) +#if !defined(BOOST_NO_CXX11_STATIC_ASSERT) #define NOTHING "" #endif diff --git a/test/ratio_extensions/mpl_negate_pass.cpp b/test/ratio_extensions/mpl_negate_pass.cpp index 77f90aa..87f75f3 100644 --- a/test/ratio_extensions/mpl_negate_pass.cpp +++ b/test/ratio_extensions/mpl_negate_pass.cpp @@ -16,7 +16,7 @@ #define BOOST_RATIO_EXTENSIONS #include -#if !defined(BOOST_NO_STATIC_ASSERT) +#if !defined(BOOST_NO_CXX11_STATIC_ASSERT) #define NOTHING "" #endif diff --git a/test/ratio_extensions/mpl_not_equal_to_pass.cpp b/test/ratio_extensions/mpl_not_equal_to_pass.cpp index f9c07ed..3e4c662 100644 --- a/test/ratio_extensions/mpl_not_equal_to_pass.cpp +++ b/test/ratio_extensions/mpl_not_equal_to_pass.cpp @@ -14,7 +14,7 @@ #define BOOST_RATIO_EXTENSIONS #include -#if !defined(BOOST_NO_STATIC_ASSERT) +#if !defined(BOOST_NO_CXX11_STATIC_ASSERT) #define NOTHING "" #endif diff --git a/test/ratio_extensions/mpl_plus_pass.cpp b/test/ratio_extensions/mpl_plus_pass.cpp index 2258083..ccf03c3 100644 --- a/test/ratio_extensions/mpl_plus_pass.cpp +++ b/test/ratio_extensions/mpl_plus_pass.cpp @@ -16,7 +16,7 @@ #define BOOST_RATIO_EXTENSIONS #include -#if !defined(BOOST_NO_STATIC_ASSERT) +#if !defined(BOOST_NO_CXX11_STATIC_ASSERT) #define NOTHING "" #endif diff --git a/test/ratio_extensions/mpl_sign_pass.cpp b/test/ratio_extensions/mpl_sign_pass.cpp index 4db1ced..f78d2b4 100644 --- a/test/ratio_extensions/mpl_sign_pass.cpp +++ b/test/ratio_extensions/mpl_sign_pass.cpp @@ -16,7 +16,7 @@ #define BOOST_RATIO_EXTENSIONS #include -#if !defined(BOOST_NO_STATIC_ASSERT) +#if !defined(BOOST_NO_CXX11_STATIC_ASSERT) #define NOTHING "" #endif diff --git a/test/ratio_extensions/mpl_times_pass.cpp b/test/ratio_extensions/mpl_times_pass.cpp index d58a1c4..5f8a2a4 100644 --- a/test/ratio_extensions/mpl_times_pass.cpp +++ b/test/ratio_extensions/mpl_times_pass.cpp @@ -16,7 +16,7 @@ #define BOOST_RATIO_EXTENSIONS #include -#if !defined(BOOST_NO_STATIC_ASSERT) +#if !defined(BOOST_NO_CXX11_STATIC_ASSERT) #define NOTHING "" #endif diff --git a/test/ratio_ratio/ratio_pass.cpp b/test/ratio_ratio/ratio_pass.cpp index 2db988a..fb52ac9 100644 --- a/test/ratio_ratio/ratio_pass.cpp +++ b/test/ratio_ratio/ratio_pass.cpp @@ -16,7 +16,7 @@ #include -#if !defined(BOOST_NO_STATIC_ASSERT) +#if !defined(BOOST_NO_CXX11_STATIC_ASSERT) #define NOTHING "" #endif diff --git a/test/typedefs_pass.cpp b/test/typedefs_pass.cpp index f59252b..da7c4ba 100644 --- a/test/typedefs_pass.cpp +++ b/test/typedefs_pass.cpp @@ -6,7 +6,7 @@ #include -#if !defined(BOOST_NO_STATIC_ASSERT) +#if !defined(BOOST_NO_CXX11_STATIC_ASSERT) #define NOTHING "" #endif