mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-23 20:29:33 +02:00
* Moved multiple similar checks for FPC_HAS_FEATURE_EXITCODE and FPC_LIMITED_EXITCODE to Halt() procedure. Now these checks appear only once.
git-svn-id: trunk@19597 -
This commit is contained in:
parent
56900b4754
commit
ebe1d74d6e
rtl/inc
@ -159,12 +159,7 @@ begin
|
||||
if erroraddr = nil then
|
||||
RunError(217)
|
||||
else
|
||||
{$ifdef FPC_LIMITED_EXITCODE}
|
||||
if errorcode > maxExitCode then
|
||||
halt(255)
|
||||
else
|
||||
{$endif FPC_LIMITED_EXITCODE}
|
||||
halt(errorcode);
|
||||
Halt(errorcode);
|
||||
end;
|
||||
|
||||
|
||||
|
@ -939,7 +939,14 @@ end;
|
||||
|
||||
Procedure Halt(ErrNum: Longint);
|
||||
Begin
|
||||
ExitCode:=Errnum;
|
||||
{$ifdef FPC_HAS_FEATURE_EXITCODE}
|
||||
{$ifdef FPC_LIMITED_EXITCODE}
|
||||
if ErrNum > maxExitCode then
|
||||
ExitCode:=255
|
||||
else
|
||||
{$endif FPC_LIMITED_EXITCODE}
|
||||
ExitCode:=ErrNum;
|
||||
{$endif FPC_HAS_FEATURE_EXITCODE}
|
||||
Do_Exit;
|
||||
end;
|
||||
|
||||
@ -961,17 +968,7 @@ begin
|
||||
if ExceptAddrStack <> nil then
|
||||
raise TObject(nil) at addr,frame;
|
||||
{$endif FPC_HAS_FEATURE_EXCEPTIONS}
|
||||
|
||||
{$ifdef FPC_HAS_FEATURE_EXITCODE}
|
||||
{$ifdef FPC_LIMITED_EXITCODE}
|
||||
if errorcode > maxExitCode then
|
||||
halt(255)
|
||||
else
|
||||
{$endif FPC_LIMITED_EXITCODE}
|
||||
halt(errorcode);
|
||||
{$else FPC_HAS_FEATURE_EXITCODE}
|
||||
halt;
|
||||
{$endif FPC_HAS_FEATURE_EXITCODE}
|
||||
Halt(errorcode);
|
||||
end;
|
||||
|
||||
Procedure HandleErrorFrame (Errno : longint;frame : Pointer);
|
||||
@ -1000,16 +997,7 @@ begin
|
||||
errorcode:=w;
|
||||
erroraddr:=get_caller_addr(get_frame);
|
||||
errorbase:=get_caller_frame(get_frame);
|
||||
{$ifdef FPC_HAS_FEATURE_EXITCODE}
|
||||
{$ifdef FPC_LIMITED_EXITCODE}
|
||||
if errorcode > maxExitCode then
|
||||
halt(255)
|
||||
else
|
||||
{$endif FPC_LIMITED_EXITCODE}
|
||||
halt(errorcode);
|
||||
{$else FPC_HAS_FEATURE_EXITCODE}
|
||||
halt;
|
||||
{$endif FPC_HAS_FEATURE_EXITCODE}
|
||||
Halt(errorcode);
|
||||
end;
|
||||
|
||||
|
||||
@ -1269,11 +1257,7 @@ begin
|
||||
write(stderr,msg);
|
||||
Writeln(stderr,' (',FName,', line ',LineNo,').');
|
||||
Writeln(stderr,'');
|
||||
{$ifdef FPC_HAS_FEATURE_EXITCODE}
|
||||
Halt(227);
|
||||
{$else FPC_HAS_FEATURE_EXITCODE}
|
||||
halt;
|
||||
{$endif FPC_HAS_FEATURE_EXITCODE}
|
||||
{$endif FPC_HAS_FEATURE_CONSOLEIO}
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user