From 5ef03bffe3c0c8da6ca6bbbc8015182aa5ce4ab1 Mon Sep 17 00:00:00 2001 From: Beman Date: Mon, 1 Sep 2014 07:29:57 -0400 Subject: [PATCH] Move get_cont_octet_out_count_impl from unnamed namespace to namespace detail. Workaround for unnamed namespace symbols having external linkage prior to C++11, which causes duplicate symbol errors in libraries (for example filesystem) that link in multiple object files (differing only in namespaces) built from the same source file, allowing two versions to exist side-by-side in the same lib or dll. --- include/boost/detail/utf8_codecvt_facet.ipp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/include/boost/detail/utf8_codecvt_facet.ipp b/include/boost/detail/utf8_codecvt_facet.ipp index 8a13124..d39170f 100644 --- a/include/boost/detail/utf8_codecvt_facet.ipp +++ b/include/boost/detail/utf8_codecvt_facet.ipp @@ -216,9 +216,9 @@ unsigned int utf8_codecvt_facet::get_octet_count( else if (0xf8 <= lead_octet && lead_octet <= 0xfb) return 5; else return 6; } -BOOST_UTF8_END_NAMESPACE -namespace { +namespace detail { + template int get_cont_octet_out_count_impl(wchar_t word){ if (word < 0x80) { @@ -269,15 +269,14 @@ int get_cont_octet_out_count_impl<4>(wchar_t word){ #endif } -} // namespace anonymous +} // namespace detail -BOOST_UTF8_BEGIN_NAMESPACE // How many "continuing octets" will be needed for this word // == total octets - 1. int utf8_codecvt_facet::get_cont_octet_out_count( wchar_t word ) const { - return get_cont_octet_out_count_impl(word); + return detail::get_cont_octet_out_count_impl(word); } BOOST_UTF8_END_NAMESPACE