aboutsummaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorRosen Penev <rosenp@gmail.com>2020-08-31 00:32:38 -0700
committerRosen Penev <rosenp@gmail.com>2020-08-31 00:39:04 -0700
commit6255a77128d0ea4e1aa1b24ef9fa06ba71072e2e (patch)
tree33547078604b51aa77f7a349b51ddccbdecd5051 /libs
parenta39066f057fb4bf543ea5223eba7321590e83795 (diff)
icu: fix compilation under CentOS 7
CentOS 7's GCC is quite old and does not put max_align_t under std. Signed-off-by: Rosen Penev <rosenp@gmail.com>
Diffstat (limited to 'libs')
-rw-r--r--libs/icu/Makefile2
-rw-r--r--libs/icu/patches/010-max_align_t.patch60
2 files changed, 61 insertions, 1 deletions
diff --git a/libs/icu/Makefile b/libs/icu/Makefile
index a215f66f3..3fd453de1 100644
--- a/libs/icu/Makefile
+++ b/libs/icu/Makefile
@@ -11,7 +11,7 @@ PKG_NAME:=icu4c
MAJOR_VERSION:=67
MINOR_VERSION:=1
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/010-max_align_t.patch b/libs/icu/patches/010-max_align_t.patch
new file mode 100644
index 000000000..3c0495184
--- /dev/null
+++ b/libs/icu/patches/010-max_align_t.patch
@@ -0,0 +1,60 @@
+--- a/common/uarrsort.cpp
++++ b/common/uarrsort.cpp
+@@ -37,7 +37,7 @@ enum {
+ };
+
+ static constexpr int32_t sizeInMaxAlignTs(int32_t sizeInBytes) {
+- return (sizeInBytes + sizeof(std::max_align_t) - 1) / sizeof(std::max_align_t);
++ return (sizeInBytes + sizeof(max_align_t) - 1) / sizeof(max_align_t);
+ }
+
+ /* UComparator convenience implementations ---------------------------------- */
+@@ -141,7 +141,7 @@ static void
+ insertionSort(char *array, int32_t length, int32_t itemSize,
+ UComparator *cmp, const void *context, UErrorCode *pErrorCode) {
+
+- icu::MaybeStackArray<std::max_align_t, sizeInMaxAlignTs(STACK_ITEM_SIZE)> v;
++ icu::MaybeStackArray<max_align_t, sizeInMaxAlignTs(STACK_ITEM_SIZE)> v;
+ if (sizeInMaxAlignTs(itemSize) > v.getCapacity() &&
+ v.resize(sizeInMaxAlignTs(itemSize)) == nullptr) {
+ *pErrorCode = U_MEMORY_ALLOCATION_ERROR;
+@@ -235,7 +235,7 @@ static void
+ quickSort(char *array, int32_t length, int32_t itemSize,
+ UComparator *cmp, const void *context, UErrorCode *pErrorCode) {
+ /* allocate two intermediate item variables (x and w) */
+- icu::MaybeStackArray<std::max_align_t, sizeInMaxAlignTs(STACK_ITEM_SIZE) * 2> xw;
++ icu::MaybeStackArray<max_align_t, sizeInMaxAlignTs(STACK_ITEM_SIZE) * 2> xw;
+ if(sizeInMaxAlignTs(itemSize)*2 > xw.getCapacity() &&
+ xw.resize(sizeInMaxAlignTs(itemSize) * 2) == nullptr) {
+ *pErrorCode=U_MEMORY_ALLOCATION_ERROR;
+--- a/common/utext.cpp
++++ b/common/utext.cpp
+@@ -569,7 +569,7 @@ enum {
+
+ struct ExtendedUText {
+ UText ut;
+- std::max_align_t extension;
++ max_align_t extension;
+ };
+
+ static const UText emptyText = UTEXT_INITIALIZER;
+@@ -584,7 +584,7 @@ utext_setup(UText *ut, int32_t extraSpace, UErrorCode *status) {
+ // We need to heap-allocate storage for the new UText
+ int32_t spaceRequired = sizeof(UText);
+ if (extraSpace > 0) {
+- spaceRequired = sizeof(ExtendedUText) + extraSpace - sizeof(std::max_align_t);
++ spaceRequired = sizeof(ExtendedUText) + extraSpace - sizeof(max_align_t);
+ }
+ ut = (UText *)uprv_malloc(spaceRequired);
+ if (ut == NULL) {
+--- a/tools/toolutil/toolutil.cpp
++++ b/tools/toolutil/toolutil.cpp
+@@ -245,7 +245,7 @@ struct UToolMemory {
+ char name[64];
+ int32_t capacity, maxCapacity, size, idx;
+ void *array;
+- alignas(std::max_align_t) char staticArray[1];
++ alignas(max_align_t) char staticArray[1];
+ };
+
+ U_CAPI UToolMemory * U_EXPORT2