From 5d0e32b0e44ffbe2493fc2a5075e281a9fa18adf Mon Sep 17 00:00:00 2001 From: Piotr Trojanek Date: Tue, 12 Jan 2021 11:24:23 +0100 Subject: [PATCH] [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. --- gcc/ada/make.adb | 11 ++--------- 1 file 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; -- 2.7.4