Mercurial > hg > CbC > CbC_gcc
comparison gcc/ada/libgnarl/s-interr__sigaction.adb @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 84e7813d76e9 |
children |
comparison
equal
deleted
inserted
replaced
131:84e7813d76e9 | 145:1830386684a0 |
---|---|
4 -- -- | 4 -- -- |
5 -- S Y S T E M . I N T E R R U P T S -- | 5 -- S Y S T E M . I N T E R R U P T S -- |
6 -- -- | 6 -- -- |
7 -- B o d y -- | 7 -- B o d y -- |
8 -- -- | 8 -- -- |
9 -- Copyright (C) 1998-2018, Free Software Foundation, Inc. -- | 9 -- Copyright (C) 1998-2019, Free Software Foundation, Inc. -- |
10 -- -- | 10 -- -- |
11 -- GNARL is free software; you can redistribute it and/or modify it under -- | 11 -- GNARL is free software; you can redistribute it and/or modify it under -- |
12 -- terms of the GNU General Public License as published by the Free Soft- -- | 12 -- terms of the GNU General Public License as published by the Free Soft- -- |
13 -- ware Foundation; either version 3, or (at your option) any later ver- -- | 13 -- ware Foundation; either version 3, or (at your option) any later ver- -- |
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- | 14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- |
485 -- Always consider a null handler as registered. | 485 -- Always consider a null handler as registered. |
486 | 486 |
487 function Is_Registered (Handler : Parameterless_Handler) return Boolean is | 487 function Is_Registered (Handler : Parameterless_Handler) return Boolean is |
488 Ptr : R_Link := Registered_Handlers; | 488 Ptr : R_Link := Registered_Handlers; |
489 | 489 |
490 type Acc_Proc is access procedure; | |
491 | |
490 type Fat_Ptr is record | 492 type Fat_Ptr is record |
491 Object_Addr : System.Address; | 493 Object_Addr : System.Address; |
492 Handler_Addr : System.Address; | 494 Handler_Addr : Acc_Proc; |
493 end record; | 495 end record; |
494 | 496 |
495 function To_Fat_Ptr is new Ada.Unchecked_Conversion | 497 function To_Fat_Ptr is new Ada.Unchecked_Conversion |
496 (Parameterless_Handler, Fat_Ptr); | 498 (Parameterless_Handler, Fat_Ptr); |
497 | 499 |
503 end if; | 505 end if; |
504 | 506 |
505 Fat := To_Fat_Ptr (Handler); | 507 Fat := To_Fat_Ptr (Handler); |
506 | 508 |
507 while Ptr /= null loop | 509 while Ptr /= null loop |
508 if Ptr.H = Fat.Handler_Addr then | 510 if Ptr.H = Fat.Handler_Addr.all'Address then |
509 return True; | 511 return True; |
510 end if; | 512 end if; |
511 | 513 |
512 Ptr := Ptr.Next; | 514 Ptr := Ptr.Next; |
513 end loop; | 515 end loop; |