From nobody Wed Mar 22 22:31:38 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 4PhjrC202Pz41PB0; Wed, 22 Mar 2023 22:31:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PhjrC0qLtz3n8Z; Wed, 22 Mar 2023 22:31:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679524299; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+oMAYKQ232PHm92XfAqtpM5bVflbxPm3pErt9OkU6mg=; b=M4aeSq3nKKwatl8vhZA5F42NtqqwBSW0+zPDHsNdGDaQx5y0MfMgeDgi9G2yBl5EEw9UG1 tcpbxtkFhAX0DIBL3vcOutNDONRpB9hYSdBPB2b/LH6gQmNN797dS8xIm44ngbVYOJzPx4 +V9nRIxfby2dTCTPiRsQtdHBVC+7v49mPvUSY8EoRFZPjdUVoRj3GZVtLcTDo0ibFvnNW2 xyKLeNGkorG+bQBp/1Pkjz+mdJvJNGGYX6e0mP0gzBhALoEV13lRA0nX2todESjh1++/f9 ZkJNJXmxlBOa6G4FtRhfCHTX1RMa2c20KdaKxreZafb0JOnQJW2xH50LCkBELw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679524299; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+oMAYKQ232PHm92XfAqtpM5bVflbxPm3pErt9OkU6mg=; b=AcsZZdgAPUDIGtzty1S/VCpLJer4kosoOpeF2LsUgZqVAHy4pvDtSqznI01mcBoQ+Gjsj+ zEsSSRv4CuqhYOP14HEJu+KfQn++CmyvkDh5/5frZncULKcBaFPa0y+h0AhVnNL5BpWGAY jQKAZuTDAHVHYCRt8fROfGo8q8OF8BwkbT7aJQa08by0NSRvO0ykYxRlLU0TeHllovzRqr C10RI362Qe0JdsbtufXj6hx/7eEt9WyJOeVG9q5uPlHnNEOfEsONgCH6xjseNCNgaeP5Za lCLgmeKkxOCrS1UYFYXIXnQW4G2n+da2pSqLuaO5TVYTpSzimh2cGfukB31mmA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679524299; a=rsa-sha256; cv=none; b=i1A/DaqmmtbGYryG8T8FPgX324BTyrlWXmAJOkest0JX2LWc4vrlioJON0ZSEKKK0/PW8B hlR9/OEyCZUaiu/NCX7ExE3W5TSFY6LSe8seheVsS+o8pwPgGsRuwrIVcspZPzHdpea164 x3FBkOTryiXRfQbrpbwM5/C7XhBHFyJQIvyrQn9aZ9kxALY+bcGYf2g6wO8rB0RpakEmkN HRHmCaWRD+k1W88pQ2Q4kcQ8OfPg2C/qj1rSKJfBIIe9zz+bstcodYdImsZMq5RMMDl59o /RmLQRg9CHFYpeeqk1CtAqkFb8RNPR7bshkh0oGcGtLaxHggLK9eu6iAAHAQsg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PhjrB6V5Qz1BMl; Wed, 22 Mar 2023 22:31:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32MMVcch017222; Wed, 22 Mar 2023 22:31:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32MMVcHh017221; Wed, 22 Mar 2023 22:31:38 GMT (envelope-from git) Date: Wed, 22 Mar 2023 22:31:38 GMT Message-Id: <202303222231.32MMVcHh017221@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 4ccd5e64b76b - stable/13 - _endian.h: Include sys/cdefs.h for visibility macros 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 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4ccd5e64b76bbaa874c50755d17394a7ed195f93 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=4ccd5e64b76bbaa874c50755d17394a7ed195f93 commit 4ccd5e64b76bbaa874c50755d17394a7ed195f93 Author: Warner Losh AuthorDate: 2023-03-22 02:25:58 +0000 Commit: Warner Losh CommitDate: 2023-03-22 22:30:51 +0000 _endian.h: Include sys/cdefs.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 (cherry picked from commit ed52baf51bd142b5e32701842346452a7ebe37a5) --- 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