]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
examples: drop some conditionals checks from macros
authorDaniel P. Berrangé <berrange@redhat.com>
Fri, 14 Jan 2022 10:34:43 +0000 (10:34 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Mon, 17 Jan 2022 10:44:33 +0000 (10:44 +0000)
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.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
examples/c/misc/event-test.c

index 1eec76c79d8eb8bde6d5d6a300b888ab533c1f7f..1165469a655c07f7e1f9453798c58400505b67f8 100644 (file)
 #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;