[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[Libevent-users] _EVUTIL_NIL_CONDITION cause VC2010 error C2070



Hi Jones,

Your commit b63ab17 caused VC2010 error C2070:

bufferevent_async.c(409) : error C2070: 'unsigned int': illegal sizeof operand
bufferevent_async.c(434) : error C2070: 'unsigned int': illegal sizeof operand
bufferevent_async.c(473) : error C2070: 'unsigned int': illegal sizeof operand

Because you can not use sizeof on bitfield, here is my patch:

diff --git a/util-internal.h b/util-internal.h
index cb76ee4..9cd6a1c 100644
--- a/util-internal.h
+++ b/util-internal.h
@@ -181,7 +181,11 @@ long _evutil_weakrand(void);

 /* Replacement for assert() that calls event_errx on failure. */
 #ifdef NDEBUG
+#ifdef _MSC_VER
+#define EVUTIL_ASSERT(cond) _EVUTIL_NIL_STMT
+#else
 #define EVUTIL_ASSERT(cond) _EVUTIL_NIL_CONDITION(cond)
+#endif
 #define EVUTIL_FAILURE_CHECK(cond) 0
 #else
 #define EVUTIL_ASSERT(cond)

Regards,
Dongsheng Song
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.