From: Shane Carr Date: Fri, 16 Mar 2018 21:53:08 +0000 (+0000) Subject: ICU-13648 Moving double_conversion into ICU namespace to fix name mangling. X-Git-Tag: release-62-rc~211 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3951517380f86997ca583336418e48c832584b29;p=icu ICU-13648 Moving double_conversion into ICU namespace to fix name mangling. X-SVN-Rev: 41116 --- diff --git a/icu4c/source/i18n/digitlst.cpp b/icu4c/source/i18n/digitlst.cpp index 5ceccd38b61..978bb60004f 100644 --- a/icu4c/source/i18n/digitlst.cpp +++ b/icu4c/source/i18n/digitlst.cpp @@ -51,7 +51,7 @@ #include #include -using double_conversion::DoubleToStringConverter; +using icu::double_conversion::DoubleToStringConverter; #if !defined(U_USE_STRTOD_L) # if U_PLATFORM_USES_ONLY_WIN32_API diff --git a/icu4c/source/i18n/double-conversion-bignum-dtoa.cpp b/icu4c/source/i18n/double-conversion-bignum-dtoa.cpp index 677f0de1ff5..07d0b0eb0f8 100644 --- a/icu4c/source/i18n/double-conversion-bignum-dtoa.cpp +++ b/icu4c/source/i18n/double-conversion-bignum-dtoa.cpp @@ -30,6 +30,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// ICU PATCH: ifdef around UCONFIG_NO_FORMATTING +#include "unicode/utypes.h" +#if !UCONFIG_NO_FORMATTING + #include // ICU PATCH: Customize header file paths for ICU. @@ -39,6 +43,9 @@ #include "double-conversion-bignum.h" #include "double-conversion-ieee.h" +// ICU PATCH: Wrap in ICU namespace +U_NAMESPACE_BEGIN + namespace double_conversion { static int NormalizedExponent(uint64_t significand, int exponent) { @@ -646,3 +653,7 @@ static void FixupMultiply10(int estimated_power, bool is_even, } } // namespace double_conversion + +// ICU PATCH: Close ICU namespace +U_NAMESPACE_END +#endif // ICU PATCH: close #if !UCONFIG_NO_FORMATTING diff --git a/icu4c/source/i18n/double-conversion-bignum-dtoa.h b/icu4c/source/i18n/double-conversion-bignum-dtoa.h index 76b81ca9a16..edc21b0f2e4 100644 --- a/icu4c/source/i18n/double-conversion-bignum-dtoa.h +++ b/icu4c/source/i18n/double-conversion-bignum-dtoa.h @@ -30,6 +30,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// ICU PATCH: ifdef around UCONFIG_NO_FORMATTING +#include "unicode/utypes.h" +#if !UCONFIG_NO_FORMATTING + #ifndef DOUBLE_CONVERSION_BIGNUM_DTOA_H_ #define DOUBLE_CONVERSION_BIGNUM_DTOA_H_ @@ -37,6 +41,9 @@ #include "double-conversion-utils.h" +// ICU PATCH: Wrap in ICU namespace +U_NAMESPACE_BEGIN + namespace double_conversion { enum BignumDtoaMode { @@ -88,4 +95,8 @@ void BignumDtoa(double v, BignumDtoaMode mode, int requested_digits, } // namespace double_conversion +// ICU PATCH: Close ICU namespace +U_NAMESPACE_END + #endif // DOUBLE_CONVERSION_BIGNUM_DTOA_H_ +#endif // ICU PATCH: close #if !UCONFIG_NO_FORMATTING diff --git a/icu4c/source/i18n/double-conversion-bignum.cpp b/icu4c/source/i18n/double-conversion-bignum.cpp index 2af24771b0b..d5682af35f8 100644 --- a/icu4c/source/i18n/double-conversion-bignum.cpp +++ b/icu4c/source/i18n/double-conversion-bignum.cpp @@ -30,11 +30,18 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// ICU PATCH: ifdef around UCONFIG_NO_FORMATTING +#include "unicode/utypes.h" +#if !UCONFIG_NO_FORMATTING + // ICU PATCH: Customize header file paths for ICU. #include "double-conversion-bignum.h" #include "double-conversion-utils.h" +// ICU PATCH: Wrap in ICU namespace +U_NAMESPACE_BEGIN + namespace double_conversion { Bignum::Bignum() @@ -771,3 +778,7 @@ void Bignum::SubtractTimes(const Bignum& other, int factor) { } // namespace double_conversion + +// ICU PATCH: Close ICU namespace +U_NAMESPACE_END +#endif // ICU PATCH: close #if !UCONFIG_NO_FORMATTING diff --git a/icu4c/source/i18n/double-conversion-bignum.h b/icu4c/source/i18n/double-conversion-bignum.h index 5b38e678b31..d1af3bf5e77 100644 --- a/icu4c/source/i18n/double-conversion-bignum.h +++ b/icu4c/source/i18n/double-conversion-bignum.h @@ -30,6 +30,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// ICU PATCH: ifdef around UCONFIG_NO_FORMATTING +#include "unicode/utypes.h" +#if !UCONFIG_NO_FORMATTING + #ifndef DOUBLE_CONVERSION_BIGNUM_H_ #define DOUBLE_CONVERSION_BIGNUM_H_ @@ -37,6 +41,9 @@ #include "double-conversion-utils.h" +// ICU PATCH: Wrap in ICU namespace +U_NAMESPACE_BEGIN + namespace double_conversion { class Bignum { @@ -148,4 +155,8 @@ class Bignum { } // namespace double_conversion +// ICU PATCH: Close ICU namespace +U_NAMESPACE_END + #endif // DOUBLE_CONVERSION_BIGNUM_H_ +#endif // ICU PATCH: close #if !UCONFIG_NO_FORMATTING diff --git a/icu4c/source/i18n/double-conversion-cached-powers.cpp b/icu4c/source/i18n/double-conversion-cached-powers.cpp index 8b01626c52a..e49700444c6 100644 --- a/icu4c/source/i18n/double-conversion-cached-powers.cpp +++ b/icu4c/source/i18n/double-conversion-cached-powers.cpp @@ -30,6 +30,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// ICU PATCH: ifdef around UCONFIG_NO_FORMATTING +#include "unicode/utypes.h" +#if !UCONFIG_NO_FORMATTING + #include #include #include @@ -40,6 +44,9 @@ #include "double-conversion-cached-powers.h" +// ICU PATCH: Wrap in ICU namespace +U_NAMESPACE_BEGIN + namespace double_conversion { struct CachedPower { @@ -180,3 +187,7 @@ void PowersOfTenCache::GetCachedPowerForDecimalExponent(int requested_exponent, } } // namespace double_conversion + +// ICU PATCH: Close ICU namespace +U_NAMESPACE_END +#endif // ICU PATCH: close #if !UCONFIG_NO_FORMATTING diff --git a/icu4c/source/i18n/double-conversion-cached-powers.h b/icu4c/source/i18n/double-conversion-cached-powers.h index 25fd1f1f150..438746b1432 100644 --- a/icu4c/source/i18n/double-conversion-cached-powers.h +++ b/icu4c/source/i18n/double-conversion-cached-powers.h @@ -30,6 +30,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// ICU PATCH: ifdef around UCONFIG_NO_FORMATTING +#include "unicode/utypes.h" +#if !UCONFIG_NO_FORMATTING + #ifndef DOUBLE_CONVERSION_CACHED_POWERS_H_ #define DOUBLE_CONVERSION_CACHED_POWERS_H_ @@ -37,6 +41,9 @@ #include "double-conversion-diy-fp.h" +// ICU PATCH: Wrap in ICU namespace +U_NAMESPACE_BEGIN + namespace double_conversion { class PowersOfTenCache { @@ -68,4 +75,8 @@ class PowersOfTenCache { } // namespace double_conversion +// ICU PATCH: Close ICU namespace +U_NAMESPACE_END + #endif // DOUBLE_CONVERSION_CACHED_POWERS_H_ +#endif // ICU PATCH: close #if !UCONFIG_NO_FORMATTING diff --git a/icu4c/source/i18n/double-conversion-diy-fp.cpp b/icu4c/source/i18n/double-conversion-diy-fp.cpp index eac50e33213..f38430c6c3c 100644 --- a/icu4c/source/i18n/double-conversion-diy-fp.cpp +++ b/icu4c/source/i18n/double-conversion-diy-fp.cpp @@ -30,12 +30,18 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// ICU PATCH: ifdef around UCONFIG_NO_FORMATTING +#include "unicode/utypes.h" +#if !UCONFIG_NO_FORMATTING // ICU PATCH: Customize header file paths for ICU. #include "double-conversion-diy-fp.h" #include "double-conversion-utils.h" +// ICU PATCH: Wrap in ICU namespace +U_NAMESPACE_BEGIN + namespace double_conversion { void DiyFp::Multiply(const DiyFp& other) { @@ -62,3 +68,7 @@ void DiyFp::Multiply(const DiyFp& other) { } } // namespace double_conversion + +// ICU PATCH: Close ICU namespace +U_NAMESPACE_END +#endif // ICU PATCH: close #if !UCONFIG_NO_FORMATTING diff --git a/icu4c/source/i18n/double-conversion-diy-fp.h b/icu4c/source/i18n/double-conversion-diy-fp.h index 132886c8883..21896851d22 100644 --- a/icu4c/source/i18n/double-conversion-diy-fp.h +++ b/icu4c/source/i18n/double-conversion-diy-fp.h @@ -30,6 +30,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// ICU PATCH: ifdef around UCONFIG_NO_FORMATTING +#include "unicode/utypes.h" +#if !UCONFIG_NO_FORMATTING + #ifndef DOUBLE_CONVERSION_DIY_FP_H_ #define DOUBLE_CONVERSION_DIY_FP_H_ @@ -37,6 +41,9 @@ #include "double-conversion-utils.h" +// ICU PATCH: Wrap in ICU namespace +U_NAMESPACE_BEGIN + namespace double_conversion { // This "Do It Yourself Floating Point" class implements a floating-point number @@ -122,4 +129,8 @@ class DiyFp { } // namespace double_conversion +// ICU PATCH: Close ICU namespace +U_NAMESPACE_END + #endif // DOUBLE_CONVERSION_DIY_FP_H_ +#endif // ICU PATCH: close #if !UCONFIG_NO_FORMATTING diff --git a/icu4c/source/i18n/double-conversion-fast-dtoa.cpp b/icu4c/source/i18n/double-conversion-fast-dtoa.cpp index 6b0914407ae..8d1499a79b4 100644 --- a/icu4c/source/i18n/double-conversion-fast-dtoa.cpp +++ b/icu4c/source/i18n/double-conversion-fast-dtoa.cpp @@ -30,6 +30,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// ICU PATCH: ifdef around UCONFIG_NO_FORMATTING +#include "unicode/utypes.h" +#if !UCONFIG_NO_FORMATTING + // ICU PATCH: Customize header file paths for ICU. #include "double-conversion-fast-dtoa.h" @@ -38,6 +42,9 @@ #include "double-conversion-diy-fp.h" #include "double-conversion-ieee.h" +// ICU PATCH: Wrap in ICU namespace +U_NAMESPACE_BEGIN + namespace double_conversion { // The minimal and maximal target exponent define the range of w's binary @@ -670,3 +677,7 @@ bool FastDtoa(double v, } } // namespace double_conversion + +// ICU PATCH: Close ICU namespace +U_NAMESPACE_END +#endif // ICU PATCH: close #if !UCONFIG_NO_FORMATTING diff --git a/icu4c/source/i18n/double-conversion-fast-dtoa.h b/icu4c/source/i18n/double-conversion-fast-dtoa.h index b7e70a458e3..58a6470052c 100644 --- a/icu4c/source/i18n/double-conversion-fast-dtoa.h +++ b/icu4c/source/i18n/double-conversion-fast-dtoa.h @@ -30,6 +30,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// ICU PATCH: ifdef around UCONFIG_NO_FORMATTING +#include "unicode/utypes.h" +#if !UCONFIG_NO_FORMATTING + #ifndef DOUBLE_CONVERSION_FAST_DTOA_H_ #define DOUBLE_CONVERSION_FAST_DTOA_H_ @@ -37,6 +41,9 @@ #include "double-conversion-utils.h" +// ICU PATCH: Wrap in ICU namespace +U_NAMESPACE_BEGIN + namespace double_conversion { enum FastDtoaMode { @@ -92,4 +99,8 @@ bool FastDtoa(double d, } // namespace double_conversion +// ICU PATCH: Close ICU namespace +U_NAMESPACE_END + #endif // DOUBLE_CONVERSION_FAST_DTOA_H_ +#endif // ICU PATCH: close #if !UCONFIG_NO_FORMATTING diff --git a/icu4c/source/i18n/double-conversion-ieee.h b/icu4c/source/i18n/double-conversion-ieee.h index 387298a6e7f..952bcea27f6 100644 --- a/icu4c/source/i18n/double-conversion-ieee.h +++ b/icu4c/source/i18n/double-conversion-ieee.h @@ -30,6 +30,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// ICU PATCH: ifdef around UCONFIG_NO_FORMATTING +#include "unicode/utypes.h" +#if !UCONFIG_NO_FORMATTING + #ifndef DOUBLE_CONVERSION_DOUBLE_H_ #define DOUBLE_CONVERSION_DOUBLE_H_ @@ -37,6 +41,9 @@ #include "double-conversion-diy-fp.h" +// ICU PATCH: Wrap in ICU namespace +U_NAMESPACE_BEGIN + namespace double_conversion { // We assume that doubles and uint64_t have the same endianness. @@ -406,4 +413,8 @@ class Single { } // namespace double_conversion +// ICU PATCH: Close ICU namespace +U_NAMESPACE_END + #endif // DOUBLE_CONVERSION_DOUBLE_H_ +#endif // ICU PATCH: close #if !UCONFIG_NO_FORMATTING diff --git a/icu4c/source/i18n/double-conversion-utils.h b/icu4c/source/i18n/double-conversion-utils.h index 17a56832264..02795b4bc56 100644 --- a/icu4c/source/i18n/double-conversion-utils.h +++ b/icu4c/source/i18n/double-conversion-utils.h @@ -30,6 +30,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// ICU PATCH: ifdef around UCONFIG_NO_FORMATTING +#include "unicode/utypes.h" +#if !UCONFIG_NO_FORMATTING + #ifndef DOUBLE_CONVERSION_UTILS_H_ #define DOUBLE_CONVERSION_UTILS_H_ @@ -159,6 +163,9 @@ typedef uint16_t uc16; DISALLOW_COPY_AND_ASSIGN(TypeName) #endif +// ICU PATCH: Wrap in ICU namespace +U_NAMESPACE_BEGIN + namespace double_conversion { static const int kCharSize = sizeof(char); @@ -344,4 +351,8 @@ inline Dest BitCast(Source* source) { } // namespace double_conversion +// ICU PATCH: Close ICU namespace +U_NAMESPACE_END + #endif // DOUBLE_CONVERSION_UTILS_H_ +#endif // ICU PATCH: close #if !UCONFIG_NO_FORMATTING diff --git a/icu4c/source/i18n/double-conversion.cpp b/icu4c/source/i18n/double-conversion.cpp index 43e0262c856..8629284aa0e 100644 --- a/icu4c/source/i18n/double-conversion.cpp +++ b/icu4c/source/i18n/double-conversion.cpp @@ -30,6 +30,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// ICU PATCH: ifdef around UCONFIG_NO_FORMATTING +#include "unicode/utypes.h" +#if !UCONFIG_NO_FORMATTING + #include #include @@ -43,6 +47,9 @@ #include "double-conversion-ieee.h" #include "double-conversion-utils.h" +// ICU PATCH: Wrap in ICU namespace +U_NAMESPACE_BEGIN + namespace double_conversion { #if 0 // not needed for ICU @@ -992,3 +999,7 @@ float StringToDoubleConverter::StringToFloat( #endif // not needed for ICU } // namespace double_conversion + +// ICU PATCH: Close ICU namespace +U_NAMESPACE_END +#endif // ICU PATCH: close #if !UCONFIG_NO_FORMATTING diff --git a/icu4c/source/i18n/double-conversion.h b/icu4c/source/i18n/double-conversion.h index 388c5be450d..0939412734a 100644 --- a/icu4c/source/i18n/double-conversion.h +++ b/icu4c/source/i18n/double-conversion.h @@ -30,6 +30,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// ICU PATCH: ifdef around UCONFIG_NO_FORMATTING +#include "unicode/utypes.h" +#if !UCONFIG_NO_FORMATTING + #ifndef DOUBLE_CONVERSION_DOUBLE_CONVERSION_H_ #define DOUBLE_CONVERSION_DOUBLE_CONVERSION_H_ @@ -37,6 +41,9 @@ #include "double-conversion-utils.h" +// ICU PATCH: Wrap in ICU namespace +U_NAMESPACE_BEGIN + namespace double_conversion { class DoubleToStringConverter { @@ -552,4 +559,8 @@ class StringToDoubleConverter { } // namespace double_conversion +// ICU PATCH: Close ICU namespace +U_NAMESPACE_END + #endif // DOUBLE_CONVERSION_DOUBLE_CONVERSION_H_ +#endif // ICU PATCH: close #if !UCONFIG_NO_FORMATTING diff --git a/icu4c/source/i18n/number_decimalquantity.cpp b/icu4c/source/i18n/number_decimalquantity.cpp index e4203ad2ad3..b68df26ba26 100644 --- a/icu4c/source/i18n/number_decimalquantity.cpp +++ b/icu4c/source/i18n/number_decimalquantity.cpp @@ -21,7 +21,7 @@ using namespace icu; using namespace icu::number; using namespace icu::number::impl; -using double_conversion::DoubleToStringConverter; +using icu::double_conversion::DoubleToStringConverter; namespace {