ports/lang/gnat_util/files/patch-gnatvsn.adb
John Marino dd06b54dc6 Add new port: lang/gnat_util
There are a number of GNAT tools that have to be build using the same
exact sources as the compiler that it serves.  Two examples of this are
GPRbuild and ASIS.  The latter is an important component of several other
language semantic tools.

Accordingly, a separate port is being created to build a static library
that need these compiler sources.  Incidentally, diverging sources is the
reason devel/gprbuild-aux stopped building after lang/gcc-aux was upgraded.
With this new scheme, this type of failure should no longer occur.

This is a dependency of the upcoming lang/asis port, and must be specified
as a build dependency by any port that needs ASIS.

Approved by: 	bapt (mentor)
2013-07-21 14:12:28 +00:00

36 lines
1.2 KiB
Ada

--- gnatvsn.adb.orig 2013-07-16 03:35:21.000000000 +0000
+++ gnatvsn.adb
@@ -53,32 +53,13 @@ package body Gnatvsn is
" FOR A PARTICULAR PURPOSE.";
end Gnat_Free_Software;
- type char_array is array (Natural range <>) of aliased Character;
- Version_String : char_array (0 .. Ver_Len_Max - 1);
- -- Import the C string defined in the (language-independent) source file
- -- version.c using the zero-based convention of the C language.
- -- The size is not the real one, which does not matter since we will
- -- check for the nul character in Gnat_Version_String.
- pragma Import (C, Version_String, "version_string");
-
-------------------------
-- Gnat_Version_String --
-------------------------
function Gnat_Version_String return String is
- S : String (1 .. Ver_Len_Max);
- Pos : Natural := 0;
begin
- loop
- exit when Version_String (Pos) = ASCII.NUL;
-
- S (Pos + 1) := Version_String (Pos);
- Pos := Pos + 1;
-
- exit when Pos = Ver_Len_Max;
- end loop;
-
- return S (1 .. Pos);
+ Return Gnat_Static_Version_String;
end Gnat_Version_String;
end Gnatvsn;