#1 2023-08-30 07:37:10

cadnan
Member
From: Sweden
Registered: 2020-09-22
Posts: 9

Delphi 12 and mORMot 2

In case it is of interest to someone:

Software version tested: 2.1.5802 (2023-08-30 09:00:57)

Windows 10 64bit (10.0.19045) [WinAnsi 15.8GB 4A651701]
    4 x Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz 4MB cache (x86)
    on LENOVO 20J4000XMX ThinkPad L470
Using mORMot 2.1.5802
    TSqlite3LibraryStatic 3.42.0 with internal MM
Generated with: Delphi 12 Next 32 bit Win compiler

Time elapsed for all tests: 4m04

Total assertions failed for all test suits:  0 / 77,927,545
! All tests passed successfully.
Software version tested: 2.1.5802 (2023-08-30 09:16:02)

Windows 10 64bit (10.0.19045) [WinAnsi 15.8GB 4A651701]
    4 x Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz 4MB cache (x64)
    on LENOVO 20J4000XMX ThinkPad L470
Using mORMot 2.1.5802
    TSqlite3LibraryStatic 3.42.0 with internal MM
Generated with: Delphi 12 Next 64 bit Win compiler

Time elapsed for all tests: 4m21

Total assertions failed for all test suits:  0 / 77,892,415
! All tests passed successfully.

In order to compile mormot2tests I had to make a minor change in the mormot.net.sock.pas file on lines 4699 and 4721, changing:

Handle := {$ifdef FPC}THandle{$endif}(-1);

to

Handle := {$ifdef FPC}THandle{$endif}(0);

The original code raise the following error:

[dcc64 Error] mormot.net.sock.pas(4699): E1012 Constant expression violates subrange bounds

Not sure if my "fix" is the best one, but "it works"™


Thanks for making mORMOt a "future-proof" framework.

Offline

#2 2023-08-30 08:42:16

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,273
Website

Re: Delphi 12 and mORMot 2

Very good news.
Happy to see we were prepared enough, and also that there is no regression in the compiler!
Is it OK also with Win64?

For the compilation error, please try https://github.com/synopse/mORMot2/commit/592d684b
Out of curiosity, how is the THandle type defined in this version of Delphi?

Offline

#3 2023-08-30 09:52:32

cadnan
Member
From: Sweden
Registered: 2020-09-22
Posts: 9

Re: Delphi 12 and mORMot 2

Works for both Win32 and Win64.

THandle is defined as following in System.pas

THandle = NativeUInt;

which I guess explains the problem with -1 as an initial value.

Offline

#4 2023-08-30 10:48:06

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,273
Website

Re: Delphi 12 and mORMot 2

Yes, this is clearly the root reason.

I have just written https://github.com/synopse/mORMot2/commit/fca9a7c9
Which seems like a cleaner cross-platform approach.

Edit: the Delphi compiler did not like it either...
Seems good back with https://github.com/synopse/mORMot2/commit/dc2594a9

Offline

Board footer

Powered by FluxBB