From 32fac59ac58bbe05111f18e92e2b6faad5ed244c Mon Sep 17 00:00:00 2001 From: olle Date: Mon, 12 Sep 2005 19:39:58 +0000 Subject: [PATCH] made target macpas compile again git-svn-id: trunk@1077 - --- compiler/ncgutil.pas | 3 ++- compiler/parser.pas | 2 ++ rtl/macos/system.pp | 6 ++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/compiler/ncgutil.pas b/compiler/ncgutil.pas index a8c2b7b78f..8f35de4564 100644 --- a/compiler/ncgutil.pas +++ b/compiler/ncgutil.pas @@ -1595,7 +1595,8 @@ implementation { call startup helpers from main program } if (current_procinfo.procdef.proctypeoption=potype_proginit) then begin - if (target_info.system = system_powerpc_darwin) then + if (target_info.system = system_powerpc_darwin) or + (target_info.system = system_powerpc_macos) then begin { the parameters are already in the right registers } cg.a_call_name(list,target_info.cprefix+'FPC_SYSTEMMAIN'); diff --git a/compiler/parser.pas b/compiler/parser.pas index 3fd661b3e0..db953f1b18 100644 --- a/compiler/parser.pas +++ b/compiler/parser.pas @@ -35,7 +35,9 @@ interface implementation uses +{$IFNDEF MACOS_USE_FAKE_SYSUTILS} sysutils, +{$ENDIF MACOS_USE_FAKE_SYSUTILS} cutils,cclasses, globtype,version,tokens,systems,globals,verbose, symbase,symtable,symsym, diff --git a/rtl/macos/system.pp b/rtl/macos/system.pp index 822efaae26..59fb3f430f 100644 --- a/rtl/macos/system.pp +++ b/rtl/macos/system.pp @@ -213,18 +213,24 @@ end; SystemUnit Initialization *****************************************************************************} +{$ifndef FPC_DARWIN_PASCALMAIN} procedure pascalmain; external name 'PASCALMAIN'; {Main entry point in C style, needed to capture program parameters. For this to work, the system unit must be before the main program in the linking order.} procedure main(argcparam: Longint; argvparam: ppchar; envpparam: ppchar); cdecl; [public]; +{$else FPC_DARWIN_PASCALMAIN} +procedure FPC_SYSTEMMAIN(argcparam: Longint; argvparam: ppchar; envpparam: ppchar); cdecl; [public]; +{$endif FPC_DARWIN_PASCALMAIN} begin argc:= argcparam; argv:= argvparam; envp:= envpparam; +{$ifndef FPC_DARWIN_PASCALMAIN} pascalmain; {run the pascal main program} +{$endif FPC_DARWIN_PASCALMAIN} end; procedure setup_arguments;