[Spice-devel] [PATCH spice-common] Define a new SPICE_VERIFY macro

Frediano Ziglio fziglio at redhat.com
Mon Nov 14 16:55:22 UTC 2016


The verify macro used currently has some problem
as it raise a warning in RHEL6.
As suggested in verify.h use verify_expr macro
to avoid the warning.

Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 common/macros.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/common/macros.h b/common/macros.h
index fe36929..1e3ded8 100644
--- a/common/macros.h
+++ b/common/macros.h
@@ -19,6 +19,8 @@
 #ifndef __MACROS_H
 #define __MACROS_H
 
+#include "verify.h"
+
 #if    __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 5)
 #define SPICE_ATTR_NORETURN                                  \
     __attribute__((noreturn))
@@ -51,5 +53,6 @@
 #error Please implement SPICE_CONSTRUCTOR_FUNC and SPICE_DESTRUCTOR_FUNC for this compiler
 #endif
 
+#define SPICE_VERIFY(cond) verify_expr(cond, (void)1)
 
 #endif /* __MACROS_H */
-- 
2.7.4



More information about the Spice-devel mailing list