Skip to content

Commit d8bee8b

Browse files
committed
3ds, Wii, Wiiu: Fix ICU 75 build
1 parent 1a036a5 commit d8bee8b

File tree

7 files changed

+54
-28
lines changed

7 files changed

+54
-28
lines changed

3ds/2_build_toolchain.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@ if [ ! -f .patches-applied ]; then
5252
# Fix tremor
5353
patch -d $TREMOR_DIR -Np1 < $SCRIPT_DIR/tremor-fix-types.patch
5454

55-
# Fix opus (remove when next version is out)
56-
patch -d $OPUS_DIR -Np1 < $SCRIPT_DIR/opus-fix-types.patch
57-
5855
# Fix opusfile
5956
patch -d $OPUSFILE_DIR -Np1 < $SCRIPT_DIR/../shared/extra/opusfile-devkit.patch
6057

3ds/icu-3ds.patch

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,3 +303,23 @@
303303
return countOfItemsToEvict;
304304
}
305305

306+
--- icu-native/source/i18n/persncal.cpp 2024-08-26 18:45:32.573623303 +0200
307+
+++ icu/source/i18n/persncal.cpp 2024-08-26 18:45:43.337048627 +0200
308+
@@ -179,7 +179,7 @@
309+
}
310+
}
311+
312+
- int64_t julianDay = PERSIAN_EPOCH - 1LL + 365LL * (eyear - 1LL) + ClockMath::floorDivide(8LL * eyear + 21, 33);
313+
+ int64_t julianDay = PERSIAN_EPOCH - 1LL + 365LL * (eyear - 1LL) + ClockMath::floorDivide(8 * eyear + 21, 33);
314+
315+
if (month != 0) {
316+
julianDay += kPersianNumDays[month];
317+
@@ -225,7 +225,7 @@
318+
return;
319+
}
320+
321+
- int64_t farvardin1 = 365LL * (year - 1) + ClockMath::floorDivide(8LL * year + 21, 33);
322+
+ int64_t farvardin1 = 365LL * (year - 1) + ClockMath::floorDivide((int32_t)(8 * year + 21), 33);
323+
int32_t dayOfYear = daysSinceEpoch - farvardin1; // 0-based
324+
U_ASSERT(dayOfYear >= 0);
325+
U_ASSERT(dayOfYear < 366);

3ds/opus-fix-types.patch

Lines changed: 0 additions & 25 deletions
This file was deleted.

wii/2_build_toolchain.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ if [ ! -f .patches-applied ]; then
5252
patch -Np0 < icu-pkg_genc.patch
5353
# Patch mutex support in
5454
patch -Np0 < icu-wii-mutex.patch
55+
# Fix building data file without assembly
56+
patch -Np0 < icu-data-char16.patch
5557

5658
touch .patches-applied
5759
fi

wii/icu-data-char16.patch

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
diff -Naur icu-orig/source/common/unicode/ptypes.h icu/source/common/unicode/ptypes.h
2+
--- icu-orig/source/common/unicode/ptypes.h 2024-08-26 18:27:25.490986142 +0200
3+
+++ icu/source/common/unicode/ptypes.h 2024-08-26 18:27:44.527820067 +0200
4+
@@ -56,11 +56,7 @@
5+
// implementations (looking at you, Apple, spring 2024) actually do this, so
6+
// ICU4C must detect and deal with that.
7+
#if !defined(__cplusplus) && !defined(U_IN_DOXYGEN)
8+
-# if U_HAVE_CHAR16_T
9+
-# include <uchar.h>
10+
-# else
11+
typedef uint16_t char16_t;
12+
-# endif
13+
#endif
14+
15+
#endif /* _PTYPES_H */

wiiu/2_build_toolchain.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ if [ ! -f .patches-applied ]; then
4646
perl -pi -e 's|#ifndef U_DISABLE_OBJ_CODE.*|#if 0 // U_DISABLE_OBJ_CODE|' icu/source/tools/toolutil/pkg_genc.h
4747
# Emit correct bigendian icudata header
4848
patch -Np0 < icu-pkg_genc.patch
49+
# Fix building data file without assembly
50+
patch -Np0 < icu-data-char16.patch
4951

5052
touch .patches-applied
5153
fi

wiiu/icu-data-char16.patch

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
diff -Naur icu-orig/source/common/unicode/ptypes.h icu/source/common/unicode/ptypes.h
2+
--- icu-orig/source/common/unicode/ptypes.h 2024-08-26 18:27:25.490986142 +0200
3+
+++ icu/source/common/unicode/ptypes.h 2024-08-26 18:27:44.527820067 +0200
4+
@@ -56,11 +56,7 @@
5+
// implementations (looking at you, Apple, spring 2024) actually do this, so
6+
// ICU4C must detect and deal with that.
7+
#if !defined(__cplusplus) && !defined(U_IN_DOXYGEN)
8+
-# if U_HAVE_CHAR16_T
9+
-# include <uchar.h>
10+
-# else
11+
typedef uint16_t char16_t;
12+
-# endif
13+
#endif
14+
15+
#endif /* _PTYPES_H */

0 commit comments

Comments
 (0)