From patchwork Sun Feb 4 07:38:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maya Rashish X-Patchwork-Id: 868997 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-472577-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="EyGKFh3I"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zZ2fK4hvwz9sRV for ; Sun, 4 Feb 2018 18:39:02 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=ZAo6o4RarCHTQGQ6HSGWofVlaMDmu5/InLRZcd5TeCYxmYqcZQ sKBHDcxilYVMkkmcqD9Iurbcs/TxpDL+A+9eDxUSUbkd+RcG8/1gkY9fJUTxg685 5XsGyksf0XJWGkit7cSbHdl4LHbI7zsU+CEF00Jrz5WB5A1UQSetBz9Fs= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; s= default; bh=M4ilQ1M4UW0RurApDalOuPGgK2U=; b=EyGKFh3Im5zFqmu2pOhQ 7PMlAZjcrqQnryMA9W8GsRIKuJd5f2ctHYRC69utqsndIJoBNLuY6VhimtbNu3Vo qw1ulZDI2rssJRSmsMOZIjLw2fhSuTfSoxu1qlXa+aCqA3omKZ7w7H08xWq13Yih T/BQDoLozwZo/JIgbfAcoEk= Received: (qmail 103370 invoked by alias); 4 Feb 2018 07:38:53 -0000 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 Received: (qmail 103358 invoked by uid 89); 4 Feb 2018 07:38:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_NONE, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=order!, 3537, 5x, H*M:ORG X-HELO: mx.sdf.org Received: from ol.sdf.org (HELO mx.sdf.org) (205.166.94.20) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 04 Feb 2018 07:38:51 +0000 Received: from sdf.org (IDENT:coypu@sdf.lonestar.org [205.166.94.15]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id w147cmsD024579 (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256 bits) verified NO); Sun, 4 Feb 2018 07:38:48 GMT Received: (from coypu@localhost) by sdf.org (8.15.2/8.12.8/Submit) id w147cm1o003755; Sun, 4 Feb 2018 07:38:48 GMT Date: Sun, 4 Feb 2018 07:38:47 +0000 From: Maya Rashish To: gcc-patches@gcc.gnu.org Cc: coypu@sdf.org Subject: [PATCH 1/2] Untangle stddef.h a little Message-ID: <20180204073846.GA17915@SDF.ORG> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.9.1 (2017-09-22) Of the currently supported BSDs: - FreeBSD, doesn't have ansi.h or define _MACHINE_ANSI_H anywhere in its other headers since the long-gone 5.x release. - OpenBSD, DragonflyBSD don't have ansi.h either. - NetBSD, sole remaining with ansi.h Replace all the ifdef macros to be ifdef __NetBSD__ as it's the sole remaining user. Whether it is appropriate to make per-OS choices here is debatable, but this change allows for further future cleanup. This enables using the headers on netbsd archs that use different include guards for ansi.h, like ARM. (Note that netbsd's copy of GCC avoids this header entirely.) Built tested on NetBSD-8.99.12/amd64. --- gcc/ginclude/stddef.h | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/gcc/ginclude/stddef.h b/gcc/ginclude/stddef.h index 31b96a7e5..15a99e7da 100644 --- a/gcc/ginclude/stddef.h +++ b/gcc/ginclude/stddef.h @@ -46,9 +46,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see /* This avoids lossage on SunOS but only if stdtypes.h comes first. There's no way to win with the other order! Sun lossage. */ -/* On 4.3bsd-net2, make sure ansi.h is included, so we have - one less case to deal with in the following. */ -#if defined (__BSD_NET2__) || defined (____386BSD____) || (defined (__FreeBSD__) && (__FreeBSD__ < 5)) || defined(__NetBSD__) +#if defined(__NetBSD__) #include #endif /* On FreeBSD 5, machine/ansi.h does not exist anymore... */ @@ -56,11 +54,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include #endif -/* In 4.3bsd-net2, machine/ansi.h defines these symbols, which are - defined if the corresponding type is *not* defined. - FreeBSD-2.1 defines _MACHINE_ANSI_H_ instead of _ANSI_H_. - NetBSD defines _I386_ANSI_H_ and _X86_64_ANSI_H_ instead of _ANSI_H_ */ -#if defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_) || defined(_X86_64_ANSI_H_) || defined(_I386_ANSI_H_) +#if defined(__NetBSD__) #if !defined(_SIZE_T_) && !defined(_BSD_SIZE_T_) #define _SIZE_T #endif @@ -87,7 +81,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #undef _WCHAR_T_ #undef _BSD_WCHAR_T_ #endif -#endif /* defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_) || defined(_X86_64_ANSI_H_) || defined(_I386_ANSI_H_) */ +#endif /* defined(__NetBSD__) */ /* Sequent's header files use _PTRDIFF_T_ in some conflicting way. Just ignore it. */ @@ -359,11 +353,7 @@ typedef __WINT_TYPE__ wint_t; #undef __need_wint_t #endif -/* In 4.3bsd-net2, leave these undefined to indicate that size_t, etc. - are already defined. */ -/* BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here. */ -/* NetBSD 5 requires the I386_ANSI_H and X86_64_ANSI_H checks here. */ -#if defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_) || defined(_X86_64_ANSI_H_) || defined(_I386_ANSI_H_) +#if defined(__NetBSD__) /* The references to _GCC_PTRDIFF_T_, _GCC_SIZE_T_, and _GCC_WCHAR_T_ are probably typos and should be removed before 2.8 is released. */ #ifdef _GCC_PTRDIFF_T_ @@ -391,7 +381,7 @@ typedef __WINT_TYPE__ wint_t; #undef _WCHAR_T_ #undef _BSD_WCHAR_T_ #endif -#endif /* _ANSI_H_ || _MACHINE_ANSI_H_ || _X86_64_ANSI_H_ || _I386_ANSI_H_ */ +#endif /* __NetBSD__ */ #endif /* __sys_stdtypes_h */