summaryrefslogtreecommitdiff
path: root/compiler/catch.pas
diff options
context:
space:
mode:
authorjonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2>2009-02-28 18:07:21 +0000
committerjonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2>2009-02-28 18:07:21 +0000
commit32eac45bbc24b4e6d64631adc2d7e7f691f9f7a0 (patch)
tree2d6a83738e926d9dd98929c30873bf635a5401d8 /compiler/catch.pas
parent731e1adafb4a937c92d14415ed3de7f8819f787d (diff)
downloadfpc-32eac45bbc24b4e6d64631adc2d7e7f691f9f7a0.tar.gz
- disabled installation of SIGINT signal handler for Darwin, because
raising an exception inside a signal handler is inherently unsafe and often causes actual crashes on darwin (mantis #9930). - removed an unused global typed constant (in_const_evaluation) - removed {$ifdef havelinuxrtl10} code git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@12826 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'compiler/catch.pas')
-rw-r--r--compiler/catch.pas17
1 files changed, 8 insertions, 9 deletions
diff --git a/compiler/catch.pas b/compiler/catch.pas
index 3ee23aae96..002d559280 100644
--- a/compiler/catch.pas
+++ b/compiler/catch.pas
@@ -30,13 +30,14 @@ Unit catch;
interface
uses
-{$ifdef unix}
+{ you cannot safely raise an exception inside a signal handler on any OS,
+ and on darwin this even often crashes
+}
+{$if defined(unix) and not defined(darwin) }
+ {$ifndef darwin}
{$define has_signal}
- {$ifdef havelinuxrtl10}
- Linux,
- {$else}
- BaseUnix,Unix,
- {$endif}
+ BaseUnix,Unix,
+ {$endif}
{$endif}
{$ifdef go32v2}
{$define has_signal}
@@ -54,8 +55,6 @@ Var
OldSigInt : SignalHandler;
{$endif}
-Const in_const_evaluation : boolean = false;
-
Implementation
uses
@@ -82,7 +81,7 @@ begin
{$ifndef nocatch}
{$ifdef has_signal}
NewSignal:=SignalHandler(@CatchSignal);
- OldSigInt:={$ifdef havelinuxrtl10}Signal{$else}{$ifdef Unix}fpSignal{$else}Signal{$endif}{$endif} (SIGINT,NewSignal);
+ OldSigInt:={$ifdef Unix}fpSignal{$else}Signal{$endif}(SIGINT,NewSignal);
{$endif}
{$endif nocatch}
end.