From nobody Wed Jun 11 17:00:24 2025 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 4bHX3D3VkTz5y9CH; Wed, 11 Jun 2025 17:00:24 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHX3D2wpCz3b7X; Wed, 11 Jun 2025 17:00:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749661224; 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=1PrahWVUhBYRIrsILqAmk2rup7xZd364zXqdaE1rLhM=; b=XjLY9oUyxCE9GaWUKnhYztZWvd6tauVkOjr8s0+lbvxcYcAXP6iltXzgbFCIFxS6bvtnE1 6KHXWn8D86sfgQmKv+c3TIr4IBBNKt3CTCkNF6lNkhK5qoO8yOirntqoo1ASQSv3mQI1wT L6s8labFSbOqIZpyaBZEK/OutpdQsaCfsUMDv+5pi9d+jW9G2VeFuCCM+QYWtRUF4KWdOw MCcs7YuuKjo4BQJaWzT//AjnFQm8ztZxaOuiBwQR7+IrRRfwI8zZvRKB8IqNwIccgvwKpr p1lEQt9JzNkyxA4E8+vXgC9Eh+/ZhXQEVA/bSJWFnJGDiumrxgeyVdWg8DDzQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749661224; 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=1PrahWVUhBYRIrsILqAmk2rup7xZd364zXqdaE1rLhM=; b=uuK9JQfUl/tL/KfjC+AuBK7sOAteOTPqeXcVcNoGguGKtmHpYt2xkDWu95Czx0H/tWz5OI wgh/o5Mz7s4w/YkQAJEYls/39maFs8EPcxN3ZIo/3xiu75iGQMIXWm+gf4nA+VT0Za757F YMaa4K7bIPRAfOf8t782TZlqLQ5VtECUh3zh8wMb3d0YztQNwSAOfDWcsJ6XZo35Wrcast bv9wB+shYcRtutE2MdtpRiZPtcs7oX6upBs1T9w+UNlIXK9OIlY9V9ZiEi+dD3eEl9Kpnb gA4nnF7zO18+gfAOUr1pRJDrUrCDotXRPtSoY2deqaJ/uREIjgdvDtYUwc2Tcg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749661224; a=rsa-sha256; cv=none; b=whUFQ+FGNk4VvuMZvyrYuI9o4dKTea+DfsVNZHvXlPYC67NywplPbKC8/NdX9y+FR2mUv/ ytbq8/r8eSIwR0/NjbPfr6habl0ocZ64yjXVDE9cScwCaBzrebLpXPBoHlqrTmQtHn5meS y2pmi0xrAe14tl1YXfwAAzI97nO+RoPN6IqsXDzmZDZ0lXZYzrGOuf3gPEg+ophkiIAPBQ YE3DhR6JcpcSoQtgqB3+K1LL4NMVDaCXiNj88QFa6A8MlaHDw9UWDUfxpCocOrMn0N3QTV 2pDgRXnqqVoSZ+4G1Sn6jmUZeqiZ/h+PjtZH3Qp731elF0VFoYVUQUW3/NN+LQ== 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 4bHX3D2Prmzc2G; Wed, 11 Jun 2025 17:00:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55BH0O5I042685; Wed, 11 Jun 2025 17:00:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55BH0OXZ042682; Wed, 11 Jun 2025 17:00:24 GMT (envelope-from git) Date: Wed, 11 Jun 2025 17:00:24 GMT Message-Id: <202506111700.55BH0OXZ042682@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 2e783ea70a7a - main - stddef.h: don't include sys/cdefs.h 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2e783ea70a7a1aa0bec116451d70abd8cf05ce42 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=2e783ea70a7a1aa0bec116451d70abd8cf05ce42 commit 2e783ea70a7a1aa0bec116451d70abd8cf05ce42 Author: Brooks Davis AuthorDate: 2025-06-11 16:39:02 +0000 Commit: Brooks Davis CommitDate: 2025-06-11 16:39:02 +0000 stddef.h: don't include sys/cdefs.h Switch to sys/_visible.h for visibility macros. Prefer __builtin_offsetof over __offset. sys/cdefs.h always defines __offsetof to __builtin_offsetof so just use the latter to remove a dependency on sys/cdefs.h. Realistically, we're never going to care about a compiler that doesn't supply this builtin. Add a somewhat questionable guard around the offsetof() definition because the compiler no longer thinks it the same as a number of other redundent definitions scattered around (e.g., in the openzfs codebase). It is actually the same and those defintions likely shouldn't exist at all, but it's easy to add a guard for now. Reviewed by: imp Exp-run by: antoine (PR 286274) Pull Request: https://github.com/freebsd/freebsd-src/pull/1595 --- include/stddef.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/stddef.h b/include/stddef.h index 2255ea47a49a..3ba9a9946b01 100644 --- a/include/stddef.h +++ b/include/stddef.h @@ -32,9 +32,9 @@ #ifndef _STDDEF_H_ #define _STDDEF_H_ -#include #include #include +#include #ifndef _PTRDIFF_T_DECLARED typedef __ptrdiff_t ptrdiff_t; @@ -61,7 +61,9 @@ typedef __max_align_t max_align_t; #endif #endif -#define offsetof(type, field) __offsetof(type, field) +#ifndef offsetof +#define offsetof(type, field) __builtin_offsetof(type, field) +#endif #if __EXT1_VISIBLE /* ISO/IEC 9899:2011 K.3.3.2 */