瀏覽代碼

+ Added fake Exception classes, only for MACOS.

olle 20 年之前
父節點
當前提交
4f43c7e09f
共有 4 個文件被更改,包括 49 次插入4 次删除
  1. 6 1
      compiler/catch.pas
  2. 6 1
      compiler/compiler.pas
  3. 31 1
      compiler/globals.pas
  4. 6 1
      compiler/nadd.pas

+ 6 - 1
compiler/catch.pas

@@ -61,8 +61,10 @@ Const in_const_evaluation : boolean = false;
 
 Implementation
 
+{$IFNDEF MACOS_USE_FAKE_SYSUTILS}
 uses
   sysutils;
+{$ENDIF MACOS_USE_FAKE_SYSUTILS}
 
 {$ifdef has_signal}
 {$ifdef unix}
@@ -92,7 +94,10 @@ end.
 
 {
   $Log$
-  Revision 1.21  2005-01-26 16:23:28  peter
+  Revision 1.22  2005-01-31 21:30:56  olle
+    + Added fake Exception classes, only for MACOS.
+
+  Revision 1.21  2005/01/26 16:23:28  peter
     * detect arithmetic overflows for constants at compile time
     * use try..except instead of setjmp
 

+ 6 - 1
compiler/compiler.pas

@@ -129,7 +129,9 @@ uses
 {$ELSE USE_SYSUTILS}
   dos,
 {$ENDIF USE_SYSUTILS}
+{$IFNDEF MACOS_USE_FAKE_SYSUTILS}
   sysutils,
+{$ENDIF MACOS_USE_FAKE_SYSUTILS}
   verbose,comphook,systems,
   cutils,cclasses,globals,options,fmodule,parser,symtable,
   assemble,link,import,export,tokens,pass_1
@@ -425,7 +427,10 @@ end;
 end.
 {
   $Log$
-  Revision 1.52  2005-01-26 16:23:28  peter
+  Revision 1.53  2005-01-31 21:30:56  olle
+    + Added fake Exception classes, only for MACOS.
+
+  Revision 1.52  2005/01/26 16:23:28  peter
     * detect arithmetic overflows for constants at compile time
     * use try..except instead of setjmp
 

+ 31 - 1
compiler/globals.pas

@@ -354,6 +354,33 @@ interface
        be placed in data/const segment, according to the current alignment requirements }
     function const_align(siz: longint): longint;
 
+{$IFDEF MACOS}
+
+{Since SysUtils is not yet available for MacOS, fake 
+ Exceptions classes are included here.}
+
+{$DEFINE MACOS_USE_FAKE_SYSUTILS}
+
+type
+   { exceptions }
+   Exception = class(TObject);
+
+   EExternal = class(Exception);
+
+   { integer math exceptions }
+   EInterror    = Class(EExternal);
+   EDivByZero   = Class(EIntError);
+   ERangeError  = Class(EIntError);
+   EIntOverflow = Class(EIntError);
+
+   { General math errors }
+   EMathError  = Class(EExternal);
+   EInvalidOp  = Class(EMathError);
+   EZeroDivide = Class(EMathError);
+   EOverflow   = Class(EMathError);
+   EUnderflow  = Class(EMathError);
+
+{$ENDIF MACOS}
 
 implementation
 
@@ -2191,7 +2218,10 @@ end;
 end.
 {
   $Log$
-  Revision 1.163  2005-01-23 22:13:50  florian
+  Revision 1.164  2005-01-31 21:30:56  olle
+    + Added fake Exception classes, only for MACOS.
+
+  Revision 1.163  2005/01/23 22:13:50  florian
     * fixed math constants for big endian cpus
 
   Revision 1.162  2005/01/23 21:09:11  florian

+ 6 - 1
compiler/nadd.pas

@@ -69,7 +69,9 @@ interface
 implementation
 
     uses
+{$IFNDEF MACOS_USE_FAKE_SYSUTILS}
       sysutils,
+{$ENDIF MACOS_USE_FAKE_SYSUTILS}
       globtype,systems,
       cutils,verbose,globals,widestr,
       symconst,symtype,symdef,symsym,symtable,defutil,defcmp,
@@ -2137,7 +2139,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.138  2005-01-31 16:15:04  peter
+  Revision 1.139  2005-01-31 21:30:56  olle
+    + Added fake Exception classes, only for MACOS.
+
+  Revision 1.138  2005/01/31 16:15:04  peter
     * zero based array with elementsize>1 fix
 
   Revision 1.137  2005/01/26 16:23:28  peter