From 3c5011aedc958e5199914460af08998ac8fd4def Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A1roly=20Balogh?= Date: Tue, 22 Aug 2017 10:51:39 +0000 Subject: [PATCH] macos: patched up the system unit to build at least on m68k git-svn-id: trunk@37031 - --- rtl/macos/macostp.inc | 7 ++++--- rtl/macos/system.pp | 47 +++++++++++++++++++++++++++++++++++++++---- 2 files changed, 47 insertions(+), 7 deletions(-) diff --git a/rtl/macos/macostp.inc b/rtl/macos/macostp.inc index 08684dddbe..e7d24050cc 100644 --- a/rtl/macos/macostp.inc +++ b/rtl/macos/macostp.inc @@ -1039,7 +1039,8 @@ external 'InterfaceLib'; {************** from Quickdraw ***************} TYPE - Bits16 = ARRAY [0..15] OF INTEGER; + { this was called 'Bits16', but that conflicts with softfpu internal types on m68k (KB) } + MacBits16 = ARRAY [0..15] OF INTEGER; PatternPtr = ^Pattern; Pattern = RECORD @@ -1057,8 +1058,8 @@ TYPE CursorPtr = ^Cursor; Cursor = RECORD - data: Bits16; - mask: Bits16; + data: MacBits16; + mask: MacBits16; hotSpot: Point; END; CursPtr = ^Cursor; diff --git a/rtl/macos/system.pp b/rtl/macos/system.pp index 40a395ad27..cab10cee20 100644 --- a/rtl/macos/system.pp +++ b/rtl/macos/system.pp @@ -21,6 +21,12 @@ interface { include system-independent routine headers } {$I systemh.inc} +{$if defined(cpum68k) and defined(fpusoft)} +{$define fpc_softfpu_interface} +{$i softfpu.pp} +{$undef fpc_softfpu_interface} +{$endif defined(cpum68k) and defined(fpusoft)} + const LineEnding = #13; LFNSupport = true; @@ -185,6 +191,28 @@ Perhaps handle readonly filesystems, as in sysunix.inc } +{$if defined(cpum68k) and defined(fpusoft)} + +{$define fpc_softfpu_implementation} +{$define softfpu_compiler_mul32to64} +{$define softfpu_inline} +{$i softfpu.pp} +{$undef fpc_softfpu_implementation} + +{ we get these functions and types from the softfpu code } +{$define FPC_SYSTEM_HAS_float64} +{$define FPC_SYSTEM_HAS_float32} +{$define FPC_SYSTEM_HAS_flag} +{$define FPC_SYSTEM_HAS_extractFloat64Frac0} +{$define FPC_SYSTEM_HAS_extractFloat64Frac1} +{$define FPC_SYSTEM_HAS_extractFloat64Exp} +{$define FPC_SYSTEM_HAS_extractFloat64Sign} +{$define FPC_SYSTEM_HAS_ExtractFloat32Frac} +{$define FPC_SYSTEM_HAS_extractFloat32Exp} +{$define FPC_SYSTEM_HAS_extractFloat32Sign} +{$endif defined(cpum68k) and defined(fpusoft)} + + {******** include system independent routines **********} {$I system.inc} @@ -296,6 +324,14 @@ begin FindSysFolder:= err; end; +{$ifdef CPUM68K} +{$WARNING FIXME: Dummy TrapAvailable!} +function TrapAvailable(_trap: Word): Boolean; +begin + TrapAvailable:=false; +end; +{$endif CPUM68K} + procedure InvestigateSystem; {$IFDEF CPUM68K} @@ -351,7 +387,9 @@ begin macosSystemVersion := 0; end; - macosHasSysDebugger := (LongintPtr(MacJmp)^ <> 0); + {$WARNING FIXME: MacJmp} + //macosHasSysDebugger := (LongintPtr(MacJmp)^ <> 0); + macosHasSysDebugger := false; macosHasCFM := false; macosHasAppleEvents := false; @@ -367,10 +405,11 @@ begin if (macosHasScriptMgr) then macosNrOfScriptsInstalled := GetEnvirons(smEnabled); {$ELSE} - if (macosHasScriptMgr) then - macosNrOfScriptsInstalled := GetScriptManagerVariable(smEnabled); {Gamla rutinnamnet var GetEnvirons.} - {$ENDIF} + {$WARNING FIXME: GetScriptManagerVariable and smEnabled} + //if (macosHasScriptMgr) then + // macosNrOfScriptsInstalled := GetScriptManagerVariable(smEnabled); {Gamla rutinnamnet var GetEnvirons.} {$ENDIF} + {$ENDIF CPUM68K} end else begin