From nobody Wed Mar 22 02:26:21 2023 X-Original-To: dev-commits-src-main@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 4PhC5T4xBMz418pV; Wed, 22 Mar 2023 02:26:21 +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 4PhC5T4S7cz3P5q; Wed, 22 Mar 2023 02:26:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679451981; 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=oHtcqtMOC/LSCt5ocDsvhDs6Kt5ODdkCg4FrjkUZWi8=; b=KCzzloBSJ1PpQcY/JVZaUZhZRjZ9aXpaExZdWoTUA3LqhK+mCoQT+7hqLzHkZCUmUT7WBj lZwUmpwogEZNXYr+UqRVhrWHDsDXyj3iHXstNGkQIpRd9ks/yGSqbqZ6W15K1dIgw/u5dq algAF+zipP4cc1ctpOVgRHOmVqws5EtfXsAmVXeQopZsg4wFf0mcq/kSL2CAzidUaYgncu rg5liQg9PYCZShD5XCPQxJgb6cPWnDh4N3qLqbqg+GjI8o/cFEdMqfOcGKO94fxtfsQCZr SZ6AE2XVz0fFPN6jaA4tjjbiOeI0DHECyg3cqDvw59eNDHEyN3cwL+EHMZ3t0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679451981; 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=oHtcqtMOC/LSCt5ocDsvhDs6Kt5ODdkCg4FrjkUZWi8=; b=RhwsXghWntXE92AF5mEUYiEbkDyRZxG0H+GP9pPE0GhADp81FIlBn+tY3qjS+5lXJ3H0dV Kn9HBT73+hJ6ilQHQc8nm2v1LLBSczXJM9hn95FgcWuVZjkjxNNVN/AfqbgV2V4KN5TCeL IqJnFiOEQZEy+MQiivj0ow+ntDJqkN/TkIruw0Jh+H5i3JKfUvfD5oVTk1XCiqNt/QwD/X ygg66NB9kBORqTmMyVvDdP+ZVxiaXALzbCeSfE8SntdfcSsJbLj9MHrR1qe6zSZRPtq8g4 aqyEDJZ6d/xW0K5rm6eSQUexIHZidKZEOtOFMoNs9z+v7f2LTJMj3vnLs/6vLA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679451981; a=rsa-sha256; cv=none; b=GlCL0xJ4Ji2Y1gLB7fkXHKDsc8GOyrmHjfiFGooEcZMHm24M1MkcmxC6j7gaR21RMkboB5 QPAmiXPcs6Zaic3/X4cSoCxMn7fTVa+X0fk+uaHvzpQBAViBx3b4l9WL5jbPeQKSUQ6YZV DhdVd66lHm9+8rqgEqmTGloAsQdaNC7ixSudYqim27pRGnyuCysFN32HeNsReD7baUULPJ LtCIH9oK69qm5xJkBPBUN8gIRIQCPQUVPmbwGC8FgbbkuKOJm+Xvkunf89sSWjDET5G4sI vx2bemGoXKJDi2u8IXsuL8/i9O3NoQN+5+EryVmXnpnyZ8ytw4v1JiSgysh84Q== 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 4PhC5T3Vh3zc1q; Wed, 22 Mar 2023 02:26:21 +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 32M2QLlB029464; Wed, 22 Mar 2023 02:26:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32M2QLoe029463; Wed, 22 Mar 2023 02:26:21 GMT (envelope-from git) Date: Wed, 22 Mar 2023 02:26:21 GMT Message-Id: <202303220226.32M2QLoe029463@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: ed52baf51bd1 - main - _endian.h: Include sys/ctypes.h for visibility macros List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: ed52baf51bd142b5e32701842346452a7ebe37a5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N 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