OSDN Git Service

PR c++/9704
[pf3gnuchains/gcc-fork.git] / gcc / ada / s-stalib.adb
1 ------------------------------------------------------------------------------
2 --                                                                          --
3 --                         GNAT COMPILER COMPONENTS                         --
4 --                                                                          --
5 --              S Y S T E M . S T A N D A R D _ L I B R A R Y               --
6 --                                                                          --
7 --                                 B o d y                                  --
8 --                                                                          --
9 --                                                                          --
10 --          Copyright (C) 1995-2001 Free Software Foundation, Inc.          --
11 --                                                                          --
12 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
13 -- terms of the  GNU General Public License as published  by the Free Soft- --
14 -- ware  Foundation;  either version 2,  or (at your option) any later ver- --
15 -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
16 -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
17 -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
18 -- for  more details.  You should have  received  a copy of the GNU General --
19 -- Public License  distributed with GNAT;  see file COPYING.  If not, write --
20 -- to  the Free Software Foundation,  59 Temple Place - Suite 330,  Boston, --
21 -- MA 02111-1307, USA.                                                      --
22 --                                                                          --
23 -- As a special exception,  if other files  instantiate  generics from this --
24 -- unit, or you link  this unit with other files  to produce an executable, --
25 -- this  unit  does not  by itself cause  the resulting  executable  to  be --
26 -- covered  by the  GNU  General  Public  License.  This exception does not --
27 -- however invalidate  any other reasons why  the executable file  might be --
28 -- covered by the  GNU Public License.                                      --
29 --                                                                          --
30 -- GNAT was originally developed  by the GNAT team at  New York University. --
31 -- Extensive contributions were provided by Ada Core Technologies Inc.      --
32 --                                                                          --
33 ------------------------------------------------------------------------------
34
35 --  The purpose of this body is simply to ensure that the two with'ed units
36 --  are properly included in the link. They are not with'ed from the spec
37 --  of System.Standard_Library, since this would cause order of elaboration
38 --  problems (Elaborate_Body would have the same problem).
39
40 pragma Warnings (Off);
41 --  Kill warnings from unused withs
42
43 pragma Polling (Off);
44 --  We must turn polling off for this unit, because otherwise we get
45 --  elaboration circularities with Ada.Exceptions if polling is on.
46
47 with System.Soft_Links;
48 --  Referenced directly from generated code using external symbols so it
49 --  must always be present in a build, even if no unit has a direct with
50 --  of this unit. Also referenced from exception handling routines.
51 --  This is needed for programs that don't use exceptions explicitly but
52 --  direct calls to Ada.Exceptions are generated by gigi (for example,
53 --  by calling __gnat_raise_constraint_error directly).
54
55 with System.Memory;
56 --  Referenced directly from generated code using external symbols, so it
57 --  must always be present in a build, even if no unit has a direct with
58 --  of this unit.
59
60 package body System.Standard_Library is
61
62    Runtime_Finalized : Boolean := False;
63    --  Set to True when adafinal is called. Used to ensure that subsequent
64    --  calls to adafinal after the first have no effect.
65
66    Inside_Elab_Final_Code : Integer := 0;
67    pragma Export (C, Inside_Elab_Final_Code, "__gnat_inside_elab_final_code");
68    --  ???This variable is obsolete starting from 29/08 but cannot be removed
69    --  ???right away due to the bootstrap problems
70
71    --------------------------
72    -- Abort_Undefer_Direct --
73    --------------------------
74
75    procedure Abort_Undefer_Direct is
76    begin
77       System.Soft_Links.Abort_Undefer.all;
78    end Abort_Undefer_Direct;
79
80    --------------
81    -- Adafinal --
82    --------------
83
84    procedure Adafinal is
85    begin
86       if not Runtime_Finalized then
87          Runtime_Finalized := True;
88          System.Soft_Links.Adafinal.all;
89       end if;
90    end Adafinal;
91
92 end System.Standard_Library;