From patchwork Fri Sep 10 10:13:44 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Charlet X-Patchwork-Id: 64368 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 2A224B7116 for ; Fri, 10 Sep 2010 20:14:03 +1000 (EST) Received: (qmail 31246 invoked by alias); 10 Sep 2010 10:14:01 -0000 Received: (qmail 31228 invoked by uid 22791); 10 Sep 2010 10:14:00 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD, WEIRD_QUOTING X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (212.99.106.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 10 Sep 2010 10:13:55 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 8F054CB0316; Fri, 10 Sep 2010 12:13:53 +0200 (CEST) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id p6vr8VrsnSZT; Fri, 10 Sep 2010 12:13:53 +0200 (CEST) Received: from saumur.act-europe.fr (saumur.act-europe.fr [10.10.0.183]) by mel.act-europe.fr (Postfix) with ESMTP id 72862CB0315; Fri, 10 Sep 2010 12:13:53 +0200 (CEST) Received: by saumur.act-europe.fr (Postfix, from userid 525) id C174DD9BB4; Fri, 10 Sep 2010 12:13:44 +0200 (CEST) Date: Fri, 10 Sep 2010 12:13:44 +0200 From: Arnaud Charlet To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [Ada] Minor change to version string support Message-ID: <20100910101344.GA696@adacore.com> Mime-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.9i X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org This is a small internal change to factor out the prefix of the version string generated by the binder and make it more explicit that it is cross-referenced in the runtime unit GNAT.Compiler_Version. No functional change. Tested on x86_64-pc-linux-gnu, committed on trunk 2010-09-10 Eric Botcazou * gnatvsn.ads (Ver_Prefix): New constant string. * bindgen.adb (Gen_Output_File_Ada): Use it in lieu of hardcoded value. (Gen_Output_File_C): Likewise. * g-comver.adb (Ver_Prefix): Add cross-reference to Gnatvsn.Ver_Prefix in comment. Index: bindgen.adb =================================================================== --- bindgen.adb (revision 164149) +++ bindgen.adb (working copy) @@ -2341,7 +2341,7 @@ package body Bindgen is WBI (""); WBI (" GNAT_Version : constant String :="); - WBI (" ""GNAT Version: " & + WBI (" """ & Ver_Prefix & Gnat_Version_String & """ & ASCII.NUL;"); WBI (" pragma Export (C, GNAT_Version, ""__gnat_version"");"); @@ -2750,7 +2750,7 @@ package body Bindgen is if Bind_Main_Program then WBI (""); - WBI ("char __gnat_version[] = ""GNAT Version: " & + WBI ("char __gnat_version[] = """ & Ver_Prefix & Gnat_Version_String & """;"); Set_String ("char __gnat_ada_main_program_name[] = """); Index: g-comver.adb =================================================================== --- g-comver.adb (revision 164149) +++ g-comver.adb (working copy) @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2002-2008, AdaCore -- +-- Copyright (C) 2002-2010, AdaCore -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -42,7 +42,8 @@ package body GNAT.Compiler_Version is -- import this directly since run-time units cannot WITH compiler units. Ver_Prefix : constant String := "GNAT Version: "; - -- Prefix generated by binder + -- This is logically a reference to Gnatvsn.Ver_Prefix but we cannot + -- import this directly since run-time units cannot WITH compiler units. GNAT_Version : constant String (1 .. Ver_Len_Max + Ver_Prefix'Length); pragma Import (C, GNAT_Version, "__gnat_version"); Index: gnatvsn.ads =================================================================== --- gnatvsn.ads (revision 164149) +++ gnatvsn.ads (working copy) @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2010 Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2010, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -77,6 +77,10 @@ package Gnatvsn is -- value should never be decreased in the future, but it would be -- OK to increase it if absolutely necessary. + Ver_Prefix : constant String := "GNAT Version: "; + -- Prefix generated by binder. If it is changed, be sure to change + -- GNAT.Compiler_Version.Ver_Prefix as well. + Library_Version : constant String := "4.6"; -- Library version. This value must be updated whenever any change to the -- compiler affects the library formats in such a way as to obsolete