Recent

Author Topic: Two odd errors in Indy (32/64bit typecast and PRawByteString not found)  (Read 1137 times)

MISV

  • Hero Member
  • *****
  • Posts: 783
After having update to Catalina + newest Cocoa source, I updated Indy and encounter some errors in IdGlobal.pas ... However, not sure where fault lies...

Quote
IdGlobal.pas(4607,57) Error: Typecast has different size (4 -> 8 ) in assignment
at
 
Code: Pascal  [Select][+][-]
  1.    {$IFDEF THANDLE_64}
  2.   Result := THandle(InterlockedExchange64(Int64(VTarget), Int64(AValue)));
  3.     {$ENDIF}    

and two of the

Quote
IdGlobal.pas(8523,17) Error: Identifier not found "PRawByteString"
at
 
Code: Pascal  [Select][+][-]
  1. SetCodePage(PRawByteString(@Result)^, GetEncodingCodePage(ADestEncoding), False);

...

When I run "svn up" on my fprsrc directory it says 43661

Inside Lazarus about dialog I have IDE version 2.1.0, FPC 3.0.4, SVN revision 61470M

...

However, what is puzzling that searching on the net it seems *PRawByteString* should be defined in FPC system, unit? So somehow my FPC source is possibly outdated?
« Last Edit: December 08, 2019, 11:06:18 pm by MISV »

MISV

  • Hero Member
  • *****
  • Posts: 783
Re: Two odd errors in Indy (32/64bit typecast and PRawByteString not found)
« Reply #1 on: December 09, 2019, 02:38:08 am »
I was in doubt whee to post this, but I am moving this back to Mac OS / Catalina message thread: https://forum.lazarus.freepascal.org/index.php/topic,47635.0.html

I will appreciate help with this

jamie

  • Hero Member
  • *****
  • Posts: 6090
Re: Two odd errors in Indy (32/64bit typecast and PRawByteString not found)
« Reply #2 on: December 09, 2019, 02:49:14 am »
This compiles for me

Code: Pascal  [Select][+][-]
  1.  SetCodePage(RawByteString(Result), GetEncodingCodePage(ADestEncoding), False);
  2.  
The only true wisdom is knowing you know nothing

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: Two odd errors in Indy (32/64bit typecast and PRawByteString not found)
« Reply #3 on: December 09, 2019, 10:05:21 am »
The pointer trick might be to avoid a conversion. If there is a conversion, only the codepage on the created TEMP string is changed not the result.

So to check Jamie's mod you really need to check the codepage of the result string .

MISV

  • Hero Member
  • *****
  • Posts: 783
Re: Two odd errors in Indy (32/64bit typecast and PRawByteString not found)
« Reply #4 on: December 09, 2019, 12:00:52 pm »
The other issue is odd as well.

It is the same code as always, so I think it is the define controlling if THandle is 64bit or not that makes the difference.

I found older posts stating THandle is 32bit in Lazarus even on 64bit... But Indy define THandle_64 seems to be true and thus now the code errors.

 

TinyPortal © 2005-2018