Skip to content
Permalink
Browse files

bypass XE4 Win64 linker bug by disallowing static SQLite3 for this ta…

…rget
  • Loading branch information
Arnaud Bouchez
Arnaud Bouchez committed Jan 27, 2020
1 parent 6260f37 commit bcb7f5fea3b3c4942337f3cbdeb853c64abc59ac
Showing with 20 additions and 15 deletions.
  1. +3 −3 SynCommons.pas
  2. +2 −2 SynSM.inc
  3. +7 −4 SynSelfTests.pas
  4. +7 −5 Synopse.inc
  5. +1 −1 SynopseCommit.inc
@@ -2995,7 +2995,7 @@ procedure TrimCopy(const S: RawUTF8; start,count: PtrInt;
out result: RawUTF8);

/// fast WinAnsi comparison using the NormToUpper[] array for all 8 bits values
function AnsiIComp(Str1, Str2: PWinAnsiChar): PtrInt;
function AnsiIComp(Str1, Str2: pointer): PtrInt;
{$ifdef PUREPASCAL} {$ifdef HASINLINE}inline;{$endif} {$endif}

/// extract a line from source array of chars


{$ifdef PUREPASCAL}
function AnsiIComp(Str1, Str2: PWinAnsiChar): PtrInt;
function AnsiIComp(Str1, Str2: pointer): PtrInt;
var C1,C2: byte; // integer/PtrInt are actually slower on FPC
lookupper: PByteArray; // better x86-64 / PIC asm generation
begin
result := -1; // Str1=''
end;
{$else}
function AnsiIComp(Str1, Str2: PWinAnsiChar): PtrInt;
function AnsiIComp(Str1, Str2: pointer): PtrInt;
asm // fast 8 bits WinAnsi comparison using the NormToUpper[] array
cmp eax, edx
je @2
@@ -1,10 +1,10 @@
{
This file is part of Synopse framework.

Synopse framework. Copyright (C) 2013 Arnaud Bouchez
Synopse framework. Copyright (C) 2020 Arnaud Bouchez
Synopse Informatique - https://synopse.info

Scripting support for mORMot Copyright (C) 2013 Pavel Mashlyakovsky
Scripting support for mORMot Copyright (C) 2020 Pavel Mashlyakovsky
pavel.mash at gmail.com

*** BEGIN LICENSE BLOCK *****
@@ -1599,10 +1599,13 @@ procedure TTestLowLevelCommon.FastStringCompare;
Check(StrComp(PAnsiChar('ABCD'),PAnsiChar('ABCD'))=0);
Check(StrComp(PAnsiChar('ABCD'),PAnsiChar('ABCE'))=-1);
Check(StrComp(PAnsiChar('ABCD'),PAnsiChar('ABCC'))=1);
Check(AnsiIComp('abcD','ABcd')=0);
Check(AnsiIComp('abcD','ABcF')=StrComp(PAnsiChar('ABCD'),PAnsiChar('ABCF')));
Check(StrIComp(PAnsiChar('abcD'),PAnsiChar('ABcd'))=AnsiIComp('abcD','ABcd'));
Check(StrIComp(PAnsiChar('abcD'),PAnsiChar('ABcF'))=AnsiIComp('ABCD','ABCF'));
Check(SynCommons.AnsiIComp(pointer(PAnsiChar('abcD')),pointer(PAnsiChar('ABcd')))=0);
Check(SynCommons.AnsiIComp(pointer(PAnsiChar('abcD')),pointer(PAnsiChar('ABcF')))=
StrComp(PAnsiChar('ABCD'),PAnsiChar('ABCF')));
Check(StrIComp(PAnsiChar('abcD'),PAnsiChar('ABcd'))=
SynCommons.AnsiIComp(PAnsiChar('abcD'),PAnsiChar('ABcd')));
Check(StrIComp(PAnsiChar('abcD'),PAnsiChar('ABcF'))=
SynCommons.AnsiIComp(PAnsiChar('ABCD'),PAnsiChar('ABCF')));
Check(strcspn(PAnsiChar('ab'),PAnsiChar('a'#0))=0);
Check(strcspn(PAnsiChar('ab'),PAnsiChar('b'#0))=1);
Check(strcspn(PAnsiChar('1234ab'),PAnsiChar('a'#0))=4);
@@ -1,7 +1,7 @@
{
This file is part of Synopse framework.

Synopse framework. Copyright (C) 2011 Arnaud Bouchez
Synopse framework. Copyright (C) 2020 Arnaud Bouchez
Synopse Informatique - https://synopse.info

*** BEGIN LICENSE BLOCK *****
@@ -655,10 +655,12 @@
{$define NOSQLITE3STATIC}
{$endif}
{$else}
// only Win32+Win64 are supported yet with Delphi anyway
{$ifndef MSWINDOWS}
{$define NOSQLITE3STATIC}
{$endif}
// there is a linking bug with Delphi XE4 on Win64
{$ifdef CPUX64}
{$ifdef ISDELPHIXE4}
{$define NOSQLITE3STATIC}
{$endif}
{$endif} // other Win32/Win64 Delphi platforms should work as expected
{$endif FPC}

{$ifdef NOSQLITE3STATIC}
@@ -1 +1 @@
'1.18.5397'
'1.18.5398'

0 comments on commit bcb7f5f

Please sign in to comment.
You can’t perform that action at this time.