OSDN Git Service

2004-05-17 Steve Kargl <kargls@comcast.net>
[pf3gnuchains/gcc-fork.git] / gcc / ada / g-comver.ads
1 ------------------------------------------------------------------------------
2 --                                                                          --
3 --                         GNAT COMPILER COMPONENTS                         --
4 --                                                                          --
5 --                G N A T . C O M P I L E R _ V E R S I O N                 --
6 --                                                                          --
7 --                                 S p e c                                  --
8 --                                                                          --
9 --                 Copyright (C) 2002 Ada Core Technologies                 --
10 --                                                                          --
11 -- GNAT 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- --
13 -- ware  Foundation;  either version 2,  or (at your option) any later ver- --
14 -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
17 -- for  more details.  You should have  received  a copy of the GNU General --
18 -- Public License  distributed with GNAT;  see file COPYING.  If not, write --
19 -- to  the Free Software Foundation,  59 Temple Place - Suite 330,  Boston, --
20 -- MA 02111-1307, USA.                                                      --
21 --                                                                          --
22 -- As a special exception,  if other files  instantiate  generics from this --
23 -- unit, or you link  this unit with other files  to produce an executable, --
24 -- this  unit  does not  by itself cause  the resulting  executable  to  be --
25 -- covered  by the  GNU  General  Public  License.  This exception does not --
26 -- however invalidate  any other reasons why  the executable file  might be --
27 -- covered by the  GNU Public License.                                      --
28 --                                                                          --
29 -- GNAT was originally developed  by the GNAT team at  New York University. --
30 -- Extensive contributions were provided by Ada Core Technologies Inc.      --
31 --                                                                          --
32 ------------------------------------------------------------------------------
33
34 --  This package provides a routine for obtaining the version number of the
35 --  GNAT compiler used to compile the program. It relies on the generated
36 --  constant in the binder generated package that records this information.
37
38 --  Note: to use this package you must first instantiate it, e.g.
39
40 --    package CVer is new GNAT.Compiler_Version;
41
42 --  and then you use the function in the instantiated package (Cver.Version).
43 --  The reason that this unit is generic is that otherwise the direct attempt
44 --  to import the necessary variable from the binder file causes trouble when
45 --  building a shared library, since the symbol is not available.
46
47 --  Note: this unit is only useable if the main program is written
48 --  in Ada. It cannot be used if the main program is written in a
49 --  foreign language.
50
51 generic
52 package GNAT.Compiler_Version is
53 pragma Pure (Compiler_Version);
54
55    function Version return String;
56    --  This function returns the version in the form "v.vvx (yyyyddmm)".
57    --  Here v.vv is the main version number (e.g. 3.16), x is the version
58    --  designator (e.g. a1 in 3.16a1), and yyyyddmm is the date in ISO form.
59    --  An example of the returned value would be "3.16w (20021029)". The
60    --  version is actually that of the binder used to bind the program,
61    --  which will be the same as the compiler version if a consistent
62    --  set of tools is used to build the program.
63
64 end GNAT.Compiler_Version;