From nobody Wed Mar 22 03:07:50 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PhD1b32m8z41BMT for ; Wed, 22 Mar 2023 03:08:03 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PhD1b2cb5z3Qtn for ; Wed, 22 Mar 2023 03:08:03 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x52c.google.com with SMTP id x3so67435622edb.10 for ; Tue, 21 Mar 2023 20:08:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; t=1679454482; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=aSB1B+zstIiS2gxLqI3xS8smd4Xg1v8RWZ13492cpiw=; b=e5N7dc5+cTtTMTq7tYeeRUJ47iBg0C/AsdU9gjJXg8QoFj5JqEao7RzixJtppALz22 6SDELCEXh0l68eVOjrHvoNx+d16i6ZLLSLisbfl9lScddccZi468sSsKiVoZKoO7pAMD lWP92iZ3Lf8NOhFjmFtey5H+NI2aOd+jKkId0AvLBZVljX+wgZA8xiEcLOVwB5YNea0Y 4tCisK/MRipGhP0tjfhzPa1XdAW5+8keemhqyjzHk9w78PGx0pJNvVpj1L/+OFzXv8XG 6A2qqKnEKwle1aqBax/94bPvjya+lgkSci3pZumtzWkFOrqinniysYmA9opjMw6ieB6s DgyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679454482; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=aSB1B+zstIiS2gxLqI3xS8smd4Xg1v8RWZ13492cpiw=; b=hE/gcbrfBoNqYWzl2xipAxyUiturp4lAw/lYmOLm33vJ6bqELFkRMInamzoijFJPoh 6st5IE5ifFeuKEK8TZqAcKOSfoeXw909cwimrLbH4LHuWLixSVuohYhzI1YSWwiRDKXU zl/upaq1UjOOdrgiS0B+4rOHQA2D4NekhcN4KxUs41/BfBkmfSjCdyOGCH/j9/yp5BqO xSW/u/UhXdl7iQjhAWZCGC3U0O23KBbhHFJIqa1WP8D+d+B50+Zu+GioJeh6mSDsoo15 M9ADrzunPMUxg9QpOnHJLUKAG1de9F+9oAA3tNmk6tDENoK6HUXB6+Fgo3wJM6kPA/q0 MN7g== X-Gm-Message-State: AO0yUKUZtWg6P6/oAYsLoqEU20JIyF0emPVkLkPS+WfKHx63hydKmaVP 2+zyl74Rqaj6kfPnEPCdRJZKMR04RJZ5glibAQ4N5Q== X-Google-Smtp-Source: AK7set84Z4G8Hx+98lwy/7kDljdbWNbSKCjjij0inylYON69gkTBez/eXrQ7YwhRCq/VBmXdSdmum/0/ML1wYhGHzHc= X-Received: by 2002:a17:906:c413:b0:92f:7c42:863d with SMTP id u19-20020a170906c41300b0092f7c42863dmr2332973ejz.2.1679454481938; Tue, 21 Mar 2023 20:08:01 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 References: <202303220226.32M2QLoe029463@gitrepo.freebsd.org> In-Reply-To: <202303220226.32M2QLoe029463@gitrepo.freebsd.org> From: Warner Losh Date: Wed, 22 Mar 2023 04:07:50 +0100 Message-ID: Subject: Re: git: ed52baf51bd1 - main - _endian.h: Include sys/ctypes.h for visibility macros To: Warner Losh Cc: src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: multipart/alternative; boundary="000000000000d00d4605f7747732" X-Rspamd-Queue-Id: 4PhD1b2cb5z3Qtn X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --000000000000d00d4605f7747732 Content-Type: text/plain; charset="UTF-8" Doh. Should have changed ctypes.h to cdefs.h, but rushed a bit and forgot. Warner On Wed, Mar 22, 2023, 3:26 AM Warner Losh wrote: > The branch main has been updated by imp: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=ed52baf51bd142b5e32701842346452a7ebe37a5 > > commit ed52baf51bd142b5e32701842346452a7ebe37a5 > Author: Warner Losh > AuthorDate: 2023-03-22 02:25:58 +0000 > Commit: Warner Losh > CommitDate: 2023-03-22 02:25:58 +0000 > > _endian.h: Include sys/ctypes.h for visibility macros > > BYTE_ORDER, LITTLE_ENDIAN and BIG_ENDIAN will be required by the > forthcoming POSIX Issue 8. In addition, they are provided in the BSD > compilation environments. However, depending on the order includes > happend, sys/cdefs.h may or may not be included when endian.h is > included. Include it here so we can safely test __BSD_VISIBLE. Add > visibility when we're compiling in the future for issue 8, but since > the > date number for issue 8 hasn't been fixed, use strictly greater than > the > issue 7 date.of 200809. > > This had the side effect of sometimes (in the traditional BSD > compliation environment) > #if BYTE_ORDER == LITTLE_ENDIAN > and > #if BYTE_ORDER == BIG_ENDIAN > both being true because none of these were defined. This fixes > that. It also fixes including it after but not before. > > PR: 269249 > MFC After: 1d (build related) > Reviewed by: kib, emaste > Differential Revision: https://reviews.freebsd.org/D39176 > > Sponsored by: Netflix > --- > sys/sys/_endian.h | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > > diff --git a/sys/sys/_endian.h b/sys/sys/_endian.h > index 7ac39386e2e1..3b4460472eb6 100644 > --- a/sys/sys/_endian.h > +++ b/sys/sys/_endian.h > @@ -36,6 +36,8 @@ > #error "sys/_endian.h should not be included directly" > #endif > > +#include /* visibility macros */ > + > /* BSD Compatiblity */ > #define _BYTE_ORDER __BYTE_ORDER__ > > @@ -66,10 +68,11 @@ > #endif > > /* > - * Deprecated variants that don't have enough underscores to be useful in > more > - * strict namespaces. > + * POSIX Issue 8 will require these for endian.h. Define them there and > in the > + * traditional BSD compilation environment. Since issue 8 doesn't yet > have an > + * assigned date, use strictly greater than issue 7's date. > */ > -#if __BSD_VISIBLE > +#if __BSD_VISIBLE || _POSIX_C_SOURCE > 200809 > #define LITTLE_ENDIAN _LITTLE_ENDIAN > #define BIG_ENDIAN _BIG_ENDIAN > #define PDP_ENDIAN _PDP_ENDIAN > --000000000000d00d4605f7747732 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Doh. Should have changed ctypes.h to cdefs.h, but rushed = a bit and forgot.

