git: faaeb6e62ae2 - main - libnetbsd: import the `__nothing` macro

From: Enji Cooper <ngie_at_FreeBSD.org>
Date: Sun, 15 Feb 2026 18:44:14 UTC
The branch main has been updated by ngie:

URL: https://cgit.FreeBSD.org/src/commit/?id=faaeb6e62ae2f7371ac3ed37aae102f8e066a4b9

commit faaeb6e62ae2f7371ac3ed37aae102f8e066a4b9
Author:     Enji Cooper <ngie@FreeBSD.org>
AuthorDate: 2026-02-15 18:41:43 +0000
Commit:     Enji Cooper <ngie@FreeBSD.org>
CommitDate: 2026-02-15 18:43:00 +0000

    libnetbsd: import the `__nothing` macro
    
    This macro is widely used in new NetBSD tests. Please see the comment
    next to the imported macro for more details on its use.
    
    Obtained from:  NetBSD (c26cc77b3a0b2)
    MFC after:      1 week
---
 lib/libnetbsd/sys/cdefs.h | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/lib/libnetbsd/sys/cdefs.h b/lib/libnetbsd/sys/cdefs.h
index 8da812693961..fcc3cc6f15be 100644
--- a/lib/libnetbsd/sys/cdefs.h
+++ b/lib/libnetbsd/sys/cdefs.h
@@ -1,4 +1,3 @@
-
 /*-
  * SPDX-License-Identifier: BSD-3-Clause
  *
@@ -81,4 +80,18 @@
 #define	__BITS(__m, __n)	\
 	((__BIT(MAX((__m), (__n)) + 1) - 1) ^ (__BIT(MIN((__m), (__n))) - 1))
 
+/*
+ * To be used when an empty body is required like:
+ *
+ * #ifdef DEBUG
+ * # define dprintf(a) printf(a)
+ * #else
+ * # define dprintf(a) __nothing
+ * #endif
+ *
+ * We use ((void)0) instead of do {} while (0) so that it
+ * works on , expressions.
+ */
+#define __nothing	(/*LINTED*/(void)0)
+
 #endif /* _LIBNETBSD_SYS_CDEFS_H_ */