|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r80896 - in trunk: boost/ratio boost/ratio/detail libs/ratio/doc
From: vicente.botet_at_[hidden]
Date: 2012-10-07 09:53:41
Author: viboes
Date: 2012-10-07 09:53:41 EDT (Sun, 07 Oct 2012)
New Revision: 80896
URL: http://svn.boost.org/trac/boost/changeset/80896
Log:
Ratio: fixes parially 7478
Text files modified:
trunk/boost/ratio/detail/ratio_io.hpp | 6 ++++--
trunk/boost/ratio/ratio_io.hpp | 38 ++++++++++++++++++++------------------
trunk/libs/ratio/doc/ratio.qbk | 12 ++++++++++++
3 files changed, 36 insertions(+), 20 deletions(-)
Modified: trunk/boost/ratio/detail/ratio_io.hpp
==============================================================================
--- trunk/boost/ratio/detail/ratio_io.hpp (original)
+++ trunk/boost/ratio/detail/ratio_io.hpp 2012-10-07 09:53:41 EDT (Sun, 07 Oct 2012)
@@ -44,8 +44,10 @@
#include <boost/static_string/static_string.hpp>
#endif
-#if defined(BOOST_NO_CXX11_UNICODE_LITERALS) || defined(BOOST_NO_CXX11_CHAR16_T) || defined(BOOST_NO_CXX11_CHAR32_T)
-//~ #define BOOST_RATIO_HAS_UNICODE_SUPPORT
+#if defined(BOOST_NO_CXX11_UNICODE_LITERALS) || defined(BOOST_NO_CXX11_CHAR16_T) || defined(BOOST_NO_CXX11_CHAR32_T) || defined(BOOST_NO_CXX11_U16STRING) || defined(BOOST_NO_CXX11_U32STRING)
+#if defined BOOST_RATIO_HAS_UNICODE_SUPPORT
+#undef BOOST_RATIO_HAS_UNICODE_SUPPORT
+#endif
#else
#define BOOST_RATIO_HAS_UNICODE_SUPPORT 1
#endif
Modified: trunk/boost/ratio/ratio_io.hpp
==============================================================================
--- trunk/boost/ratio/ratio_io.hpp (original)
+++ trunk/boost/ratio/ratio_io.hpp 2012-10-07 09:53:41 EDT (Sun, 07 Oct 2012)
@@ -49,8 +49,10 @@
#include <boost/static_string/static_string.hpp>
#endif
-#if defined(BOOST_NO_CXX11_UNICODE_LITERALS) || defined(BOOST_NO_CXX11_CHAR16_T) || defined(BOOST_NO_CXX11_CHAR32_T)
-//~ #define BOOST_RATIO_HAS_UNICODE_SUPPORT
+#if defined(BOOST_NO_CXX11_UNICODE_LITERALS) || defined(BOOST_NO_CXX11_CHAR16_T) || defined(BOOST_NO_CXX11_CHAR32_T) || defined(BOOST_NO_CXX11_U16STRING) || defined(BOOST_NO_CXX11_U32STRING)
+#if defined BOOST_RATIO_HAS_UNICODE_SUPPORT
+#undef BOOST_RATIO_HAS_UNICODE_SUPPORT
+#endif
#else
#define BOOST_RATIO_HAS_UNICODE_SUPPORT 1
#endif
@@ -120,7 +122,7 @@
static std::string prefix() {return std::string("atto");}
};
-#if BOOST_RATIO_HAS_UNICODE_SUPPORT
+#if defined BOOST_RATIO_HAS_UNICODE_SUPPORT
template <>
struct ratio_string<atto, char16_t>
@@ -165,7 +167,7 @@
static std::string prefix() {return std::string("femto");}
};
-#if BOOST_RATIO_HAS_UNICODE_SUPPORT
+#if defined BOOST_RATIO_HAS_UNICODE_SUPPORT
template <>
struct ratio_string<femto, char16_t>
@@ -209,7 +211,7 @@
static std::string prefix() {return std::string("pico");}
};
-#if BOOST_RATIO_HAS_UNICODE_SUPPORT
+#if defined BOOST_RATIO_HAS_UNICODE_SUPPORT
template <>
struct ratio_string<pico, char16_t>
@@ -253,7 +255,7 @@
static std::string prefix() {return std::string("nano");}
};
-#if BOOST_RATIO_HAS_UNICODE_SUPPORT
+#if defined BOOST_RATIO_HAS_UNICODE_SUPPORT
template <>
struct ratio_string<nano, char16_t>
@@ -297,7 +299,7 @@
static std::string prefix() {return std::string("micro");}
};
-#if BOOST_RATIO_HAS_UNICODE_SUPPORT
+#if defined BOOST_RATIO_HAS_UNICODE_SUPPORT
template <>
struct ratio_string<micro, char16_t>
@@ -341,7 +343,7 @@
static std::string prefix() {return std::string("milli");}
};
-#if BOOST_RATIO_HAS_UNICODE_SUPPORT
+#if defined BOOST_RATIO_HAS_UNICODE_SUPPORT
template <>
struct ratio_string<milli, char16_t>
@@ -385,7 +387,7 @@
static std::string prefix() {return std::string("centi");}
};
-#if BOOST_RATIO_HAS_UNICODE_SUPPORT
+#if defined BOOST_RATIO_HAS_UNICODE_SUPPORT
template <>
struct ratio_string<centi, char16_t>
@@ -430,7 +432,7 @@
static std::string prefix() {return std::string("deci");}
};
-#if BOOST_RATIO_HAS_UNICODE_SUPPORT
+#if defined BOOST_RATIO_HAS_UNICODE_SUPPORT
template <>
struct ratio_string<deci, char16_t>
@@ -477,7 +479,7 @@
static std::string prefix() {return std::string("deca");}
};
-#if BOOST_RATIO_HAS_UNICODE_SUPPORT
+#if defined BOOST_RATIO_HAS_UNICODE_SUPPORT
template <>
struct ratio_string<deca, char16_t>
@@ -521,7 +523,7 @@
static std::string prefix() {return std::string("hecto");}
};
-#if BOOST_RATIO_HAS_UNICODE_SUPPORT
+#if defined BOOST_RATIO_HAS_UNICODE_SUPPORT
template <>
struct ratio_string<hecto, char16_t>
@@ -565,7 +567,7 @@
static std::string prefix() {return std::string("kilo");}
};
-#if BOOST_RATIO_HAS_UNICODE_SUPPORT
+#if defined BOOST_RATIO_HAS_UNICODE_SUPPORT
template <>
struct ratio_string<kilo, char16_t>
@@ -610,7 +612,7 @@
static std::string prefix() {return std::string("mega");}
};
-#if BOOST_RATIO_HAS_UNICODE_SUPPORT
+#if defined BOOST_RATIO_HAS_UNICODE_SUPPORT
template <>
struct ratio_string<mega, char16_t>
@@ -655,7 +657,7 @@
static std::string prefix() {return std::string("giga");}
};
-#if BOOST_RATIO_HAS_UNICODE_SUPPORT
+#if defined BOOST_RATIO_HAS_UNICODE_SUPPORT
template <>
struct ratio_string<giga, char16_t>
@@ -700,7 +702,7 @@
static std::string prefix() {return std::string("tera");}
};
-#if BOOST_RATIO_HAS_UNICODE_SUPPORT
+#if defined BOOST_RATIO_HAS_UNICODE_SUPPORT
template <>
struct ratio_string<tera, char16_t>
@@ -744,7 +746,7 @@
static std::string prefix() {return std::string("peta");}
};
-#if BOOST_RATIO_HAS_UNICODE_SUPPORT
+#if defined BOOST_RATIO_HAS_UNICODE_SUPPORT
template <>
struct ratio_string<peta, char16_t>
@@ -788,7 +790,7 @@
static std::string prefix() {return std::string("exa");}
};
-#if BOOST_RATIO_HAS_UNICODE_SUPPORT
+#if defined BOOST_RATIO_HAS_UNICODE_SUPPORT
template <>
struct ratio_string<exa, char16_t>
Modified: trunk/libs/ratio/doc/ratio.qbk
==============================================================================
--- trunk/libs/ratio/doc/ratio.qbk (original)
+++ trunk/libs/ratio/doc/ratio.qbk 2012-10-07 09:53:41 EDT (Sun, 07 Oct 2012)
@@ -1205,6 +1205,10 @@
[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
@@ -1859,6 +1863,14 @@
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.
+
+Currently there are no macros BOOST_NO_CXX11_U16STRING and BOOST_NO_CXX11_U32STRING signaling that the standard library doesn't provides std::u16string or std::u32string. The committed change avoids the compile error when Boost.Config will provide these macros. In the mean time the user needs to define them explicitly while using Boost.Ratio in these conditions.
+
+
+
[endsect]
[section [*Version 1.0.3, August 1, 2012 - 1.51] ]
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk