aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-06-20 13:51:21 -0400
committerNick Mathewson <nickm@torproject.org>2018-06-20 15:08:06 -0400
commit3246c9648c796ebfd591d0d1225fc6124413520b (patch)
tree5ea2006479ac6819fc6ebaa1d6740456f658f40e /src
parentaa490e971b95517b75875f5b1ef8c521bfae4040 (diff)
downloadtor-3246c9648c796ebfd591d0d1225fc6124413520b.tar.gz
tor-3246c9648c796ebfd591d0d1225fc6124413520b.zip
Use compat_compiler to restore macros in torerr.h
Diffstat (limited to 'src')
-rw-r--r--src/common/torerr.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/common/torerr.h b/src/common/torerr.h
index 09d8eeb765..10d9f481c0 100644
--- a/src/common/torerr.h
+++ b/src/common/torerr.h
@@ -13,19 +13,21 @@
#ifndef TOR_TORERR_H
#define TOR_TORERR_H
+#include "common/compat_compiler.h"
+
/* The raw_assert...() variants are for use within code that can't call
* tor_assertion_failed_() because of call circularity issues. */
-#define raw_assert(expr) do { \
+#define raw_assert(expr) STMT_BEGIN \
if (!(expr)) { \
tor_raw_assertion_failed_msg_(__FILE__, __LINE__, #expr, NULL); \
abort(); \
} \
- } while (0)
+ STMT_END
#define raw_assert_unreached(expr) raw_assert(0)
-#define raw_assert_unreached_msg(msg) do { \
+#define raw_assert_unreached_msg(msg) STMT_BEGIN \
tor_raw_assertion_failed_msg_(__FILE__, __LINE__, "0", (msg)); \
abort(); \
- } while (0)
+ STMT_END
void tor_raw_assertion_failed_msg_(const char *file, int line,
const char *expr,