From patchwork Fri Mar 16 09:54:06 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tristan Gingold X-Patchwork-Id: 147178 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 EA9CCB6FBD for ; Fri, 16 Mar 2012 20:54:39 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1332496480; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:From:Content-Type:Content-Transfer-Encoding:Subject: Date:Message-Id:To:Mime-Version:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=HD1L0PMmTuTVnJOe8ufVuG1vsAg=; b=OReDGAewCg+IbK4 EVmpn/lrzQUNyy/ikqxRQeAkyevh0IS1tnyYMg+Fsr23jvGO5SeBQd7bc439Lk5p qwglw8an8yub/FJe/AcvI49ggv2QaY7Axl0Ba2AzG2DbUPANlOWy4t2NGZUYJj0Y rohMrwp+lReFXD5TBdTMWTVn+YMg= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:From:Content-Type:Content-Transfer-Encoding:Subject:Date:Message-Id:To:Mime-Version:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=HksMdxNk2VWCrq8LCzeT2wSsUHRwg7oi3MkLNzLLXmxjh0RwWlojs2QaZEToSH 2K03STFTXPbWgNREFua3kAH8H5MfjCHnc2UlL5EspXt9RdGQ0aBYbi9PijwXhiE+ 7y0DOLLHg/QoK6ZDl8gDRU7DrsJy9vZjpfwTuQRabOAh4=; Received: (qmail 27808 invoked by alias); 16 Mar 2012 09:54:35 -0000 Received: (qmail 27793 invoked by uid 22791); 16 Mar 2012 09:54:32 -0000 X-SWARE-Spam-Status: No, hits=-1.7 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; Fri, 16 Mar 2012 09:54:07 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 9063E290045 for ; Fri, 16 Mar 2012 10:54:08 +0100 (CET) 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 1rq1VY79l9HE for ; Fri, 16 Mar 2012 10:54:08 +0100 (CET) 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 7EBB7290041 for ; Fri, 16 Mar 2012 10:54:08 +0100 (CET) From: Tristan Gingold Subject: [VMS/committed]: Define __VMS_VER and __CRTL_VER Date: Fri, 16 Mar 2012 10:54:06 +0100 Message-Id: To: GCC Patches Mime-Version: 1.0 (Apple Message framework v1257) 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, these two macros are used by system headers to enable some features. If they aren't defined, the headers assume the system is the most recent one, and may use some functions that aren't present in the libraries. Let's be conservative for cross compiler (and even for native one). Committed on trunk. Tristan. 2012-03-16 Tristan Gingold * config/vms/vms.h (TARGET_OS_CPP_BUILTINS): Define __CRTL_VER and __VMS_VER. * config/vms/vms-protos.h: Declare vms_c_get_crtl_ver and vms_c_get_vms_ver. * config/vms/vms-c.c (vms_c_get_crtl_ver, vms_c_get_vms_ver): New functions. * config/alpha/vms.h (VMS_DEFAULT_CRTL_VER) (VMS_DEFAULT_VMS_VER): Define. * config/ia64/vms.h (VMS_DEFAULT_CRTL_VER) (VMS_DEFAULT_VMS_VER): Define. Index: gcc/config/alpha/vms.h =================================================================== --- gcc/config/alpha/vms.h (revision 185454) +++ gcc/config/alpha/vms.h (working copy) @@ -289,3 +289,7 @@ #undef TARGET_VALID_POINTER_MODE #define TARGET_VALID_POINTER_MODE vms_valid_pointer_mode + +/* Default values for _CRTL_VER and _VMS_VER. */ +#define VMS_DEFAULT_CRTL_VER 70320000 +#define VMS_DEFAULT_VMS_VER 70320000 Index: gcc/config/vms/vms-protos.h =================================================================== --- gcc/config/vms/vms-protos.h (revision 185454) +++ gcc/config/vms/vms-protos.h (working copy) @@ -20,6 +20,8 @@ /* vms-c.c */ extern void vms_c_register_pragma (void); extern void vms_c_common_override_options (void); +extern int vms_c_get_crtl_ver (void); +extern int vms_c_get_vms_ver (void); /* vms.c */ void vms_patch_builtins (void); Index: gcc/config/vms/vms.h =================================================================== --- gcc/config/vms/vms.h (revision 185454) +++ gcc/config/vms/vms.h (working copy) @@ -21,19 +21,21 @@ #define TARGET_OBJECT_SUFFIX ".obj" #define TARGET_EXECUTABLE_SUFFIX ".exe" -#define TARGET_OS_CPP_BUILTINS() \ - do { \ - builtin_define_std ("vms"); \ - builtin_define_std ("VMS"); \ - builtin_assert ("system=vms"); \ - SUBTARGET_OS_CPP_BUILTINS(); \ - builtin_define ("__int64=long long"); \ - if (flag_vms_pointer_size == VMS_POINTER_SIZE_32) \ - builtin_define ("__INITIAL_POINTER_SIZE=32"); \ - else if (flag_vms_pointer_size == VMS_POINTER_SIZE_64) \ - builtin_define ("__INITIAL_POINTER_SIZE=64"); \ - if (POINTER_SIZE == 64) \ - builtin_define ("__LONG_POINTERS=1"); \ +#define TARGET_OS_CPP_BUILTINS() \ + do { \ + builtin_define_std ("vms"); \ + builtin_define_std ("VMS"); \ + builtin_assert ("system=vms"); \ + SUBTARGET_OS_CPP_BUILTINS(); \ + builtin_define ("__int64=long long"); \ + if (flag_vms_pointer_size == VMS_POINTER_SIZE_32) \ + builtin_define ("__INITIAL_POINTER_SIZE=32"); \ + else if (flag_vms_pointer_size == VMS_POINTER_SIZE_64) \ + builtin_define ("__INITIAL_POINTER_SIZE=64"); \ + if (POINTER_SIZE == 64) \ + builtin_define ("__LONG_POINTERS=1"); \ + builtin_define_with_int_value ("__CRTL_VER", vms_c_get_crtl_ver ()); \ + builtin_define_with_int_value ("__VMS_VER", vms_c_get_vms_ver ()); \ } while (0) extern void vms_c_register_includes (const char *, const char *, int); Index: gcc/config/vms/vms-c.c =================================================================== --- gcc/config/vms/vms-c.c (revision 185454) +++ gcc/config/vms/vms-c.c (working copy) @@ -466,3 +466,19 @@ break; } } + +/* The default value for _CRTL_VER macro. */ + +int +vms_c_get_crtl_ver (void) +{ + return VMS_DEFAULT_CRTL_VER; +} + +/* The default value for _VMS_VER macro. */ + +int +vms_c_get_vms_ver (void) +{ + return VMS_DEFAULT_VMS_VER; +} Index: gcc/config/ia64/vms.h =================================================================== --- gcc/config/ia64/vms.h (revision 185454) +++ gcc/config/ia64/vms.h (working copy) @@ -157,3 +157,7 @@ /* IA64 VMS doesn't fully support COMDAT sections. */ #define SUPPORTS_ONE_ONLY 0 + +/* Default values for _CRTL_VER and _VMS_VER. */ +#define VMS_DEFAULT_CRTL_VER 80300000 +#define VMS_DEFAULT_VMS_VER 80300000