| 1 |
{$modeswitch advancedrecords} |
| 2 |
|
| 3 |
{ If GENERICS_CONSTREF is defined, then various routines used with Generics.Collections |
| 4 |
(like callbacks we pass to TComparer, or OnNotify callback or Notify virtual method) |
| 5 |
should have "constref" parameter, not "const". |
| 6 |
This was the case of FPC<= 3.2.0, FPC changed it in |
| 7 |
https://gitlab.com/freepascal.org/fpc/source/-/commit/693491048bf2c6f9122a0d8b044ad0e55382354d } |
| 8 |
{$ifdef VER3_0} {$define GENERICS_CONSTREF} {$endif} |
| 9 |
{$ifdef VER3_2} {$define GENERICS_CONSTREF} {$endif} |
| 10 |
{$if defined(VER3_2_3)} |
| 11 |
{ FPC 3.2.3 (fixes_3_2 branch, as of 2023-12-23) no longer uses "constref". |
| 12 |
Confirmed on Linux/Arm32, Linux/Arm64(Aarch64), Linux/x86_64, |
| 13 |
see also sources: |
| 14 |
https://gitlab.com/freepascal.org/fpc/source/-/blob/fixes_3_2/packages/rtl-generics/src/generics.collections.pas?ref_type=heads. } |
| 15 |
{$undef GENERICS_CONSTREF} |
| 16 |
{$endif} |