瀏覽代碼

- 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: trunk@12826 -

Jonas Maebe 16 年之前
父節點
當前提交
fd070544db
共有 1 個文件被更改,包括 8 次插入9 次删除
  1. 8 9
      compiler/catch.pas

+ 8 - 9
compiler/catch.pas

@@ -30,13 +30,14 @@ Unit catch;
 
 
 interface
 interface
 uses
 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}
   {$define has_signal}
-  {$ifdef havelinuxrtl10}
-    Linux,
-  {$else}
-    BaseUnix,Unix,
-  {$endif}
+  BaseUnix,Unix,
+ {$endif}
 {$endif}
 {$endif}
 {$ifdef go32v2}
 {$ifdef go32v2}
 {$define has_signal}
 {$define has_signal}
@@ -54,8 +55,6 @@ Var
   OldSigInt : SignalHandler;
   OldSigInt : SignalHandler;
 {$endif}
 {$endif}
 
 
-Const in_const_evaluation : boolean = false;
-
 Implementation
 Implementation
 
 
 uses
 uses
@@ -82,7 +81,7 @@ begin
 {$ifndef nocatch}
 {$ifndef nocatch}
   {$ifdef has_signal}
   {$ifdef has_signal}
     NewSignal:=SignalHandler(@CatchSignal);
     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}
 {$endif nocatch}
 {$endif nocatch}
 end.
 end.