mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-07-05 05:48:48 +02:00
+ introduce TExitCode
git-svn-id: trunk@47029 -
This commit is contained in:
parent
43b236a4df
commit
1bf58c2a55
@ -797,7 +797,7 @@ Procedure fpc_do_exit; compilerproc;
|
|||||||
Procedure fpc_HandleErrorAddrFrame (Errno : longint;addr,frame : pointer); compilerproc;
|
Procedure fpc_HandleErrorAddrFrame (Errno : longint;addr,frame : pointer); compilerproc;
|
||||||
}
|
}
|
||||||
Procedure fpc_lib_exit; compilerproc;
|
Procedure fpc_lib_exit; compilerproc;
|
||||||
Procedure fpc_HandleError (Errno : longint); compilerproc;
|
Procedure fpc_HandleError (Errno : TExitCode); compilerproc;
|
||||||
|
|
||||||
procedure fpc_AbstractErrorIntern;compilerproc;
|
procedure fpc_AbstractErrorIntern;compilerproc;
|
||||||
procedure fpc_assert(Const Msg,FName:Shortstring;LineNo:Longint;ErrorAddr:Pointer); compilerproc;
|
procedure fpc_assert(Const Msg,FName:Shortstring;LineNo:Longint;ErrorAddr:Pointer); compilerproc;
|
||||||
|
@ -33,10 +33,10 @@ type
|
|||||||
{$endif}
|
{$endif}
|
||||||
{$endif FPC_HAS_FEATURE_EXITCODE}
|
{$endif FPC_HAS_FEATURE_EXITCODE}
|
||||||
|
|
||||||
Procedure HandleError (Errno : Longint); external name 'FPC_HANDLEERROR';
|
Procedure HandleError (Errno : TExitCode); external name 'FPC_HANDLEERROR';
|
||||||
Procedure HandleErrorFrame (Errno : longint;frame : Pointer); forward;
|
Procedure HandleErrorFrame (Errno : TExitCode;frame : Pointer); forward;
|
||||||
Procedure HandleErrorAddrFrame (Errno : longint;addr : CodePointer; frame : Pointer); forward;
|
Procedure HandleErrorAddrFrame (Errno : TExitCode;addr : CodePointer; frame : Pointer); forward;
|
||||||
Procedure HandleErrorAddrFrameInd (Errno : longint;addr : CodePointer; frame : Pointer); forward;
|
Procedure HandleErrorAddrFrameInd (Errno : TExitCode;addr : CodePointer; frame : Pointer); forward;
|
||||||
|
|
||||||
{$ifdef FPC_HAS_FEATURE_TEXTIO}
|
{$ifdef FPC_HAS_FEATURE_TEXTIO}
|
||||||
type
|
type
|
||||||
@ -1268,7 +1268,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
Procedure Halt(ErrNum: Longint);noreturn;
|
Procedure Halt(ErrNum: TExitCode);noreturn;
|
||||||
Begin
|
Begin
|
||||||
{$ifdef FPC_HAS_FEATURE_EXITCODE}
|
{$ifdef FPC_HAS_FEATURE_EXITCODE}
|
||||||
{$ifdef FPC_LIMITED_EXITCODE}
|
{$ifdef FPC_LIMITED_EXITCODE}
|
||||||
@ -1320,7 +1320,7 @@ end;
|
|||||||
{$endif FPC_SYSTEM_HAS_CAPTUREBACKTRACE}
|
{$endif FPC_SYSTEM_HAS_CAPTUREBACKTRACE}
|
||||||
|
|
||||||
|
|
||||||
Procedure HandleErrorAddrFrame (Errno : longint;addr : CodePointer; frame : Pointer);[public,alias:'FPC_BREAK_ERROR']; {$ifdef CPUI386} register; {$endif}
|
Procedure HandleErrorAddrFrame (Errno : TExitCode;addr : CodePointer; frame : Pointer);[public,alias:'FPC_BREAK_ERROR']; {$ifdef CPUI386} register; {$endif}
|
||||||
begin
|
begin
|
||||||
If codepointer(ErrorProc)<>Nil then
|
If codepointer(ErrorProc)<>Nil then
|
||||||
ErrorProc(Errno,addr,frame);
|
ErrorProc(Errno,addr,frame);
|
||||||
@ -1337,13 +1337,13 @@ end;
|
|||||||
{ This is used internally by system skip first level,
|
{ This is used internally by system skip first level,
|
||||||
and generated the same output as before, when
|
and generated the same output as before, when
|
||||||
HandleErrorFrame function was used internally. }
|
HandleErrorFrame function was used internally. }
|
||||||
Procedure HandleErrorAddrFrameInd (Errno : longint;addr : CodePointer; frame : Pointer);
|
Procedure HandleErrorAddrFrameInd (Errno : TExitCode;addr : CodePointer; frame : Pointer);
|
||||||
begin
|
begin
|
||||||
get_caller_stackinfo (frame, addr);
|
get_caller_stackinfo (frame, addr);
|
||||||
HandleErrorAddrFrame (Errno,addr,frame);
|
HandleErrorAddrFrame (Errno,addr,frame);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Procedure HandleErrorFrame (Errno : longint;frame : Pointer);
|
Procedure HandleErrorFrame (Errno : TExitCode;frame : Pointer);
|
||||||
{
|
{
|
||||||
Procedure to handle internal errors, i.e. not user-invoked errors
|
Procedure to handle internal errors, i.e. not user-invoked errors
|
||||||
Internal function should ALWAYS call HandleError instead of RunError.
|
Internal function should ALWAYS call HandleError instead of RunError.
|
||||||
@ -1354,7 +1354,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure fpc_handleerror (Errno : longint); compilerproc; [public,alias : 'FPC_HANDLEERROR'];
|
procedure fpc_handleerror (Errno : TExitCode); compilerproc; [public,alias : 'FPC_HANDLEERROR'];
|
||||||
{
|
{
|
||||||
Procedure to handle internal errors, i.e. not user-invoked errors
|
Procedure to handle internal errors, i.e. not user-invoked errors
|
||||||
Internal function should ALWAYS call HandleError instead of RunError.
|
Internal function should ALWAYS call HandleError instead of RunError.
|
||||||
|
@ -403,6 +403,7 @@ Type
|
|||||||
CodePointer = Pointer;
|
CodePointer = Pointer;
|
||||||
CodePtrInt = PtrInt;
|
CodePtrInt = PtrInt;
|
||||||
CodePtrUInt = PtrUInt;
|
CodePtrUInt = PtrUInt;
|
||||||
|
TExitCode = Longint;
|
||||||
{$endif CPU64}
|
{$endif CPU64}
|
||||||
|
|
||||||
{$ifdef CPU32}
|
{$ifdef CPU32}
|
||||||
@ -415,6 +416,7 @@ Type
|
|||||||
CodePointer = Pointer;
|
CodePointer = Pointer;
|
||||||
CodePtrInt = PtrInt;
|
CodePtrInt = PtrInt;
|
||||||
CodePtrUInt = PtrUInt;
|
CodePtrUInt = PtrUInt;
|
||||||
|
TExitCode = Longint;
|
||||||
{$endif CPU32}
|
{$endif CPU32}
|
||||||
|
|
||||||
{$ifdef CPU16}
|
{$ifdef CPU16}
|
||||||
@ -446,6 +448,8 @@ Type
|
|||||||
{$endif}
|
{$endif}
|
||||||
ValSInt = Integer;
|
ValSInt = Integer;
|
||||||
ValUInt = Word;
|
ValUInt = Word;
|
||||||
|
{ this is TP compatible }
|
||||||
|
TExitCode = Word;
|
||||||
{$endif CPU16}
|
{$endif CPU16}
|
||||||
|
|
||||||
{$if defined(VER2) or defined(VER3_0)}
|
{$if defined(VER2) or defined(VER3_0)}
|
||||||
@ -774,7 +778,7 @@ const
|
|||||||
ModuleIsCpp : Boolean = FALSE;
|
ModuleIsCpp : Boolean = FALSE;
|
||||||
|
|
||||||
var
|
var
|
||||||
ExitCode : Longint; public name 'operatingsystem_result';
|
ExitCode : TExitCode; public name 'operatingsystem_result';
|
||||||
RandSeed : Cardinal;
|
RandSeed : Cardinal;
|
||||||
{ Delphi compatibility }
|
{ Delphi compatibility }
|
||||||
|
|
||||||
@ -1604,7 +1608,7 @@ procedure DumpExceptionBacktrace(var f:text);
|
|||||||
|
|
||||||
Procedure RunError(w:Word);noreturn;
|
Procedure RunError(w:Word);noreturn;
|
||||||
Procedure RunError;{$ifdef SYSTEMINLINE}inline;{$endif}noreturn;
|
Procedure RunError;{$ifdef SYSTEMINLINE}inline;{$endif}noreturn;
|
||||||
Procedure Halt(errnum:Longint);noreturn;
|
Procedure Halt(errnum:TExitCode);noreturn;
|
||||||
{$ifdef FPC_HAS_FEATURE_HEAP}
|
{$ifdef FPC_HAS_FEATURE_HEAP}
|
||||||
Procedure AddExitProc(Proc:TProcedure);
|
Procedure AddExitProc(Proc:TProcedure);
|
||||||
{$endif FPC_HAS_FEATURE_HEAP}
|
{$endif FPC_HAS_FEATURE_HEAP}
|
||||||
|
Loading…
Reference in New Issue
Block a user