This commit is contained in:
Martijn Laan 2024-06-28 10:20:10 +02:00
parent 0d585814ef
commit c6b25ca427

View File

@ -624,15 +624,12 @@ procedure RIRegisterTSTREAM(Cl: TPSRuntimeClassImporter);
begin
with Cl.Add(TSTREAM) do
begin
{$IFNDEF DELPHI_SYDNEY_UP}
{ uPSC_Classes doesn't turn on IsAbstract on Sydney and newer but here we
still use RegisterVirtualAbstractMethod because with RegisterVirtualMethod
it picks the wrong overload, at least for Seek }
RegisterVirtualAbstractMethod(TMemoryStream, @TMemoryStream.READ, 'Read');
RegisterVirtualAbstractMethod(TMemoryStream, @TMemoryStream.WRITE, 'Write');
RegisterVirtualAbstractMethod(TMemoryStream, @TMemoryStream.SEEK, 'Seek');
{$ELSE}
RegisterVirtualMethod(@TStream.READ, 'Read');
RegisterVirtualMethod(@TStream.WRITE, 'Write');
RegisterVirtualMethod(@TStream.SEEK, 'Seek');
{$ENDIF}
RegisterMethod(@TSTREAM.READBUFFER, 'ReadBuffer');
RegisterMethod(@TSTREAM.WRITEBUFFER, 'WriteBuffer');
RegisterMethod(@TSTREAM.COPYFROM, 'CopyFrom');