From patchwork Thu Sep 22 15:00:57 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tristan Gingold X-Patchwork-Id: 115954 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 BF6AAB6F72 for ; Fri, 23 Sep 2011 01:01:31 +1000 (EST) Received: (qmail 21451 invoked by alias); 22 Sep 2011 15:01:29 -0000 Received: (qmail 21439 invoked by uid 22791); 22 Sep 2011 15:01:27 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 22 Sep 2011 15:01:08 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id EE8FBCB034F; Thu, 22 Sep 2011 17:01:08 +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 l57MpuSElfCd; Thu, 22 Sep 2011 17:00:58 +0200 (CEST) Received: from ulanbator.act-europe.fr (ulanbator.act-europe.fr [10.10.1.67]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id A26D7CB01FC; Thu, 22 Sep 2011 17:00:58 +0200 (CEST) From: Tristan Gingold Subject: [Patch]: New fixincludes fixes for vms Date: Thu, 22 Sep 2011 17:00:57 +0200 Message-Id: <2278460A-8A99-44C5-8126-DDB931DA381D@adacore.com> To: GCC Patches , Bruce Korb Mime-Version: 1.0 (Apple Message framework v1244.3) 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 Hi, this patch adds some fixes in fixincludes specific to VMS. Until now we were using a manually modified subset of the VMS headers, but using fix includes is the right way. Ok for mainline ? Tristan. fixincludes/ 2011-09-22 Tristan Gingold * inclhack.def (ms_define_can_use_extern_prefix): (vms_use_pragma_extern_model, vms_disable_decc_string_builtins): New fixes. * fixincl.x: Regenerate. * tests/base/rtldef/string.h: New test. * tests/base/rtldef/decc$types.h: Likewise. * tests/base/testing.h: Update Index: inclhack.def =================================================================== --- inclhack.def (revision 179086) +++ inclhack.def (working copy) @@ -4508,6 +4508,65 @@ /* + * Define __CAN_USE_EXTERN_PREFIX on vms. + */ +fix = { + hackname = vms_define_can_use_extern_prefix; + files = "rtldef/decc$types.h"; + select = "#[ \t]*else\n" + "#[ \t]*if defined\\(__DECCXX\\)\n" + "#[ \t]*define __CAN_USE_EXTERN_PREFIX 1\n"; + mach = "*-*-*vms*"; + c_fix = format; + + c_fix_arg = "%0" + "# elif defined (__GNUC__)\n" + "#\tdefine __CAN_USE_EXTERN_PREFIX 1\n"; + + test_text = "# else\n" + "# if defined(__DECCXX)\n" + "#\tdefine __CAN_USE_EXTERN_PREFIX 1\n" + "# endif\n" + "# endif\n"; +}; + +/* + * On VMS, use pragma extern_model instead of VAX-C keywords. + */ +fix = { + hackname = vms_use_pragma_extern_model; + select = "#if defined\\(__DECC\\) \\|\\| defined\\(__DECCXX\\)\n" + "# pragma extern_model __save\n"; + mach = "*-*-*vms*"; + c_fix = format; + + c_fix_arg = "#if defined(__DECC) || defined(__DECCXX) || defined(__GNUC__)\n" + "# pragma extern_model __save\n"; + + test_text = "#if defined(__DECC) || defined(__DECCXX)\n" + "# pragma extern_model __save\n" + "# pragma extern_model strict_refdef\n" + " extern struct x zz$yy;\n" + "# pragma extern_model __restore\n" + "#endif\n"; +}; + +/* + * On VMS, disable the use of dec-c string builtins + */ +fix = { + hackname = vms_disable_decc_string_builtins; + select = "#if !defined\\(__VAX\\)\n"; + mach = "*-*-*vms*"; + files = "rtldef/string.h"; + c_fix = format; + + c_fix_arg = "#if !defined(__VAX) && !defined(__GNUC__)\n"; + + test_text = "#if !defined(__VAX)\n"; +}; + +/* * AIX and Interix headers define NULL to be cast to a void pointer, * which is illegal in ANSI C++. */ Index: tests/base/rtldef/string.h =================================================================== --- tests/base/rtldef/string.h (revision 0) +++ tests/base/rtldef/string.h (revision 0) @@ -0,0 +1,15 @@ +/* DO NOT EDIT THIS FILE. + + It has been auto-edited by fixincludes from: + + "fixinc/tests/inc/rtldef/string.h" + + This had to be done to correct non-standard usages in the + original, manufacturer supplied header file. */ + + + +#if defined( VMS_DISABLE_DECC_STRING_BUILTINS_CHECK ) +#if !defined(__VAX) && !defined(__GNUC__) + +#endif /* VMS_DISABLE_DECC_STRING_BUILTINS_CHECK */ Index: tests/base/rtldef/decc$types.h =================================================================== --- tests/base/rtldef/decc$types.h (revision 0) +++ tests/base/rtldef/decc$types.h (revision 0) @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE. + + It has been auto-edited by fixincludes from: + + "fixinc/tests/inc/rtldef/decc$types.h" + + This had to be done to correct non-standard usages in the + original, manufacturer supplied header file. */ + + + +#if defined( VMS_DEFINE_CAN_USE_EXTERN_PREFIX_CHECK ) +# else +# if defined(__DECCXX) +# define __CAN_USE_EXTERN_PREFIX 1 +# elif defined (__GNUC__) +# define __CAN_USE_EXTERN_PREFIX 1 +# endif +# endif + +#endif /* VMS_DEFINE_CAN_USE_EXTERN_PREFIX_CHECK */ Index: tests/base/testing.h =================================================================== --- tests/base/testing.h (revision 179086) +++ tests/base/testing.h (working copy) @@ -120,3 +120,14 @@ extern size_t strlen(), strspn(); #endif /* SYSV68_STRING_CHECK */ + + +#if defined( VMS_USE_PRAGMA_EXTERN_MODEL_CHECK ) +#if defined(__DECC) || defined(__DECCXX) || defined(__GNUC__) +# pragma extern_model __save +# pragma extern_model strict_refdef + extern struct x zz; +# pragma extern_model __restore +#endif + +#endif /* VMS_USE_PRAGMA_EXTERN_MODEL_CHECK */