From: Simon McVittie Date: Mon, 15 Aug 2011 08:52:04 +0000 (+0100) Subject: Fix compilation of (no-op) alignment assertions on non-gcc X-Git-Tag: dbus-1.4.16~20 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8c83422b5fde109b2af462d8d383cfadad35a99a;p=platform%2Fupstream%2Fdbus.git Fix compilation of (no-op) alignment assertions on non-gcc do {} while (0) isn't valid at file scope, so the non-gcc code path was broken; in particular, this affected MSVC. Reviewed-by:Ralf Habacker --- diff --git a/dbus/dbus-marshal-basic.c b/dbus/dbus-marshal-basic.c index 215cc95..b139853 100644 --- a/dbus/dbus-marshal-basic.c +++ b/dbus/dbus-marshal-basic.c @@ -33,7 +33,10 @@ # define _DBUS_ASSERT_ALIGNMENT(type, op, val) \ _DBUS_STATIC_ASSERT (__extension__ __alignof__ (type) op val) #else -# define _DBUS_ASSERT_ALIGNMENT(type, op, val) do { } while (0) + /* not gcc, so probably no alignof operator: just use a no-op statement + * that's valid in the same contexts */ +# define _DBUS_ASSERT_ALIGNMENT(type, op, val) \ + _DBUS_STATIC_ASSERT (TRUE) #endif /* True by definition, but just for completeness... */