diff --git a/src/core/mormot.core.unicode.pas b/src/core/mormot.core.unicode.pas index cd92b3ac9..fa9a05f1e 100644 --- a/src/core/mormot.core.unicode.pas +++ b/src/core/mormot.core.unicode.pas @@ -5753,6 +5753,7 @@ procedure LowerCaseSelf(var S: RawUtf8); Block: array[0..37, 0..127] of integer; IndexHi: array[0..271] of byte; IndexLo: array[0..8, 0..31] of byte; + // branchless Unicode 10.0 uppercase folding using our internal tables function Ucs4Upper(c: PtrUInt): PtrInt; {$ifdef HASINLINE} inline;{$endif} end; @@ -6043,9 +6044,18 @@ procedure LowerCaseSelf(var S: RawUtf8); 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12)); ); +function TUnicodeUpperTable.Ucs4Upper(c: PtrUInt): PtrInt; +var + i: PtrUInt; +begin + i := c shr UU_BLOCK_HI; + result := PtrInt(c) + Block[IndexLo[ + IndexHi[i shr UU_INDEX_HI], i and UU_INDEX_LO], c and UU_BLOCK_LO]; +end; + function Utf8UpperReference(S, D: PUtf8Char): PUtf8Char; var - c, i: PtrUInt; + c: PtrUInt; S2: PUtf8Char; {$ifdef CPUX86NOTPIC} tab: TUnicodeUpperTable absolute UU; @@ -6084,12 +6094,7 @@ function Utf8UpperReference(S, D: PUtf8Char): PUtf8Char; c := ord('?'); // PlaceHolder for invalid UTF-8 input end; if c <= UU_MAX then - begin - // branchless Unicode 10.0 case folding - i := c shr UU_BLOCK_HI; - c := PtrUInt(PtrInt(c) + tab.Block[tab.IndexLo[ - tab.IndexHi[i shr UU_INDEX_HI], i and UU_INDEX_LO], c and UU_BLOCK_LO]); - end; + c := tab.Ucs4Upper(c); inc(D, Ucs4ToUtf8(c, D)); until false; D^ := #0; @@ -6110,16 +6115,6 @@ function UpperCaseReference(const S: RawUtf8): RawUtf8; end; end; -// branchless Unicode 10.0 uppercase folding using our internal tables -function TUnicodeUpperTable.Ucs4Upper(c: PtrUInt): PtrInt; -var - i: PtrUInt; -begin - i := c shr UU_BLOCK_HI; - result := PtrInt(c) + Block[IndexLo[ - IndexHi[i shr UU_INDEX_HI], i and UU_INDEX_LO], c and UU_BLOCK_LO]; -end; - function Utf8ICompReference(u1, u2: PUtf8Char): PtrInt; var c2: PtrInt; diff --git a/src/db/mormot.db.raw.sqlite3.static.pas b/src/db/mormot.db.raw.sqlite3.static.pas index 5fbc62d68..c4fb71797 100644 --- a/src/db/mormot.db.raw.sqlite3.static.pas +++ b/src/db/mormot.db.raw.sqlite3.static.pas @@ -1142,11 +1142,11 @@ function sqlite3_trace_v2(DB: TSqlite3DB; Mask: integer; Callback: TSqlTraceCall const // error message if statically linked sqlite3.o(bj) does not match this - EXPECTED_SQLITE3_VERSION = {$ifdef ANDROID}''{$else}'3.34.0'{$endif}; + EXPECTED_SQLITE3_VERSION = '3.34.0'; // where to download the latest available static binaries, including SQLite3 - EXPECTED_STATIC_DOWNLOAD = 'https://github.com/synopse/mORMot2/releases/' + - 'download/pre1/mormot2static.7z'; + EXPECTED_STATIC_DOWNLOAD = + 'https://github.com/synopse/mORMot2/releases/tag/sqlite.' + EXPECTED_SQLITE3_VERSION; constructor TSqlite3LibraryStatic.Create; var