Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions Source/debug.info.reader.map.pas
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ interface
debug.info.log;

type

{$IF CompilerVersion < 35.0)}
TNoRefCountObject = class(TObject, IInterface)
protected
function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall;
function _AddRef: Integer; stdcall;
function _Release: Integer; stdcall;
end;
{$ENDIF}

IDebugInfoLineLogger = interface
['{1EA6E06A-0491-4BCF-BFA5-508BC88912BD}']
procedure Warning(const Msg: string); overload;
Expand Down Expand Up @@ -1050,6 +1060,27 @@ function TDebugInfoMapReader.FindRequiredMarker(const Marker, Str: string; Offse
Inc(Result, Length(Marker));
end;

{$IF CompilerVersion < 35.0)}
{ TNoRefCountObject }

function TNoRefCountObject.QueryInterface(const IID: TGUID; out Obj): HResult;
begin
if GetInterface(IID, Obj) then
Result := S_OK
else
Result := E_NOINTERFACE;
end;

function TNoRefCountObject._AddRef: Integer;
begin
Result := -1;
end;

function TNoRefCountObject._Release: Integer;
begin
Result := -1;
end;
{$ENDIF}

end.

8 changes: 8 additions & 0 deletions Source/debug.info.writer.pas
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,18 @@ implementation
// in order to avoid writing junk to the pdb file.
TSafeMemoryStream = class(TMemoryStream)
protected
{$IF CompilerVersion < 35.0)}
function Realloc(var NewCapacity: LongInt): Pointer; override;
{$ELSEIF CompilerVersion >= 35.0)}
function Realloc(var NewCapacity: NativeInt): Pointer; override;
{$ENDIF}
end;

{$IF CompilerVersion < 35.0)}
function TSafeMemoryStream.Realloc(var NewCapacity: LongInt): Pointer;
{$ELSEIF CompilerVersion >= 35.0)}
function TSafeMemoryStream.Realloc(var NewCapacity: NativeInt): Pointer;
{$ENDIF}
begin
Result := inherited Realloc(NewCapacity);

Expand Down