#1 2026-07-16 19:50:44

Mobius1
Member
Registered: 2023-08-16
Posts: 14

issue with string versioning and compiler directive

hi folks,

I'm having a little issue trying to detect faithfully the mORMot2 version via compiler directive, before commit 2.4.15007 the KeepAlive property of THttpClientSocket behave in one way, after that it behaves differently, so for our framework to work properly I need to properly detect mORMot2 version and handle the change in the code, but the directive below doesn't work:

    {$IF SYNOPSE_FRAMEWORK_VERSION < '2.4.15007'}
    vHttp.KeepAlive := Parent.KeepAlive;
    {$IFEND} 

I'm currently in the latest master of mORMot2 on Lazarus with FPC 3.2.3 (fixes branch) and the code inside that block is being compiled, where it shouldn't.

Any ideas on how I could handle that? The dumb machines (AI) have no clue

Offline

#2 2026-07-17 07:04:19

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 15,599
Website

Re: issue with string versioning and compiler directive

Yes, currently it is not feasible...
Did you try $if declared() with some other definition close to this commit?

I don't remember the THttpClientSocket.KeepAlive change. What was it?

Anyway, I have added a new SYNOPSE_FRAMEWORK_COMMIT constant value in mormot.core.base:
https://github.com/synopse/mORMot2/commit/18bddf98eb

Offline

#3 2026-08-20 20:47:15

Mobius1
Member
Registered: 2023-08-16
Posts: 14

Re: issue with string versioning and compiler directive

sorry for late response, the KeepAlive property was a boolean flag before the keepalive time, in commit 15007 the boolean property was removed and only the timer was necessary.

yes, I tried the $IF Declared but wasn't successful with it, we will have to handle master as 2.5 or something like that for now, but thanks for the version update, will help a lot in the future

sorry for the late reply

Offline

Board footer

Powered by FluxBB