Skip to content

Commit 6038788

Browse files
committed
Restored FPC compatibility.
1 parent 2d96639 commit 6038788

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

Source/PythonEngine.pas

+4
Original file line numberDiff line numberDiff line change
@@ -2790,7 +2790,11 @@ implementation
27902790
{$ENDIF}
27912791
{$IFDEF MSWINDOWS}
27922792
Registry,
2793+
{$IFDEF FPC}
2794+
JwaPsApi,
2795+
{$ELSE}
27932796
PsAPI,
2797+
{$ENDIF}
27942798
{$ENDIF}
27952799
Math;
27962800

Source/WrapDelphiClasses.pas

+10-2
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,10 @@ TPyDelphiComponent = class (TPyDelphiPersistent)
107107
function CreateComponent(AOwner : TComponent) : TComponent; virtual;
108108
procedure SubscribeToFreeNotification; override;
109109
procedure UnSubscribeToFreeNotification; override;
110+
{$IFNDEF FPC}
110111
function InternalReadComponent(const AResFile: string;
111112
const AInstance: TComponent): boolean; virtual;
113+
{$ENDIF}
112114
// Exposed Methods
113115
function GetParentComponent_Wrapper(args : PPyObject) : PPyObject; cdecl;
114116
function HasParent_Wrapper(args : PPyObject) : PPyObject; cdecl;
@@ -244,8 +246,9 @@ TPyDelphiBasicAction = class (TPyDelphiComponent)
244246
implementation
245247

246248
uses
247-
TypInfo, System.IOUtils, System.Rtti;
249+
TypInfo {$IFNDEF FPC}, System.Rtti{$ENDIF};
248250

251+
{$IFNDEF FPC}
249252
type
250253
TPyReader = class(TReader)
251254
private
@@ -258,6 +261,7 @@ TPyReader = class(TReader)
258261
public
259262
constructor Create(APyObject: TPyDelphiObject; Stream: TStream; BufSize: Integer);
260263
end;
264+
{$ENDIF}
261265

262266
{ Register the wrappers, the globals and the constants }
263267
type
@@ -892,6 +896,7 @@ function TPyDelphiComponent.HasParent_Wrapper(args: PPyObject): PPyObject;
892896
end;
893897
end;
894898

899+
{$IFNDEF FPC}
895900
function TPyDelphiComponent.InternalReadComponent(const AResFile: string;
896901
const AInstance: TComponent): boolean;
897902

@@ -930,7 +935,7 @@ function TPyDelphiComponent.InternalReadComponent(const AResFile: string;
930935
LInput: TFileStream;
931936
LOutput: TMemoryStream;
932937
begin
933-
if AResFile.IsEmpty or not TFile.Exists(AResFile) then
938+
if AResFile.IsEmpty or not FileExists(AResFile) then
934939
Exit(false);
935940

936941
LInput := TFileStream.Create(AResFile, fmOpenRead);
@@ -956,6 +961,7 @@ function TPyDelphiComponent.InternalReadComponent(const AResFile: string;
956961
end;
957962
Result := true;
958963
end;
964+
{$ENDIF}
959965

960966
function TPyDelphiComponent.GetAttrO(key: PPyObject): PPyObject;
961967
Var
@@ -1655,6 +1661,7 @@ function TPyDelphiStrings.Set_Text(AValue: PPyObject;
16551661
end;
16561662
end;
16571663

1664+
{$IFNDEF FPC}
16581665
{ TPyReader }
16591666

16601667
constructor TPyReader.Create(APyObject: TPyDelphiObject; Stream: TStream;
@@ -1750,6 +1757,7 @@ procedure TPyReader.SetName(Component: TComponent; var Name: string);
17501757
end;
17511758
FInstance := Component;
17521759
end;
1760+
{$ENDIF}
17531761

17541762
initialization
17551763
RegisteredUnits.Add(TClassesRegistration.Create);

0 commit comments

Comments
 (0)