浏览代码

* Defined ExceptionClass and ExceptObjProc for Delphi compatibility (bug 8459)

git-svn-id: trunk@7850 -
michael 18 年之前
父节点
当前提交
07fdede9b8
共有 2 个文件被更改,包括 5 次插入1 次删除
  1. 4 1
      rtl/objpas/objpas.pp
  2. 1 0
      rtl/objpas/sysutils/sysutils.inc

+ 4 - 1
rtl/objpas/objpas.pp

@@ -40,6 +40,10 @@ unit objpas;
        PPointerArray = ^PointerArray;
        PPointerArray = ^PointerArray;
        TBoundArray = array of integer;
        TBoundArray = array of integer;
 
 
+Var
+   ExceptionClass: TClass; { Exception base class (must actually be Exception, defined in sysutils ) }
+   ExceptObjProc: Pointer; { Used to convert OS exceptions to exceptions in Delphi. Unused in FPC}
+
 {****************************************************************************
 {****************************************************************************
                              Compatibility routines.
                              Compatibility routines.
 ****************************************************************************}
 ****************************************************************************}
@@ -94,7 +98,6 @@ unit objpas;
      TResStringRec=AnsiString;
      TResStringRec=AnsiString;
    Function LoadResString(p:PResStringRec):AnsiString;
    Function LoadResString(p:PResStringRec):AnsiString;
 
 
-
   implementation
   implementation
 
 
 {****************************************************************************
 {****************************************************************************

+ 1 - 0
rtl/objpas/sysutils/sysutils.inc

@@ -358,6 +358,7 @@ Procedure InitExceptions;
   (e.g: SIGSEGV -> ESegFault or so.)
   (e.g: SIGSEGV -> ESegFault or so.)
 }
 }
 begin
 begin
+  ExceptionClass := Exception;
   ExceptProc:=@CatchUnhandledException;
   ExceptProc:=@CatchUnhandledException;
   // Create objects that may have problems when there is no memory.
   // Create objects that may have problems when there is no memory.
   OutOfMemory:=EOutOfMemory.Create(SOutOfMemory);
   OutOfMemory:=EOutOfMemory.Create(SOutOfMemory);