[libvirt PATCH 3/3] examples: drop some conditionals checks from macros

Daniel P. Berrangé berrange at redhat.com
Fri Jan 14 18:59:11 UTC 2022


We no longer need to worry about GCC version older than 7.4.0. The other
remaining conditionals checks were also overkill for the example code.
In the unlikely event that someone tries to re-use the code in a
scenario where further conditions apply they can figure out.

Signed-off-by: Daniel P. Berrangé <berrange at redhat.com>
---
 examples/c/misc/event-test.c | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/examples/c/misc/event-test.c b/examples/c/misc/event-test.c
index 1eec76c79d..1165469a65 100644
--- a/examples/c/misc/event-test.c
+++ b/examples/c/misc/event-test.c
@@ -12,18 +12,8 @@
 #define G_N_ELEMENTS(Array) (sizeof(Array) / sizeof(*(Array)))
 #define STREQ(a, b) (strcmp(a, b) == 0)
 #define NULLSTR(s) ((s) ? (s) : "<null>")
-
-#if (4 < __GNUC__ + (6 <= __GNUC_MINOR__) \
-     && (201112L <= __STDC_VERSION__  || !defined __STRICT_ANSI__) \
-     && !defined __cplusplus)
-# define G_STATIC_ASSERT(cond) _Static_assert(cond, "verify (" #cond ")")
-#else
-# define G_STATIC_ASSERT(cond)
-#endif
-
-#ifndef G_GNUC_UNUSED
-# define G_GNUC_UNUSED __attribute__((__unused__))
-#endif
+#define G_STATIC_ASSERT(cond) _Static_assert(cond, "verify (" #cond ")")
+#define G_GNUC_UNUSED __attribute__((__unused__))
 
 int run = 1;
 
-- 
2.33.1




More information about the libvir-list mailing list