mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2026-01-06 11:30:44 +01:00
+ system_exit procedure added
This commit is contained in:
parent
b3635d6190
commit
33aac9b556
@ -243,7 +243,7 @@ const
|
||||
Initial: boolean; { Have successfully opened Std I/O }
|
||||
errno : word; { AmigaOS IO Error number }
|
||||
FileList : pFileList; { Linked list of opened files }
|
||||
old_exit: Pointer;
|
||||
{old_exit: Pointer; not needed anymore }
|
||||
FromHalt : boolean;
|
||||
OrigDir : Longint; { Current lock on original startup directory }
|
||||
|
||||
@ -608,7 +608,10 @@ const
|
||||
end;*)
|
||||
|
||||
|
||||
Procedure ExitCall;
|
||||
{*****************************************************************************
|
||||
System Dependent Exit code
|
||||
*****************************************************************************}
|
||||
Procedure system_exit;
|
||||
var
|
||||
i: byte;
|
||||
Begin
|
||||
@ -643,7 +646,7 @@ const
|
||||
Begin
|
||||
if pointerlist[i] <> 0 then FreeVec(pointerlist[i]);
|
||||
end;
|
||||
exitproc:=old_exit;
|
||||
{ exitproc:=old_exit;obsolete }
|
||||
end;
|
||||
|
||||
|
||||
@ -1806,14 +1809,15 @@ begin
|
||||
argc:=GetParamCount(args);
|
||||
OrigDir := 0;
|
||||
FileList := nil;
|
||||
old_Exit:=exitproc;
|
||||
Exitproc:=@ExitCall;
|
||||
end.
|
||||
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.11 1998-12-28 15:50:42 peter
|
||||
Revision 1.12 1999-01-18 10:05:47 pierre
|
||||
+ system_exit procedure added
|
||||
|
||||
Revision 1.11 1998/12/28 15:50:42 peter
|
||||
+ stdout, which is needed when you write something in the system unit
|
||||
to the screen. Like the runtime error
|
||||
|
||||
|
||||
@ -706,6 +706,13 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
{*****************************************************************************
|
||||
System Dependent Exit code
|
||||
*****************************************************************************}
|
||||
Procedure system_exit;
|
||||
begin
|
||||
end;
|
||||
|
||||
{*****************************************************************************
|
||||
SystemUnit Initialization
|
||||
*****************************************************************************}
|
||||
@ -732,7 +739,10 @@ end.
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.10 1998-12-28 15:50:43 peter
|
||||
Revision 1.11 1999-01-18 10:05:48 pierre
|
||||
+ system_exit procedure added
|
||||
|
||||
Revision 1.10 1998/12/28 15:50:43 peter
|
||||
+ stdout, which is needed when you write something in the system unit
|
||||
to the screen. Like the runtime error
|
||||
|
||||
|
||||
@ -593,6 +593,12 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
{*****************************************************************************
|
||||
System Dependent Exit code
|
||||
*****************************************************************************}
|
||||
Procedure system_exit;
|
||||
begin
|
||||
end;
|
||||
|
||||
{*****************************************************************************
|
||||
SystemUnit Initialization
|
||||
@ -613,7 +619,10 @@ Begin
|
||||
End.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.2 1998-12-28 15:50:44 peter
|
||||
Revision 1.3 1999-01-18 10:05:49 pierre
|
||||
+ system_exit procedure added
|
||||
|
||||
Revision 1.2 1998/12/28 15:50:44 peter
|
||||
+ stdout, which is needed when you write something in the system unit
|
||||
to the screen. Like the runtime error
|
||||
|
||||
|
||||
@ -543,17 +543,15 @@ end;
|
||||
{$endif SYSTEMDEBUG}
|
||||
|
||||
{*****************************************************************************
|
||||
ParamStr/Randomize
|
||||
System Dependent Exit code
|
||||
*****************************************************************************}
|
||||
|
||||
Procedure system_exit;
|
||||
{$ASMMODE DIRECT}
|
||||
procedure halt(errnum : byte);
|
||||
{$ifdef SYSTEMDEBUG}
|
||||
var h : byte;
|
||||
{$endif SYSTEMDEBUG}
|
||||
|
||||
begin
|
||||
do_exit;
|
||||
{$ifdef SYSTEMDEBUG}
|
||||
for h:=0 to max_files do
|
||||
if openfiles[h] then
|
||||
@ -564,19 +562,26 @@ begin
|
||||
set_pm_interrupt($00,old_int00);
|
||||
set_pm_interrupt($75,old_int75);
|
||||
asm
|
||||
movzbw errnum,%ax
|
||||
movzbw exitcode,%ax
|
||||
pushw %ax
|
||||
call ___exit {frees all dpmi memory !!}
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure halt(errnum : byte);
|
||||
|
||||
begin
|
||||
exitcode:=errnum;
|
||||
do_exit;
|
||||
{ do_exit should call system_exit but this does not hurt }
|
||||
System_exit;
|
||||
end;
|
||||
|
||||
procedure new_int00;
|
||||
begin
|
||||
HandleError(200);
|
||||
end;
|
||||
|
||||
|
||||
procedure new_int75;
|
||||
begin
|
||||
asm
|
||||
@ -632,6 +637,10 @@ end;
|
||||
|
||||
|
||||
|
||||
{*****************************************************************************
|
||||
ParamStr/Randomize
|
||||
*****************************************************************************}
|
||||
|
||||
function paramcount : longint;
|
||||
begin
|
||||
paramcount := argc - 1;
|
||||
@ -1142,7 +1151,7 @@ begin
|
||||
end
|
||||
else
|
||||
syscopyfromdos(longint(@temp),251);
|
||||
{ conversation to Pascal string including slash conversion }
|
||||
{ conversion to Pascal string including slash conversion }
|
||||
i:=0;
|
||||
while (temp[i]<>#0) do
|
||||
begin
|
||||
@ -1228,7 +1237,10 @@ Begin
|
||||
End.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.4 1998-12-30 22:17:59 peter
|
||||
Revision 1.5 1999-01-18 10:05:50 pierre
|
||||
+ system_exit procedure added
|
||||
|
||||
Revision 1.4 1998/12/30 22:17:59 peter
|
||||
* fixed mem decls to use $0:$0
|
||||
|
||||
Revision 1.3 1998/12/28 15:50:45 peter
|
||||
|
||||
@ -368,6 +368,8 @@ Begin
|
||||
End;
|
||||
|
||||
|
||||
Procedure system_exit;forward;
|
||||
|
||||
Procedure do_exit;[Public,Alias:'FPC_DO_EXIT'];
|
||||
var
|
||||
current_exit : Procedure;
|
||||
@ -384,6 +386,8 @@ Begin
|
||||
Writeln(stdout,'Run time error ',Errorcode,' at 0x',hexstr(Longint(Erroraddr),8));
|
||||
dump_stack(ErrorBase);
|
||||
End;
|
||||
{ call system dependent exit code }
|
||||
System_exit;
|
||||
End;
|
||||
|
||||
|
||||
@ -468,7 +472,10 @@ end;
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.50 1998-12-28 15:50:46 peter
|
||||
Revision 1.51 1999-01-18 10:05:52 pierre
|
||||
+ system_exit procedure added
|
||||
|
||||
Revision 1.50 1998/12/28 15:50:46 peter
|
||||
+ stdout, which is needed when you write something in the system unit
|
||||
to the screen. Like the runtime error
|
||||
|
||||
|
||||
@ -688,6 +688,13 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
{*****************************************************************************
|
||||
System Dependent Exit code
|
||||
*****************************************************************************}
|
||||
Procedure system_exit;
|
||||
begin
|
||||
end;
|
||||
|
||||
{*****************************************************************************
|
||||
SystemUnit Initialization
|
||||
*****************************************************************************}
|
||||
@ -731,7 +738,10 @@ End.
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.21 1998-12-28 15:50:49 peter
|
||||
Revision 1.22 1999-01-18 10:05:53 pierre
|
||||
+ system_exit procedure added
|
||||
|
||||
Revision 1.21 1998/12/28 15:50:49 peter
|
||||
+ stdout, which is needed when you write something in the system unit
|
||||
to the screen. Like the runtime error
|
||||
|
||||
|
||||
@ -650,6 +650,13 @@ end;
|
||||
|
||||
|
||||
|
||||
{*****************************************************************************
|
||||
System Dependent Exit code
|
||||
*****************************************************************************}
|
||||
Procedure system_exit;
|
||||
begin
|
||||
end;
|
||||
|
||||
{****************************************************************************
|
||||
|
||||
System unit initialization.
|
||||
|
||||
@ -79,13 +79,23 @@ Unit SysPalm;
|
||||
_PilotMain:=ExitCode;
|
||||
end;
|
||||
|
||||
{*****************************************************************************
|
||||
System Dependent Exit code
|
||||
*****************************************************************************}
|
||||
Procedure system_exit;
|
||||
begin
|
||||
end;
|
||||
|
||||
begin
|
||||
ExitCode:=0;
|
||||
end.
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.3 1998-08-31 12:18:37 peter
|
||||
Revision 1.4 1999-01-18 10:05:56 pierre
|
||||
+ system_exit procedure added
|
||||
|
||||
Revision 1.3 1998/08/31 12:18:37 peter
|
||||
* export changed to public which is allowed in implementation
|
||||
|
||||
Revision 1.2 1998/08/22 10:23:59 florian
|
||||
|
||||
@ -690,6 +690,13 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
{*****************************************************************************
|
||||
System Dependent Exit code
|
||||
*****************************************************************************}
|
||||
Procedure system_exit;
|
||||
begin
|
||||
end;
|
||||
|
||||
{$ifdef dummy}
|
||||
Function SetUpStack : longint;
|
||||
{ This routine does the following : }
|
||||
@ -966,7 +973,10 @@ end.
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.32 1998-12-28 23:30:11 peter
|
||||
Revision 1.33 1999-01-18 10:05:57 pierre
|
||||
+ system_exit procedure added
|
||||
|
||||
Revision 1.32 1998/12/28 23:30:11 peter
|
||||
* fixes for smartlinking
|
||||
|
||||
Revision 1.31 1998/12/28 15:50:51 peter
|
||||
|
||||
Loading…
Reference in New Issue
Block a user