[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[Libevent-users] _EVUTIL_NIL_CONDITION cause VC2010 error C2070
- To: Evan Jones <evanj@xxxxxxx>
- Subject: [Libevent-users] _EVUTIL_NIL_CONDITION cause VC2010 error C2070
- From: Dongsheng Song <dongsheng.song@xxxxxxxxx>
- Date: Sun, 26 Dec 2010 11:21:04 +0800
- Cc: Libevent-users <libevent-users@xxxxxxxx>
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: libevent-users-outgoing@xxxxxxxx
- Delivered-to: libevent-users@xxxxxxxx
- Delivery-date: Sat, 25 Dec 2010 22:21:31 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:from:date :message-id:subject:to:cc:content-type; bh=MawG/YenLoevvjXJDQ18NuP/ivcBbdK5dnnjgasVnWM=; b=XXYEppYXsJF1zj1KXR3mbSqdtKyje0zdt74T08sSx5CV1sePFZZh4q6oiJi1v2mM+r 8IQ+7G1nQerqJhIgsFLT5iUdvlBOLFVP5OXrKfJS245sB2e7A5wk7ine/7sgBQsDM2+3 ZUCMEWfTh/ZPnRPLsuQbTP3gVNc4x00EgK1/U=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:cc:content-type; b=YZjcfY71gHKwE6jgXLOwVdBHpAvIgxL/n1uIwhoJ5IG3ZusyyaXQgYpPfhYd4X8lBO kWSYhBROyBz5ro4UxqXsKsKqFTbUn176y6XlROTww2EVno0mF07Vs/5lr+zZ7SowiLbG h95gf/OSPml64pyOkiC1sj+DkbyFid48CI6Ng=
- Reply-to: libevent-users@xxxxxxxxxxxxx
- Sender: owner-libevent-users@xxxxxxxxxxxxx
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.