* slightly rewritten code

This commit is contained in:
pierre 1999-01-27 13:20:37 +00:00
parent 36ddf5811b
commit 1623b4fcfe

View File

@ -25,19 +25,23 @@ Unit catch;
interface interface
uses uses
{$ifdef linux} {$ifdef linux}
{$define has_signal}
linux, linux,
{$endif} {$endif}
{$ifdef go32v2} {$ifdef go32v2}
{$define has_signal}
dpmiexcp, dpmiexcp,
{$endif} {$endif}
verbose; verbose;
{$ifdef has_signal}
Var Var
NewSignal,OldSigSegm,OldSigInt : SignalHandler; NewSignal,OldSigSegm,OldSigInt : SignalHandler;
Implementation Implementation
{$ifdef has_signal}
{$ifdef linux} {$ifdef linux}
Procedure CatchSignal(Sig : Integer);cdecl; Procedure CatchSignal(Sig : Integer);cdecl;
{$else} {$else}
@ -59,23 +63,27 @@ begin
CatchSignal:=0; CatchSignal:=0;
{$endif} {$endif}
end; end;
{$endif def has_signal}
begin begin
{$ifdef linux} {$ifdef has_signal}
NewSignal:=@CatchSignal; {$ifndef TP}
NewSignal:=SignalHandler(@CatchSignal);
{$else TP}
NewSignal:=SignalHandler(CatchSignal);
{$endif TP}
OldSigSegm:=Signal (SIGSEGV,NewSignal); OldSigSegm:=Signal (SIGSEGV,NewSignal);
OldSigInt:=Signal (SIGINT,NewSignal); OldSigInt:=Signal (SIGINT,NewSignal);
{$else}
NewSignal:=SignalHandler(@CatchSignal);
Signal (SIGSEGV,NewSignal);
Signal (SIGINT,NewSignal);
{$endif} {$endif}
end. end.
{ {
$Log$ $Log$
Revision 1.2 1998-09-08 13:01:09 michael Revision 1.3 1999-01-27 13:20:37 pierre
* slightly rewritten code
Revision 1.2 1998/09/08 13:01:09 michael
Adapted to changed Signal call Adapted to changed Signal call
Revision 1.1.1.1 1998/03/25 11:18:12 root Revision 1.1.1.1 1998/03/25 11:18:12 root