Warner=C2=A0=

On Wed, Mar 22, 2023, 3:26 AM Warner Losh <imp@freebsd.org> wrote:
The branch main has been updated by imp:

URL: ht= tps://cgit.FreeBSD.org/src/commit/?id=3Ded52baf51bd142b5e32701842346452a7eb= e37a5

commit ed52baf51bd142b5e32701842346452a7ebe37a5
Author:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
AuthorDate: 2023-03-22 02:25:58 +0000
Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org>
CommitDate: 2023-03-22 02:25:58 +0000

=C2=A0 =C2=A0 _endian.h: Include sys/ctypes.h for visibility macros

=C2=A0 =C2=A0 BYTE_ORDER, LITTLE_ENDIAN and BIG_ENDIAN will be required by = the
=C2=A0 =C2=A0 forthcoming POSIX Issue 8. In addition, they are provided in = the BSD
=C2=A0 =C2=A0 compilation environments. However, depending on the order inc= ludes
=C2=A0 =C2=A0 happend, sys/cdefs.h may or may not be included when endian.h= is
=C2=A0 =C2=A0 included. Include it here so we can safely test __BSD_VISIBLE= .=C2=A0 Add
=C2=A0 =C2=A0 visibility when we're compiling in the future for issue 8= , but since the
=C2=A0 =C2=A0 date number for issue 8 hasn't been fixed, use strictly g= reater than the
=C2=A0 =C2=A0 issue 7 date.of 200809.

=C2=A0 =C2=A0 This had the side effect of sometimes (in the traditional BSD=
=C2=A0 =C2=A0 compliation environment)
=C2=A0 =C2=A0 =C2=A0#if BYTE_ORDER =3D=3D LITTLE_ENDIAN
=C2=A0 =C2=A0 and
=C2=A0 =C2=A0 =C2=A0#if BYTE_ORDER =3D=3D BIG_ENDIAN
=C2=A0 =C2=A0 both being true because none of these were defined. This fixe= s
=C2=A0 =C2=A0 that. It also fixes including it after <stdio.h> but no= t before.

=C2=A0 =C2=A0 PR:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0269249
=C2=A0 =C2=A0 MFC After:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 1d= (build related)
=C2=A0 =C2=A0 Reviewed by:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 kib, em= aste
=C2=A0 =C2=A0 Differential Revision:=C2=A0 https://revi= ews.freebsd.org/D39176

=C2=A0 =C2=A0 Sponsored by:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Netflix=
---
=C2=A0sys/sys/_endian.h | 9 ++++++---
=C2=A01 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/sys/sys/_endian.h b/sys/sys/_endian.h
index 7ac39386e2e1..3b4460472eb6 100644
--- a/sys/sys/_endian.h
+++ b/sys/sys/_endian.h
@@ -36,6 +36,8 @@
=C2=A0#error "sys/_endian.h should not be included directly"
=C2=A0#endif

+#include <sys/cdefs.h>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* visibility macros */
+
=C2=A0/* BSD Compatiblity */
=C2=A0#define=C2=A0 =C2=A0 =C2=A0 =C2=A0 _BYTE_ORDER=C2=A0 =C2=A0 =C2=A0__B= YTE_ORDER__

@@ -66,10 +68,11 @@
=C2=A0#endif

=C2=A0/*
- * Deprecated variants that don't have enough underscores to be useful= in more
- * strict namespaces.
+ * POSIX Issue 8 will require these for endian.h. Define them there and in= the
+ * traditional BSD compilation environment. Since issue 8 doesn't yet = have an
+ * assigned date, use strictly greater than issue 7's date.
=C2=A0 */
-#if __BSD_VISIBLE
+#if __BSD_VISIBLE || _POSIX_C_SOURCE > 200809
=C2=A0#define=C2=A0 =C2=A0 =C2=A0 =C2=A0 LITTLE_ENDIAN=C2=A0 =C2=A0_LITTLE_= ENDIAN
=C2=A0#define=C2=A0 =C2=A0 =C2=A0 =C2=A0 BIG_ENDIAN=C2=A0 =C2=A0 =C2=A0 _BI= G_ENDIAN
=C2=A0#define=C2=A0 =C2=A0 =C2=A0 =C2=A0 PDP_ENDIAN=C2=A0 =C2=A0 =C2=A0 _PD= P_ENDIAN
--000000000000d00d4605f7747732--