From nobody Thu Mar 23 06:41:05 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 4Phwhy1kP6z40wDR; Thu, 23 Mar 2023 06:41:06 +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 4Phwhy1HlCz3hvq; Thu, 23 Mar 2023 06:41:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679553666; 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=mz7NUGbCKVwQ+K+9zASLc47+duxgIVu7b4xiIHDENVk=; b=KP4Sods40XvDxA/86h1B6o32Vl7zB51IA/YSle1s9rLfhar1+MBiXS/eSpBndJS3Ou/zzt 6g40MXw9dh8eb7w/BRN8+hg1dOGYKJ1aP44m2OrcYOg9EYxACqE4v2CVL97jd1PMzRNHmq kk/SZAYfzycRA0nvntSUX7CHjpstVjlZhR0qzvs/kapgszFOJaYMfyS0EK8gobhwrK0yPb wnHF2VO0VpT1BSC6gE7e5IC2hMjUMeyT4zo75ztSfNWDFEYR792jeserAyRCzKXxLxTqmR nxPonQFGHeFmQexb87RpaFES4Juzc9maDmcx27znIRznqsAsXW0vFhfyDOwQ9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679553666; 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=mz7NUGbCKVwQ+K+9zASLc47+duxgIVu7b4xiIHDENVk=; b=yLc+KLajG+1Evaycj7zXXdbMLAERiISnBjNdDG8//3YFQgtM4ymTcR3exspPnYJy0JiHpW HX2pLog6ndI3zhPH9RpcHQVqjmeyvXHqqkPNVwjrqjPCkrkLplSzlAvbOB1WAp3Uyc8PvJ eouZp00lzqDbtacP2oGs70nKJDmCAb3sbKKFy1vvvRLPvnGA1L0V0/9XolobzTnWER9qED RXo9XBnVbT8BRQB5UAHxgdeFAv+kcxcNX5+wPLryjQqq7s8gSYfO0do+mVqs2KmmNJK+sV WmFVAvPnhfp+wyKt3voq7bYBUKYDym+mLyKORWOErjrcnlr2qiZV1Syw7sua1A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679553666; a=rsa-sha256; cv=none; b=pGHsu8W00OpKigBgs48A01IjK2y5XRtKVMUMtbPjCzg7hf+QaZ8nwcEoq1OcR0Qh+HV+4+ Wd6p61VyPUQrcPcM8PBdLwR50nBB5jnn8C5Pui8S9gyVZbjCJzEAaI9/tvqJFxqCSY7FmI 0do3SV4yks9Zhzme+Nvu5EBVqY4rZXGIRFrpX+NErBaFZr1RflP9DLK9H3XAM2ZbuYTN3l qdY8DY7vqYcDjnNskOPW8qNf6YgJDyvB0EntdOIi59n3ynHRT5HyaNld3TjQFnswi0jvtg CaL6C0N8xdGSBH+TbhX+Dlj6tAwsA8X6P4BzklTZ4BCg6p0UcWz2w7iC0jfliw== 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 4Phwhy0PLlzQVm; Thu, 23 Mar 2023 06:41:06 +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 32N6f5HJ014566; Thu, 23 Mar 2023 06:41:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32N6f5Eq014565; Thu, 23 Mar 2023 06:41:05 GMT (envelope-from git) Date: Thu, 23 Mar 2023 06:41:05 GMT Message-Id: <202303230641.32N6f5Eq014565@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: d08ffbd70e72 - releng/13.2 - _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/releng/13.2 X-Git-Reftype: branch X-Git-Commit: d08ffbd70e7245f94af4b103f64c7ecab6da9d7f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.2 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=d08ffbd70e7245f94af4b103f64c7ecab6da9d7f commit d08ffbd70e7245f94af4b103f64c7ecab6da9d7f Author: Warner Losh AuthorDate: 2023-03-22 02:25:58 +0000 Commit: Warner Losh CommitDate: 2023-03-23 06:39:30 +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 Approved by: re@ (gjb) (cherry picked from commit ed52baf51bd142b5e32701842346452a7ebe37a5) (cherry picked from commit 4ccd5e64b76bbaa874c50755d17394a7ed195f93) --- 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