From nobody Sun May 17 00:29:37 2026 X-Original-To: dev-commits-src-branches@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 4gJ1z52Xpkz6dM0P for ; Sun, 17 May 2026 00:29:37 +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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gJ1z51pLbz4DYZ for ; Sun, 17 May 2026 00:29:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1778977777; 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=q+WhIpwUGHV63I1nxs7UdFc3C+4HhnEIEYUVSADrji8=; b=qX7ra8Mckf+ZQIPEKoChhKHb5vyCqAJijlI0MYseob0kmZnWVzP2cvNNjce4tNivHeA8fs cI7nCJHsZVBV5y3eWImj3M9RFTVlmGldK9J58I1kky6tSQft+l0j4s1zPay1W+dNa53GN0 nW+dCxT3o/0hEWoSODbEOWjYHl0a5UWQDgU9BJwsQHgHZQwzif6eWTYpG+WbDlXcnGO4JK dDH93eDgrdidpGzdHpDllNZ5xrZVTn3Laddw7PBLqS0gNh/UFWMeRJFyNDBJlyL/7otxQC Egdy5pwxjQsXq5/WkJCWXhtrp2zf3s3H3n9ODRciug55kLa2Mwf74umDbsYjSg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1778977777; a=rsa-sha256; cv=none; b=q2+BOHx09utKFFbliG1sj+8iwhTUyoyw1nQSyQ9aRm63crWNOHxCcA3wvuzJ3Scbckj52T 24mt/gFbuThNXfVjlyZFyCbWkJCoCR+KtDyb2rfu0U+ehIYdkJtOFH/3DkR+w6dTOKfq5B jAseidkB7kOthWuwVjdTiyP3Tg9/i3Rt1BEkNFg67criH1oNrCUU1qbd2XzGvsGnCJxC1P q9F2jg8cieZX9lOOeRtsOH4yw8GRa6qwEjAjJqxmDmCbBSo3dOQb1DkjpOg3F5RU4wdbRt iKFLwiY5YRyrpQjSyZv0tT79fkjDsYdREg4klNsaHza9YZwcK7/+7sppH5p4Jg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1778977777; 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=q+WhIpwUGHV63I1nxs7UdFc3C+4HhnEIEYUVSADrji8=; b=fx5tumjsKOIvsKuAnPi2pDou0YmVbKLyvZiVuX6wS71gus5P/wS8KlLBlUbFYH0eSr71rB q0qJFEvHxg4nR4cX/6EgqRyb6DO/Lb8sGm3QKJPmvnYO2UDEQua4vlR8FwSclTNDvt3OuJ GFR0xnkaUR4TBgHHfv8pGGG4AoU4vhZuqyObpRQBdVqptdE9y45r+vzL8y3O8pD9KjFf1u BSDk9R8SgLkxDDK9w45DCWWP/+gNv+HIjRdJZLOXI57dkRAAbAzmknOwC+AXr3D2fMbFoI +5JpXBqHq0bJjSutAoDyFXhX9+uYBERClCYQUaOo6qHGOMkiOx/3JwlH2hPzoA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gJ1z517qgz27W for ; Sun, 17 May 2026 00:29:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 20554 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 17 May 2026 00:29:37 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: c34ca8fb21fa - stable/15 - sys/cdefs.h: move __BEGIN_DECLS/__END_DECLS into a helper sys/_decls.h List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: c34ca8fb21fa0cd01b314a0cb156f52a73bca562 Auto-Submitted: auto-generated Date: Sun, 17 May 2026 00:29:37 +0000 Message-Id: <6a090bf1.20554.1ad69150@gitrepo.freebsd.org> The branch stable/15 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c34ca8fb21fa0cd01b314a0cb156f52a73bca562 commit c34ca8fb21fa0cd01b314a0cb156f52a73bca562 Author: Konstantin Belousov AuthorDate: 2026-05-08 14:13:35 +0000 Commit: Konstantin Belousov CommitDate: 2026-05-17 00:27:48 +0000 sys/cdefs.h: move __BEGIN_DECLS/__END_DECLS into a helper sys/_decls.h (cherry picked from commit ea72f6d5a8b9386a09e23fbdc933effb007ca899) --- sys/sys/_decls.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++ sys/sys/cdefs.h | 8 +------- tools/build/Makefile | 1 + 3 files changed, 48 insertions(+), 7 deletions(-) diff --git a/sys/sys/_decls.h b/sys/sys/_decls.h new file mode 100644 index 000000000000..2ef61671dd70 --- /dev/null +++ b/sys/sys/_decls.h @@ -0,0 +1,46 @@ +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Berkeley Software Design, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _SYS__DECLS_H_ +#define _SYS__DECLS_H_ + +#if defined(__cplusplus) +#define __BEGIN_DECLS extern "C" { +#define __END_DECLS } +#else +#define __BEGIN_DECLS +#define __END_DECLS +#endif + +#endif diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index 132d4809b0ed..916668a52fc0 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -61,13 +61,7 @@ #define __has_builtin(x) 0 #endif -#if defined(__cplusplus) -#define __BEGIN_DECLS extern "C" { -#define __END_DECLS } -#else -#define __BEGIN_DECLS -#define __END_DECLS -#endif +#include /* * This code has been put in place to help reduce the addition of diff --git a/tools/build/Makefile b/tools/build/Makefile index e1ccfa21d356..b0506806ba18 100644 --- a/tools/build/Makefile +++ b/tools/build/Makefile @@ -353,6 +353,7 @@ DISKINCS+= ${SRCTOP}/sys/sys/disk/bsd.h .if ${.MAKE.OS} == "FreeBSD" # Needed to build most of the things below, which include sys/cdefs.h either # directly or transitively +SYSINCS+= ${SRCTOP}/sys/sys/_decls.h SYSINCS+= ${SRCTOP}/sys/sys/_visible.h SYSINCS+= ${SRCTOP}/sys/sys/cdefs.h .endif