Browse Source

macos: patched up the system unit to build at least on m68k

git-svn-id: trunk@37031 -
Károly Balogh 8 năm trước cách đây
mục cha
commit
3c5011aedc
2 tập tin đã thay đổi với 47 bổ sung7 xóa
  1. 4 3
      rtl/macos/macostp.inc
  2. 43 4
      rtl/macos/system.pp

+ 4 - 3
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;

+ 43 - 4
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