Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/sys add __empty
details: https://anonhg.NetBSD.org/src/rev/3fe770f6d16a
branches: trunk
changeset: 351258:3fe770f6d16a
user: christos <christos%NetBSD.org@localhost>
date: Wed Feb 08 16:13:04 2017 +0000
description:
add __empty
diffstat:
sys/sys/cdefs.h | 16 +++++++++++++++-
1 files changed, 15 insertions(+), 1 deletions(-)
diffs (30 lines):
diff -r c594fe8a40df -r 3fe770f6d16a sys/sys/cdefs.h
--- a/sys/sys/cdefs.h Wed Feb 08 16:12:59 2017 +0000
+++ b/sys/sys/cdefs.h Wed Feb 08 16:13:04 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cdefs.h,v 1.129 2016/12/27 21:52:01 christos Exp $ */
+/* $NetBSD: cdefs.h,v 1.130 2017/02/08 16:13:04 christos Exp $ */
/* * Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
@@ -306,6 +306,20 @@
#define __unreachable() do {} while (/*CONSTCOND*/0)
#endif
+/*
+ * To be used when an empty body is required like:
+ *
+ * #ifdef DEBUG
+ * # define dprintf(a) printf(a)
+ * #else
+ * # define dprintf(a) __empty
+ * #endif
+ *
+ * We use ((void)0) instead of do {} while (/*CONSTCOND*/0) so that it
+ * works on , expressions.
+ */
+#define __empty ((void)0)
+
#if defined(__cplusplus)
#define __BEGIN_EXTERN_C extern "C" {
#define __END_EXTERN_C }
Home |
Main Index |
Thread Index |
Old Index