]> xenbits.xensource.com Git - libvirt.git/commitdiff
build: simplify use of verify
authorEric Blake <eblake@redhat.com>
Fri, 26 Aug 2011 16:17:48 +0000 (10:17 -0600)
committerEric Blake <eblake@redhat.com>
Tue, 30 Aug 2011 15:23:20 +0000 (09:23 -0600)
Back in 2008 when this line of util.h was written, gnulib's verify
module didn't allow the use of multiple verify() in one file
in combination with our choice of gcc -W options.  But that has
since been fixed in gnulib, and newer gnulib even maps verify()
to the C1x feature of _Static_assert, which gives even nicer
diagnostics with a new enough compiler, so we might as well go
with the simpler verify().

* src/util/util.h (VIR_ENUM_IMPL): Use simpler verify, now that
gnulib module is smarter.

src/util/util.h

index 6e6265f5d9ea0cec7142dee362f88313cb94aa7d..908ba7bcf87f2119bf31464f7211a1f3e9134f50 100644 (file)
@@ -202,7 +202,7 @@ const char *virEnumToString(const char *const*types,
 
 # define VIR_ENUM_IMPL(name, lastVal, ...)                               \
     static const char *const name ## TypeList[] = { __VA_ARGS__ };      \
-    extern int (* name ## Verify (void)) [verify_true (ARRAY_CARDINALITY(name ## TypeList) == lastVal)]; \
+    verify(ARRAY_CARDINALITY(name ## TypeList) == lastVal);             \
     const char *name ## TypeToString(int type) {                        \
         return virEnumToString(name ## TypeList,                        \
                                ARRAY_CARDINALITY(name ## TypeList),     \