Closed dkounal closed 9 months ago
i use Linux, so please test this: find
function TRegExpr.regNextQuick(p: PRegExprChar): PRegExprChar; {$IFDEF InlineFuncs}inline;{$ENDIF}
and remove trailing 'inline' with IFDEF. but keep 'inline' in the 'interface' part.
I did this and it works
function regNextQuick(p: PRegExprChar): PRegExprChar; in definition needs also not be inline
New fix made, must be OK now..
It is ok, but probably the delphi compiler is correct, see the description of the error: https://docwiki.embarcadero.com/RADStudio/Alexandria/en/E2441_Inline_function_declared_in_interface_section_must_not_use_local_symbol_%27%25s%27_(Delphi) The problem is that the following are declared in the implementation section for an inline function declared in the interface section TRENextOff = PtrInt; // internal Next "pointer" (offset to current p-code) PRENextOff = ^TRENextOff; // used for extracting Next "pointers" from compiled r.e.
Is it a problem for this declaration to be in the interface section?
then we need AlignToPtr
also in interface
part, which is worse.
Can we have the regNextQuick inside a class helper in the implementation section? I did it and the compiler does not produce error even it is inline
inside a class helper
class helper won't be compiled by old Delphi...
I think it is since Delphi 7 the class helper
but see here:
A feature of the Delphi language added some years ago (way back in in Delphi 2005) called "Class Helpers" is designed to let you add new functionality
https://www.thoughtco.com/understanding-delphi-class-and-record-helpers-1058281
You have right. Probably not inline for old Delphi and class helper for new versions through preprocessor commands?
no, making 2 versions of function is not good. better we will have smaller speed in Delphi (not much smaller).