Browse Source

+ define types depending on the ALU register size of the CPU, e. g. for most 8 Bit CPUs this is different from Ptr(U)Int, and e.g. also for the far pointer memory models of i8086

git-svn-id: trunk@30451 -
florian 10 years ago
parent
commit
134457fb8c
1 changed files with 25 additions and 1 deletions
  1. 25 1
      rtl/inc/systemh.inc

+ 25 - 1
rtl/inc/systemh.inc

@@ -399,6 +399,30 @@ Type
   ValUInt = Word;
   ValUInt = Word;
 {$endif CPU16}
 {$endif CPU16}
 
 
+{$if defined(VER2) or defined(VER3_0)}
+{$if defined(CPU16)}
+{$define CPUINT16}
+{$elseif defined(CPU32)}
+{$define CPUINT32}
+{$elseif defined(CPU64)}
+{$define CPUINT64}
+{$endif defined(CPU64)}
+{$endif defined(VER2) or defined(VER3_0)}
+
+{$if defined(CPUINT8)}
+  ALUSInt = ShortInt;
+  ALUUInt = Byte;
+{$elseif defined(CPUINT16)}
+  ALUSInt = ShortInt;
+  ALUUInt = Word;
+{$elseif defined(CPUINT32)}
+  ALUSInt = Longint;
+  ALUUInt = DWord;
+{$elseif defined(CPUINT64)}
+  ALUSInt = Int64;
+  ALUUInt = QWord;
+{$endif defined(CPUINT64)}
+
   { NativeInt and NativeUInt are Delphi compatibility types. Even though Delphi
   { NativeInt and NativeUInt are Delphi compatibility types. Even though Delphi
     has IntPtr and UIntPtr, the Delphi documentation for NativeInt states that
     has IntPtr and UIntPtr, the Delphi documentation for NativeInt states that
     'The size of NativeInt is equivalent to the size of the pointer on the
     'The size of NativeInt is equivalent to the size of the pointer on the
@@ -694,7 +718,7 @@ var
   IsConsole : boolean = false; public name 'operatingsystem_isconsole';
   IsConsole : boolean = false; public name 'operatingsystem_isconsole';
   NoErrMsg: Boolean platform = False; // For Delphi compatibility, not used in FPC.
   NoErrMsg: Boolean platform = False; // For Delphi compatibility, not used in FPC.
   FirstDotAtFileNameStartIsExtension : Boolean = False;
   FirstDotAtFileNameStartIsExtension : Boolean = False;
-  
+
   DefaultSystemCodePage,
   DefaultSystemCodePage,
   DefaultUnicodeCodePage,
   DefaultUnicodeCodePage,
   { the code page to use when sending paths/file names to OS file system API
   { the code page to use when sending paths/file names to OS file system API