From: Brian Aker Date: Tue, 8 Jan 2013 03:58:53 +0000 (-0500) Subject: Update assert rule. X-Git-Tag: 1.0.16~15^2~1 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=1d55efc656261bb03a5ec018af7c2e34d6172b8b;p=awesomized%2Flibmemcached Update assert rule. --- diff --git a/libmemcached/assert.hpp b/libmemcached/assert.hpp index f2fc158d..b7124c91 100644 --- a/libmemcached/assert.hpp +++ b/libmemcached/assert.hpp @@ -37,20 +37,21 @@ #pragma once -#ifdef _WIN32 -# include +#ifdef NDEBUG +# define assert_msg(__expr, __mesg) (void)(__expr); (void)(__mesg); +# define assert_vmsg(__expr, __mesg, ...) (void)(__expr); (void)(__mesg); #else -# include -#endif -#include +# ifdef _WIN32 +# include +# else +# include +# endif -#ifdef NDEBUG -#define assert_msg(__expr, __mesg) (void)(__expr); (void)(__mesg); -#define assert_vmsg(__expr, __mesg, ...) (void)(__expr); (void)(__mesg); -#else +# include +# include -#define assert_msg(__expr, __mesg) \ +# define assert_msg(__expr, __mesg) \ do \ { \ if (not (__expr)) \ @@ -61,7 +62,7 @@ do \ } \ } while (0) -#define assert_vmsg(__expr, __mesg, ...) \ +# define assert_vmsg(__expr, __mesg, ...) \ do \ { \ if (not (__expr)) \ @@ -76,4 +77,4 @@ do \ } \ } while (0) -#endif +#endif // NDEBUG