Skip to content

Commit fa612ee

Browse files
authored
Merge branch 'pyscripter:master' into master
2 parents 0b841db + e77cf44 commit fa612ee

File tree

2 files changed

+30
-11
lines changed

2 files changed

+30
-11
lines changed

Source/Definition.Inc

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -204,22 +204,43 @@
204204

205205
{$IFDEF FPC}
206206
{$MODE DELPHI}
207+
207208
{$IFDEF CPU64}
208209
{$DEFINE CPU64BITS}
209210
{$ENDIF CPU64}
210-
{$IFDEF CPU386}
211+
212+
{$IFDEF CPU86}
211213
{$DEFINE CPUX86}
212-
{$ENDIF CPU32}
214+
{$ENDIF CPU86}
215+
213216
{$IFDEF DARWIN}
217+
{$DEFINE OSX}
214218
{$DEFINE MACOS}
215-
{$DEFINE ALIGN_STACK}
216219
{$IFDEF CPU32}
217220
{$DEFINE MACOS32}
218221
{$ENDIF CPU32}
222+
{$IFDEF CPU64}
223+
{$DEFINE MACOS64}
224+
{$DEFINE OSX64}
225+
{$ENDIF CPU64}
219226
{$ENDIF DARWIN}
227+
228+
{$IFDEF CPUARM}
229+
{$DEFINE CPUARM32}
230+
{$ENDIF}
231+
232+
{$IFDEF CPUAARCH64}
233+
{$DEFINE CPUARM}
234+
{$DEFINE CPUARM64}
235+
{$ENDIF}
236+
220237
{$IFDEF UNIX}
221238
{$DEFINE POSIX}
222239
{$ENDIF UNIX}
240+
241+
{$IFDEF ANDROID}
242+
{$DEFINE POSIX}
243+
{$ENDIF ANDROID}
223244
{$ENDIF FPC}
224245

225246
{$IFDEF DELPHIXE_OR_HIGHER}
@@ -230,8 +251,6 @@
230251
{$LEGACYIFEND ON}
231252
{$ENDIF DELPHIXE4_OR_HIGHER}
232253

233-
{$IFDEF DELPHIXE2_OR_HIGHER}
234-
{$IFDEF MACOS}
235-
{$DEFINE DARWIN}
236-
{$ENDIF MACOS}
237-
{$ENDIF DELPHIXE2_OR_HIGHER}
254+
{$IFDEF MACOS}
255+
{$DEFINE DARWIN}
256+
{$ENDIF MACOS}

Source/MethodCallBack.pas

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ procedure GetCodeMem(var ptr: PByte; size: integer);
194194
{$IFEND}
195195
if mprotect(page, PageSize, flags) <> 0 then
196196
raise EMProtectError.CreateFmt('MProtect error: %s', [
197-
SysErrorMessage(GetLastError())]);
197+
SysErrorMessage({$IFDEF FPC}GetLastOSError{$ELSE}GetLastError{$ENDIF}())]);
198198
{$ENDIF}
199199
page^.next:=CodeMemPages;
200200
CodeMemPages:=page;
@@ -210,7 +210,7 @@ procedure GetCodeMem(var ptr: PByte; size: integer);
210210
//RW permission to the entire page for new changes...
211211
if mprotect(page, PageSize, PROT_READ or PROT_WRITE) <> 0 then
212212
raise EMProtectError.CreateFmt('MProtect error: %s', [
213-
SysErrorMessage(GetLastError())]);
213+
SysErrorMessage({$IFDEF FPC}GetLastOSError{$ELSE}GetLastError{$ENDIF}())]);
214214
end;
215215
{$ELSE}
216216
end;
@@ -751,7 +751,7 @@ function GetCallBack(Self: TObject; Method: Pointer; ArgNum: Integer;
751751
//X permission to the entire page for executions...
752752
if mprotect(CodeMemPages, PageSize, PROT_EXEC) <> 0 then
753753
raise EMProtectError.CreateFmt('MProtect error: %s', [
754-
SysErrorMessage(GetLastError())]);
754+
SysErrorMessage({$IFDEF FPC}GetLastOSError{$ELSE}GetLastError{$ENDIF}())]);
755755
{$IFEND}
756756

757757
Result := Pointer(Q); //set arm mode

0 commit comments

Comments
 (0)