Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/share/misc document how we want to use __nothing
details: https://anonhg.NetBSD.org/src/rev/e90b9aa36f93
branches: trunk
changeset: 447936:e90b9aa36f93
user: christos <christos%NetBSD.org@localhost>
date: Mon Jan 28 17:29:44 2019 +0000
description:
document how we want to use __nothing
diffstat:
share/misc/style | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
diffs (35 lines):
diff -r 081f7d14d181 -r e90b9aa36f93 share/misc/style
--- a/share/misc/style Mon Jan 28 16:55:57 2019 +0000
+++ b/share/misc/style Mon Jan 28 17:29:44 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: style,v 1.53 2016/05/23 11:41:06 salazar Exp $ */
+/* $NetBSD: style,v 1.54 2019/01/28 17:29:44 christos Exp $ */
/*
* The revision control tag appears first, with a blank line after it.
@@ -30,7 +30,7 @@
#include <sys/cdefs.h>
__COPYRIGHT("@(#) Copyright (c) 2008\
The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: style,v 1.53 2016/05/23 11:41:06 salazar Exp $");
+__RCSID("$NetBSD: style,v 1.54 2019/01/28 17:29:44 christos Exp $");
/*
* VERY important single-line comments look like this.
@@ -154,6 +154,16 @@
} et;
/*
+ * Sometimes we want a macro to be conditionally defined for debugging
+ * and expand to nothing (but still as statement) when we are not debugging:
+ */
+#ifdef FOO_DEBUG
+# define DPRINTF(...) printf(__VA_ARGS__)
+#else
+# define DPRINTF(...) __nothing
+#endif
+
+/*
* When declaring variables in structures, declare them organized by use in
* a manner to attempt to minimize memory wastage because of compiler alignment
* issues, then by size, and then by alphabetical order. E.g, don't use
Home |
Main Index |
Thread Index |
Old Index