You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
2.5 KiB

  1. --- a/common/uarrsort.cpp
  2. +++ b/common/uarrsort.cpp
  3. @@ -37,7 +37,7 @@ enum {
  4. };
  5. static constexpr int32_t sizeInMaxAlignTs(int32_t sizeInBytes) {
  6. - return (sizeInBytes + sizeof(std::max_align_t) - 1) / sizeof(std::max_align_t);
  7. + return (sizeInBytes + sizeof(max_align_t) - 1) / sizeof(max_align_t);
  8. }
  9. /* UComparator convenience implementations ---------------------------------- */
  10. @@ -141,7 +141,7 @@ static void
  11. insertionSort(char *array, int32_t length, int32_t itemSize,
  12. UComparator *cmp, const void *context, UErrorCode *pErrorCode) {
  13. - icu::MaybeStackArray<std::max_align_t, sizeInMaxAlignTs(STACK_ITEM_SIZE)> v;
  14. + icu::MaybeStackArray<max_align_t, sizeInMaxAlignTs(STACK_ITEM_SIZE)> v;
  15. if (sizeInMaxAlignTs(itemSize) > v.getCapacity() &&
  16. v.resize(sizeInMaxAlignTs(itemSize)) == nullptr) {
  17. *pErrorCode = U_MEMORY_ALLOCATION_ERROR;
  18. @@ -235,7 +235,7 @@ static void
  19. quickSort(char *array, int32_t length, int32_t itemSize,
  20. UComparator *cmp, const void *context, UErrorCode *pErrorCode) {
  21. /* allocate two intermediate item variables (x and w) */
  22. - icu::MaybeStackArray<std::max_align_t, sizeInMaxAlignTs(STACK_ITEM_SIZE) * 2> xw;
  23. + icu::MaybeStackArray<max_align_t, sizeInMaxAlignTs(STACK_ITEM_SIZE) * 2> xw;
  24. if(sizeInMaxAlignTs(itemSize)*2 > xw.getCapacity() &&
  25. xw.resize(sizeInMaxAlignTs(itemSize) * 2) == nullptr) {
  26. *pErrorCode=U_MEMORY_ALLOCATION_ERROR;
  27. --- a/common/utext.cpp
  28. +++ b/common/utext.cpp
  29. @@ -569,7 +569,7 @@ enum {
  30. struct ExtendedUText {
  31. UText ut;
  32. - std::max_align_t extension;
  33. + max_align_t extension;
  34. };
  35. static const UText emptyText = UTEXT_INITIALIZER;
  36. @@ -584,7 +584,7 @@ utext_setup(UText *ut, int32_t extraSpac
  37. // We need to heap-allocate storage for the new UText
  38. int32_t spaceRequired = sizeof(UText);
  39. if (extraSpace > 0) {
  40. - spaceRequired = sizeof(ExtendedUText) + extraSpace - sizeof(std::max_align_t);
  41. + spaceRequired = sizeof(ExtendedUText) + extraSpace - sizeof(max_align_t);
  42. }
  43. ut = (UText *)uprv_malloc(spaceRequired);
  44. if (ut == NULL) {
  45. --- a/tools/toolutil/toolutil.cpp
  46. +++ b/tools/toolutil/toolutil.cpp
  47. @@ -242,7 +242,7 @@ struct UToolMemory {
  48. char name[64];
  49. int32_t capacity, maxCapacity, size, idx;
  50. void *array;
  51. - alignas(std::max_align_t) char staticArray[1];
  52. + alignas(max_align_t) char staticArray[1];
  53. };
  54. U_CAPI UToolMemory * U_EXPORT2