diff --git a/Source/uPSR_classes.pas b/Source/uPSR_classes.pas index 2e17d9d..f46f070 100644 --- a/Source/uPSR_classes.pas +++ b/Source/uPSR_classes.pas @@ -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');