[libvirt] [PATCH 8/9] Require a semicolon for VIR_ONCE_GLOBAL_INIT calls

Cole Robinson crobinso at redhat.com
Wed Jan 23 22:46:15 UTC 2019


Add a dummy struct definition at the end of the macro, so
the compiler will require callers to add a semicolon.

Signed-off-by: Cole Robinson <crobinso at redhat.com>
---
 src/util/virthread.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/util/virthread.h b/src/util/virthread.h
index d15dfc6a2d..218d1fcd3f 100644
--- a/src/util/virthread.h
+++ b/src/util/virthread.h
@@ -212,5 +212,6 @@ int virThreadLocalSet(virThreadLocalPtr l, void*) ATTRIBUTE_RETURN_CHECK;
  \
         return 0; \
     } \
+    struct classname ## EatSemicolon
 
 #endif /* LIBVIRT_VIRTHREAD_H */
-- 
2.20.1




More information about the libvir-list mailing list