neslib / Neslib.Yaml

A YAML library for Delphi
Other
85 stars 18 forks source link

Neslib.yaml not working with Delphi 10 Seattle Version 23.0.21418.4207 #3

Closed manish-mishra-avalara closed 1 year ago

manish-mishra-avalara commented 1 year ago

Hello, I have Delphi 10 Seattle Version 23.0.21418.4207 installed on my machine. When I try to use Neslib.Yaml library, I get an error as below:

When I looked in my System. pas and I have got below Alias:

{ Internal Aliases } {$IFDEF NEXTGEN} _ShortStr = _ShortString; _AnsiStr = _AnsiString; _AnsiChr = _AnsiChar; _WideStr = _WideString; _PAnsiChr = _PAnsiChar; {$ELSE} _ShortStr = ShortString; _AnsiStr = AnsiString; _AnsiChr = AnsiChar; _WideStr = WideString; _PAnsiChr = PAnsiChar; {$ENDIF}

neslib commented 1 year ago

Hi @manish-mishra-avalara . I don't have an old Delphi version so I cannot test this. However, I'm willing to add a fix for this, but before I do that, I need to now if fixing this issue doesn't result in other issues because of the older Delphi version.

Could you add the following declarations to the top of the Neslib.Utf8 file and check if it still compiles and runs:

type
  UTF8Char = AnsiChar;
  PUTF8Char = PAnsiChar;

If that solves it, then I'll make the fix.

Thank you

manish-mishra-avalara commented 1 year ago

Hello Erik,

Thank you for your quick reply. Defining the type on top of the Neslib.Utf8 helps remove undeclared identifier errors but now I am getting the below error:

[dcc32 Error] Neslib.System.pas(126): E2086 Type 'TRefCounted' is not yet completely defined

neslib commented 1 year ago

Hi @manish-mishra-avalara ,

I was afraid of this. And fixing that issue may expose other backwards compatibility issues. Since I'm not a professional component vendor, I focus only on the latest Delphi versions and don't want to spend time supporting old versions. That would require me to have several Delphi versions installed, and test it on those versions, and that is something I don't really want to do.

But you can probably make the library work for you if you remove any stuff that doesn't compile, and maybe make some manual changes like the UTF8Char issue.