From d05c6def7e6be47a2c60f13cba23e51c1ebddd2f Mon Sep 17 00:00:00 2001
From: Nick Mathewson <nickm@torproject.org>
Date: Sat, 1 Jan 2011 21:37:21 -0500
Subject: [PATCH] Fix compilation on Windows with NDEBUG

Dongsheng Song reports that when building on windows with NDEBUG, you
run into an attempt to do EVUTIL_ASSERT(x) where x is a bitfield,
which turns into _EVUTIL_NIL_CONDITION(x), which takes sizeof(x),
which is illegal.  This patch fixes _EVUTIL_NIL_CONDITION to work on
bitfields too.
---
 util-internal.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/util-internal.h b/util-internal.h
index cb76ee4..7a4128e 100644
--- a/util-internal.h
+++ b/util-internal.h
@@ -54,7 +54,7 @@ extern "C" {
 #define _EVUTIL_NIL_STMT ((void)0)
 /* Suppresses the compiler's "unused variable" warnings for unused assert. */
 #define _EVUTIL_NIL_CONDITION(condition) do { \
-	(void)sizeof(condition); \
+	(void)sizeof(!(condition));  \
 } while(0)
 
 /* Internal use only: macros to match patterns of error codes in a
-- 
1.7.2.2

