aboutsummaryrefslogtreecommitdiff
path: root/src/common/compat.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-11-09 10:28:43 -0500
committerNick Mathewson <nickm@torproject.org>2011-11-09 10:28:43 -0500
commit9452b65680deee698dbc8c4eae929aba3b75b198 (patch)
tree439725f628c985a538c1ed8222499fe6d5f7c66f /src/common/compat.h
parentd4489a2851f6bfe429c33578e2f4f9c127598b8e (diff)
parent0cc7a63fc0f8e23e0dc01a36de9a369671bdd4d5 (diff)
downloadtor-9452b65680deee698dbc8c4eae929aba3b75b198.tar
tor-9452b65680deee698dbc8c4eae929aba3b75b198.tar.gz
Merge remote-tracking branch 'origin/maint-0.2.2'
Diffstat (limited to 'src/common/compat.h')
-rw-r--r--src/common/compat.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/common/compat.h b/src/common/compat.h
index 045f414c6..b005dd297 100644
--- a/src/common/compat.h
+++ b/src/common/compat.h
@@ -180,6 +180,10 @@ extern INLINE double U64_TO_DBL(uint64_t x) {
/** Expands to a syntactically valid empty statement. */
#define STMT_NIL (void)0
+/** Expands to a syntactically valid empty statement, explicitly (void)ing its
+ * argument. */
+#define STMT_VOID(a) while (0) { (void)(a); }
+
#ifdef __GNUC__
/** STMT_BEGIN and STMT_END are used to wrap blocks inside macros so that
* the macro can be used as if it were a single C statement. */
@@ -618,7 +622,7 @@ void tor_threads_init(void);
#else
#define tor_mutex_new() ((tor_mutex_t*)tor_malloc(sizeof(int)))
#define tor_mutex_init(m) STMT_NIL
-#define tor_mutex_acquire(m) STMT_NIL
+#define tor_mutex_acquire(m) STMT_VOID(m)
#define tor_mutex_release(m) STMT_NIL
#define tor_mutex_free(m) STMT_BEGIN tor_free(m); STMT_END
#define tor_mutex_uninit(m) STMT_NIL