aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2021-01-12 11:24:23 +0100
committerPierre-Marie de Rodat <derodat@adacore.com>2021-05-05 04:19:02 -0400
commit5d0e32b0e44ffbe2493fc2a5075e281a9fa18adf (patch)
tree204da53707aaa7e4585cf9c1173d3ed3951bcb39 /gcc
parent003241bcaed0c6864d5dcc3ac101d3608f751fbc (diff)
downloadgcc-5d0e32b0e44ffbe2493fc2a5075e281a9fa18adf.zip
gcc-5d0e32b0e44ffbe2493fc2a5075e281a9fa18adf.tar.gz
gcc-5d0e32b0e44ffbe2493fc2a5075e281a9fa18adf.tar.bz2
[Ada] Simplify GNATmake by reusing GNAT.Ctrl_C
gcc/ada/ * make.adb (Make): Use GNAT.Ctrl_C.Install_Handler instead of a custom imported procedure.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/make.adb11
1 files changed, 2 insertions, 9 deletions
diff --git a/gcc/ada/make.adb b/gcc/ada/make.adb
index 374ca05..9ddc7cc 100644
--- a/gcc/ada/make.adb
+++ b/gcc/ada/make.adb
@@ -61,6 +61,7 @@ with Ada.Directories;
with Ada.Exceptions; use Ada.Exceptions;
with GNAT.Command_Line; use GNAT.Command_Line;
+with GNAT.Ctrl_C;
with GNAT.Directory_Operations; use GNAT.Directory_Operations;
with GNAT.OS_Lib; use GNAT.OS_Lib;
@@ -76,15 +77,7 @@ package body Make is
-- is not always explicit and considering it is important when -f and -a
-- are used.
- type Sigint_Handler is access procedure;
- pragma Convention (C, Sigint_Handler);
-
- procedure Install_Int_Handler (Handler : Sigint_Handler);
- pragma Import (C, Install_Int_Handler, "__gnat_install_int_handler");
- -- Called by Gnatmake to install the SIGINT handler below
-
procedure Sigint_Intercepted;
- pragma Convention (C, Sigint_Intercepted);
pragma No_Return (Sigint_Intercepted);
-- Called when the program is interrupted by Ctrl-C to delete the
-- temporary mapping files and configuration pragmas files.
@@ -3322,7 +3315,7 @@ package body Make is
pragma Warnings (Off, Discard);
begin
- Install_Int_Handler (Sigint_Intercepted'Access);
+ GNAT.Ctrl_C.Install_Handler (Sigint_Intercepted'Access);
Do_Compile_Step := True;
Do_Bind_Step := True;