소스 검색

* 3 small VP fixes from Noah Silva. One (OutOfMemory error) failed.

marco 22 년 전
부모
커밋
53d077afca
1개의 변경된 파일24개의 추가작업 그리고 2개의 파일을 삭제
  1. 24 2
      rtl/objpas/sysutils.inc

+ 24 - 2
rtl/objpas/sysutils.inc

@@ -32,6 +32,7 @@
     Var
     Var
       I : longint;
       I : longint;
       Temp : String;
       Temp : String;
+
     begin
     begin
       Result:='';
       Result:='';
       temp:=Dirlist;
       temp:=Dirlist;
@@ -170,6 +171,9 @@
 Procedure CatchUnhandledException (Obj : TObject; Addr,Frame: Pointer);
 Procedure CatchUnhandledException (Obj : TObject; Addr,Frame: Pointer);
 Var
 Var
   Message : String;
   Message : String;
+  {$IFDEF VIRTUALPASCAL}
+  stdout:text absolute output;
+  {$ENDIF}                           
 begin
 begin
   Writeln(stdout,'An unhandled exception occurred at 0x',HexStr(Longint(Addr),8),' :');
   Writeln(stdout,'An unhandled exception occurred at 0x',HexStr(Longint(Addr),8),' :');
   if Obj is exception then
   if Obj is exception then
@@ -180,8 +184,10 @@ begin
   else
   else
    Writeln(stdout,'Exception object ',Obj.ClassName,' is not of class Exception.');
    Writeln(stdout,'Exception object ',Obj.ClassName,' is not of class Exception.');
   { to get a nice symify }
   { to get a nice symify }
+  {$IFNDEF VIRTUALPASCAL}
   Writeln(stdout,BackTraceStrFunc(Addr));
   Writeln(stdout,BackTraceStrFunc(Addr));
   Dump_Stack(stdout,frame);
   Dump_Stack(stdout,frame);
+  {$ENDIF}
   Writeln(stdout,'');
   Writeln(stdout,'');
   Halt(217);
   Halt(217);
 end;
 end;
@@ -302,19 +308,29 @@ end;
 function ExceptObject: TObject;
 function ExceptObject: TObject;
 
 
 begin
 begin
+  {$IFDEF VIRTUALPASCAL}
+  // vpascal does exceptions more the delphi way...
+  // this needs to be written from scratch.
+  {$ELSE} 
   If RaiseList=Nil then
   If RaiseList=Nil then
     Result:=Nil
     Result:=Nil
   else
   else
     Result:=RaiseList^.FObject;
     Result:=RaiseList^.FObject;
+  {$ENDIF}
 end;
 end;
 
 
 function ExceptAddr: Pointer;
 function ExceptAddr: Pointer;
 
 
 begin
 begin
+  {$IFDEF VIRTUALPASCAL}
+  // vpascal does exceptions more the delphi way...
+  // this needs to be written from scratch.
+  {$ELSE}                         
   If RaiseList=Nil then
   If RaiseList=Nil then
     Result:=Nil
     Result:=Nil
   else
   else
     Result:=RaiseList^.Addr;
     Result:=RaiseList^.Addr;
+  {$ENDIF}
 end;
 end;
 
 
 function ExceptionErrorMessage(ExceptObject: TObject; ExceptAddr: Pointer;
 function ExceptionErrorMessage(ExceptObject: TObject; ExceptAddr: Pointer;
@@ -363,7 +379,10 @@ begin
 {$ifdef VER1_0}
 {$ifdef VER1_0}
   Raise EAbort.Create(SAbortError) at Longint(Get_Caller_addr(Get_Frame));
   Raise EAbort.Create(SAbortError) at Longint(Get_Caller_addr(Get_Frame));
 {$else VER1_0}
 {$else VER1_0}
-  Raise EAbort.Create(SAbortError) at Pointer(Get_Caller_addr(Get_Frame));
+  Raise EAbort.Create(SAbortError) 
+  {$IFNDEF VIRTUALPASCAL}
+    at Pointer(Get_Caller_addr(Get_Frame));
+  {$ENDIF}
 {$endif VER1_0}
 {$endif VER1_0}
 end;
 end;
 
 
@@ -375,7 +394,10 @@ end;
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.16  2003-04-06 11:06:39  michael
+  Revision 1.17  2003-09-06 20:46:07  marco
+   * 3 small VP fixes from Noah Silva. One (OutOfMemory error) failed.
+
+  Revision 1.16  2003/04/06 11:06:39  michael
   + Added exception classname to output of unhandled exception for better identification
   + Added exception classname to output of unhandled exception for better identification
 
 
   Revision 1.15  2003/03/18 08:28:23  michael
   Revision 1.15  2003/03/18 08:28:23  michael