summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2021-01-19 12:49:31 -0500
committerNick Mathewson <nickm@torproject.org>2021-01-19 12:49:31 -0500
commit5f53e013cd33f1f707a1b06653290e03bc2db095 (patch)
tree2c68d1d76bcf8256b761023af7addbfb2bc4e837 /src/lib
parent4961645254a7cb1bc0a64947995a3ec2d77bffb0 (diff)
parent6c1bc570cf49c8e493d3278fefaf0c77e289f82c (diff)
downloadtor-5f53e013cd33f1f707a1b06653290e03bc2db095.tar.gz
tor-5f53e013cd33f1f707a1b06653290e03bc2db095.zip
Merge branch 'maint-0.4.5'
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/log/util_bug.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/lib/log/util_bug.h b/src/lib/log/util_bug.h
index 6b27b36f03..684dc7c6dd 100644
--- a/src/lib/log/util_bug.h
+++ b/src/lib/log/util_bug.h
@@ -249,6 +249,17 @@
#endif /* defined(ALL_BUGS_ARE_FATAL) || ... */
+/**
+ * Use this macro after a nonfatal assertion, and before a case statement
+ * where you would want to fall through.
+ */
+#ifdef ALL_BUGS_ARE_FATAL
+#define FALLTHROUGH_UNLESS_ALL_BUGS_ARE_FATAL \
+ abort()
+#else
+#define FALLTHROUGH_UNLESS_ALL_BUGS_ARE_FATAL FALLTHROUGH
+#endif
+
/** In older code, we used tor_fragile_assert() to mark optional failure
* points. At these points, we could make some debug builds fail.
* (But release builds would continue.)