From nobody Mon Nov 27 22:00:46 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 4SfKKB1vWjz52Gkl; Mon, 27 Nov 2023 22:00:46 +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 4SfKKB1QG9z3H8S; Mon, 27 Nov 2023 22:00:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1701122446; 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=686CDhSZ8g3Mi4GD5y3r2EsdGyPq3VyKcwCu2Xk07rk=; b=Sn9HaBasoxUavayqsUyQ1Xj9o5MEokQLKQogwoeAyrkXdLzBtmQx60qp1cD9NSTMmz3+EJ qNcS0kAbtvRI3z03AW3QaOphyBq9ovHnQolhV/RRMRK6MTFHTQTPQIOeRZkBWih6xkpriG +eTc6d6lsshZxWmDPGk1b0T+JZ6dNVcz3zXHte3pxkkqbCN4f5krMlmOyrhOBCwq9f4Iry yaDX3VD9gvxcM2ajwmhYpHaEJifZP1YngOTNk+rgh20JmyK3vTlH2ptR9qdztO5I7hL5R8 ukjEi9w1t1KAbetF0eLy22VKq437dSMHyion3PRxPWQHh12OpfTLl77NM9PWbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1701122446; 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=686CDhSZ8g3Mi4GD5y3r2EsdGyPq3VyKcwCu2Xk07rk=; b=s90Ja7A4iu5Wx1XbDd0TgnunktP8xoTQlCoaPh5UOz22bX3SOtHjyNKERu9hpL1RuZyoOt O6qpVeTWMvBy3zImGYzFJ4CQmey6eAku5ikJfQDd+di3Ldnw8gGTGtnf2qKlqrGMdHrVzG /ReyygOxFnkwj1g051+SSTaZUD5h0M8XnoOU1EFX+aYHDMsScaQCpoRL9pbfDjYlkkrToI yfXEUvWNaR2Ccbfeguv8yfRpqB40EF55OWILiG9IChPz/XBJiUDHdEaHWVDJVd5veDI1nG q+5JBFm/VydJ/bkjPHkbPOIsmLq1gFEfnexffhKqkJtaCOcNVs1mQvJOrH2Dlg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1701122446; a=rsa-sha256; cv=none; b=iGW0Tn7v+w1UbjHg8NAj2A3OED40JIu4FYPhMiMzgf5gZ5/dEk7EC/U+r918eT/ZxYuHEM ywzYvUT3ikumlOhM13N7U1mZHsk/Fpp1vpbMm83fkg5gTEUvhnvnZqtzQZC10Ky9gAtcqC DHj0tvAhqfjJpV2nEuOsJr51dFItLYsxvGhla0cgWU5GWCCwcCbDgo2MQ3H5oE6j08F7pc OxEfKas8ENEjTEDS86iET0qAlVUvip3MNmnHMI6mBl77JUPK2wuk4KMYz0cpq0XtfJh0No As+wKgOoTdNxUi29qjv+JTDpDipy22DVNF0kWZGR6eTCbWs0T20OAFmmGktxRQ== 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 4SfKKB0TfJzwCl; Mon, 27 Nov 2023 22:00:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3ARM0k4G063801; Mon, 27 Nov 2023 22:00:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3ARM0khR063798; Mon, 27 Nov 2023 22:00:46 GMT (envelope-from git) Date: Mon, 27 Nov 2023 22:00:46 GMT Message-Id: <202311272200.3ARM0khR063798@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: 8b923102f957 - main - Revert "cdefs: Remove __func__ define" 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: 8b923102f957e72c686d41075ce040f61e64fe6f Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=8b923102f957e72c686d41075ce040f61e64fe6f commit 8b923102f957e72c686d41075ce040f61e64fe6f Author: Warner Losh AuthorDate: 2023-11-27 18:47:21 +0000 Commit: Warner Losh CommitDate: 2023-11-27 21:59:54 +0000 Revert "cdefs: Remove __func__ define" This reverts commit 17a238a15fbed01477fbc54744d35cbccdb65871. There were too many other changes accidentally mixed in. Sponsored by: Netflix --- sys/sys/cdefs.h | 40 ++++++++++++++++++++++++++++++++++++-- tests/sys/opencrypto/cryptodevh.py | 4 ++++ 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index bcbf418f9323..c5b6190077b3 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -96,9 +96,14 @@ /* * The __CONCAT macro is used to concatenate parts of symbol names, e.g. * with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo. + * The __CONCAT macro is a bit tricky to use if it must work in non-ANSI + * mode -- there must be no spaces between its arguments, and for nested + * __CONCAT's, all the __CONCAT's must be at the left. __CONCAT can also + * concatenate double-quoted strings produced by the __STRING macro, but + * this only works with ANSI C. * * __XSTRING is like __STRING, but it expands any macros in its argument - * first. + * first. It is only available with ANSI C. */ #if defined(__STDC__) || defined(__cplusplus) #define __P(protos) protos /* full-blown ANSI C */ @@ -117,7 +122,33 @@ #define __inline /* delete GCC keyword */ #endif /* ! __CC_SUPPORTS___INLINE */ #endif /* !__cplusplus */ -#endif /* __STDC__ || __cplusplus */ + +#else /* !(__STDC__ || __cplusplus) */ +#define __P(protos) () /* traditional C preprocessor */ +#define __CONCAT(x,y) x/**/y +#define __STRING(x) "x" + +#if !defined(__CC_SUPPORTS___INLINE) +#define __const /* delete pseudo-ANSI C keywords */ +#define __inline +#define __signed +#define __volatile +/* + * In non-ANSI C environments, new programs will want ANSI-only C keywords + * deleted from the program and old programs will want them left alone. + * When using a compiler other than gcc, programs using the ANSI C keywords + * const, inline etc. as normal identifiers should define -DNO_ANSI_KEYWORDS. + * When using "gcc -traditional", we assume that this is the intent; if + * __GNUC__ is defined but __STDC__ is not, we leave the new keywords alone. + */ +#ifndef NO_ANSI_KEYWORDS +#define const /* delete ANSI C keywords */ +#define inline +#define signed +#define volatile +#endif /* !NO_ANSI_KEYWORDS */ +#endif /* !__CC_SUPPORTS___INLINE */ +#endif /* !(__STDC__ || __cplusplus) */ /* * Compiler-dependent macros to help declare dead (non-returning) and @@ -312,6 +343,11 @@ #define __unreachable() ((void)0) #endif +/* XXX: should use `#if __STDC_VERSION__ < 199901'. */ +#if !__GNUC_PREREQ__(2, 7) +#define __func__ NULL +#endif + #if (defined(__GNUC__) && __GNUC__ >= 2) && !defined(__STRICT_ANSI__) || __STDC_VERSION__ >= 199901 #define __LONG_LONG_SUPPORTED #endif diff --git a/tests/sys/opencrypto/cryptodevh.py b/tests/sys/opencrypto/cryptodevh.py index 2d723999abc7..9607bcd4d115 100644 --- a/tests/sys/opencrypto/cryptodevh.py +++ b/tests/sys/opencrypto/cryptodevh.py @@ -29,6 +29,10 @@ def __STRING(x): return #x def __XSTRING(x): return __STRING(x) +def __P(protos): return () + +def __STRING(x): return "x" + def __aligned(x): return __attribute__((__aligned__(x))) def __section(x): return __attribute__((__section__(x)))