]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Use compat_compiler to restore macros in torerr.h
authorNick Mathewson <nickm@torproject.org>
Wed, 20 Jun 2018 17:51:21 +0000 (13:51 -0400)
committerNick Mathewson <nickm@torproject.org>
Wed, 20 Jun 2018 19:08:06 +0000 (15:08 -0400)
src/common/torerr.h

index 09d8eeb76530c732d51bad23400c5c6c7aa0cff4..10d9f481c08b841e3cf9ffc846e30460ab446432 100644 (file)
 #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,