summaryrefslogtreecommitdiff
path: root/evthread-internal.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2009-04-05 02:44:04 +0000
committerNick Mathewson <nickm@torproject.org>2009-04-05 02:44:04 +0000
commitd13b59ce372f167135ea1eaec1c6d7e399e9777d (patch)
treeaae3fbb03e2890cfd79e310d6a72d715266b3b68 /evthread-internal.h
parent70ee390fc9696f555d383b64541c5fe205443d72 (diff)
downloadlibevent-d13b59ce372f167135ea1eaec1c6d7e399e9777d.tar.gz
Fix build with thread support disabled, and make no-op macros a little more no-oppy.
svn:r1133
Diffstat (limited to 'evthread-internal.h')
-rw-r--r--evthread-internal.h22
1 files changed, 17 insertions, 5 deletions
diff --git a/evthread-internal.h b/evthread-internal.h
index 1b803b1d..4a3c515a 100644
--- a/evthread-internal.h
+++ b/evthread-internal.h
@@ -112,13 +112,25 @@ extern void (*_evthread_lock_free_fn)(void *);
(base)->lock); \
} while (0)
#else /* _EVENT_DISABLE_THREAD_SUPPORT */
+
+/* No-op statement. */
+#define _EV_NIL_STMT ((void)0)
+
#define EVTHREAD_GET_ID() 1
-#define EVTHREAD_ALLOC_LOCK(lockvar)
-#define EVTHREAD_FREE_LOCK(lockvar)
+#define EVTHREAD_ALLOC_LOCK(lockvar) _EV_NIL_STMT
+#define EVTHREAD_FREE_LOCK(lockvar) _EV_NIL_STMT
+
+#define EVLOCK_LOCK(lockvar, mode) _EV_NIL_STMT
+#define EVLOCK_UNLOCK(lockvar, mode) _EV_NIL_STMT
+#define EVLOCK_LOCK2(lock1,lock2,mode1,mode2) _EV_NIL_STMT
+#define EVLOCK_UNLOCK2(lock1,lock2,mode1,mode2) _EV_NIL_STMT
+
+#define EVBASE_IN_THREAD(base) 1
+#define EVBASE_ACQUIRE_LOCK(base, mode, lock) _EV_NIL_STMT
+#define EVBASE_RELEASE_LOCK(base, mode, lock) _EV_NIL_STMT
+
+#undef _EV_NIL_STMT
-#define EVBASE_IN_THREAD() 1
-#define EVBASE_ACQUIRE_LOCK(base, mode, lock)
-#define EVBASE_RELEASE_LOCK(base, mode, lock)
#endif
#ifdef __cplusplus