Skip to content

Upgrade to ICU 74 #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ See the following version matrix:
| `FoundationICU` version | `ICU` version |
| --- | --- |
| `0.0.2` and below | `70.1` |
| `0.0.3` and above | `72.1` |
| `0.0.3` ~ `0.0.9` | `72.1` |
| `0.0.10` and above | `74.0` |


## Adding FoundationICU as a Dependency
Expand Down
7 changes: 4 additions & 3 deletions icuSources/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
##===----------------------------------------------------------------------===##

target_include_directories(_FoundationICU PRIVATE .)

target_sources(_FoundationICU
PRIVATE
aaplbfct.cpp
Expand All @@ -31,7 +30,6 @@ target_sources(_FoundationICU
chariter.cpp
charstr.cpp
cmemory.cpp
cpputils.h
cstr.cpp
cstring.cpp
cwchar.cpp
Expand All @@ -43,9 +41,9 @@ target_sources(_FoundationICU
errorcode.cpp
filteredbrk.cpp
filterednormalizer2.cpp
icu_packaged_data.cpp
icudataver.cpp
icuplug.cpp
icu_packaged_data.cpp
loadednormalizer2impl.cpp
localebuilder.cpp
localematcher.cpp
Expand All @@ -65,6 +63,7 @@ target_sources(_FoundationICU
lsr.cpp
lstmbe.cpp
messagepattern.cpp
mlbe.cpp
normalizer2.cpp
normalizer2impl.cpp
normlzr.cpp
Expand Down Expand Up @@ -169,6 +168,8 @@ target_sources(_FoundationICU
uloc.cpp
uloc_keytype.cpp
uloc_tag.cpp
ulocale.cpp
ulocbuilder.cpp
ulocdata.cpp
umapfile.cpp
umath.cpp
Expand Down
14 changes: 7 additions & 7 deletions icuSources/common/appendable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,23 @@ Appendable::~Appendable() {}
UBool
Appendable::appendCodePoint(UChar32 c) {
if(c<=0xffff) {
return appendCodeUnit((UChar)c);
return appendCodeUnit((char16_t)c);
} else {
return appendCodeUnit(U16_LEAD(c)) && appendCodeUnit(U16_TRAIL(c));
}
}

UBool
Appendable::appendString(const UChar *s, int32_t length) {
Appendable::appendString(const char16_t *s, int32_t length) {
if(length<0) {
UChar c;
char16_t c;
while((c=*s++)!=0) {
if(!appendCodeUnit(c)) {
return false;
}
}
} else if(length>0) {
const UChar *limit=s+length;
const char16_t *limit=s+length;
do {
if(!appendCodeUnit(*s++)) {
return false;
Expand All @@ -56,14 +56,14 @@ Appendable::reserveAppendCapacity(int32_t /*appendCapacity*/) {
return true;
}

UChar *
char16_t *
Appendable::getAppendBuffer(int32_t minCapacity,
int32_t /*desiredCapacityHint*/,
UChar *scratch, int32_t scratchCapacity,
char16_t *scratch, int32_t scratchCapacity,
int32_t *resultCapacity) {
if(minCapacity<1 || scratchCapacity<minCapacity) {
*resultCapacity=0;
return NULL;
return nullptr;
}
*resultCapacity=scratchCapacity;
return scratch;
Expand Down
12 changes: 6 additions & 6 deletions icuSources/common/bmpset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,9 @@ BMPSet::contains(UChar32 c) const {
* Check for sufficient length for trail unit for each surrogate pair.
* Handle single surrogates as surrogate code points as usual in ICU.
*/
const UChar *
BMPSet::span(const UChar *s, const UChar *limit, USetSpanCondition spanCondition) const {
UChar c, c2;
const char16_t *
BMPSet::span(const char16_t *s, const char16_t *limit, USetSpanCondition spanCondition) const {
char16_t c, c2;

if(spanCondition) {
// span
Expand Down Expand Up @@ -408,9 +408,9 @@ BMPSet::span(const UChar *s, const UChar *limit, USetSpanCondition spanCondition
}

/* Symmetrical with span(). */
const UChar *
BMPSet::spanBack(const UChar *s, const UChar *limit, USetSpanCondition spanCondition) const {
UChar c, c2;
const char16_t *
BMPSet::spanBack(const char16_t *s, const char16_t *limit, USetSpanCondition spanCondition) const {
char16_t c, c2;

if(spanCondition) {
// span
Expand Down
4 changes: 2 additions & 2 deletions icuSources/common/bmpset.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ class BMPSet : public UMemory {
* It must be s<limit and spanCondition==0 or 1.
* @return The string pointer which limits the span.
*/
const UChar *span(const UChar *s, const UChar *limit, USetSpanCondition spanCondition) const;
const char16_t *span(const char16_t *s, const char16_t *limit, USetSpanCondition spanCondition) const;

/*
* Span the trailing substring for which each character c has spanCondition==contains(c).
* It must be s<limit and spanCondition==0 or 1.
* @return The string pointer which starts the span.
*/
const UChar *spanBack(const UChar *s, const UChar *limit, USetSpanCondition spanCondition) const;
const char16_t *spanBack(const char16_t *s, const char16_t *limit, USetSpanCondition spanCondition) const;

/*
* Span the initial substring for which each character c has spanCondition==contains(c).
Expand Down
Loading