icu: Fix compilation with uClibc-ng 8868/head
authorRosen Penev <rosenp@gmail.com>
Wed, 1 May 2019 19:35:37 +0000 (12:35 -0700)
committerRosen Penev <rosenp@gmail.com>
Wed, 1 May 2019 19:50:30 +0000 (12:50 -0700)
uClibc-ng does not define these math functions in math.h , only in
tgmath.h. Therefore the cmath header will not work.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
libs/icu/Makefile
libs/icu/patches/020-uClibc-ng.patch [new file with mode: 0644]

index 9b2d20b72748cab471fa400e599a4a35a05014a9..e7ca37bf54c1ee680abf32a43c7bbc52bcfe1c0f 100644 (file)
@@ -11,7 +11,7 @@ PKG_NAME:=icu4c
 MAJOR_VERSION:=64
 MINOR_VERSION:=2
 PKG_VERSION:=$(MAJOR_VERSION).$(MINOR_VERSION)
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(MAJOR_VERSION)_$(MINOR_VERSION)-src.tgz
 PKG_SOURCE_URL:=https://github.com/unicode-org/icu/releases/download/release-$(MAJOR_VERSION)-$(MINOR_VERSION)
diff --git a/libs/icu/patches/020-uClibc-ng.patch b/libs/icu/patches/020-uClibc-ng.patch
new file mode 100644 (file)
index 0000000..2d2a3e7
--- /dev/null
@@ -0,0 +1,22 @@
+--- a/i18n/decimfmt.cpp
++++ b/i18n/decimfmt.cpp
+@@ -1812,7 +1812,7 @@ bool DecimalFormat::fastFormatDouble(double input, UnicodeString& output) const
+         return false;
+     }
+     if (std::isnan(input)
+-            || std::trunc(input) != input
++            || trunc(input) != input
+             || input <= INT32_MIN
+             || input > INT32_MAX) {
+         return false;
+--- a/i18n/number_decimalquantity.cpp
++++ b/i18n/number_decimalquantity.cpp
+@@ -446,7 +446,7 @@ void DecimalQuantity::_setToDoubleFast(double n) {
+         for (; i <= -22; i += 22) n /= 1e22;
+         n /= DOUBLE_MULTIPLIERS[-i];
+     }
+-    auto result = static_cast<int64_t>(std::round(n));
++    auto result = static_cast<int64_t>(round(n));
+     if (result != 0) {
+         _setToLong(result);
+         scale -= fracLength;