mirror of https://gitee.com/openkylin/libvirt.git
examples: drop some conditionals checks from macros
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>
This commit is contained in:
parent
79f738c510
commit
4166f6bc59
|
@ -12,18 +12,8 @@
|
||||||
#define G_N_ELEMENTS(Array) (sizeof(Array) / sizeof(*(Array)))
|
#define G_N_ELEMENTS(Array) (sizeof(Array) / sizeof(*(Array)))
|
||||||
#define STREQ(a, b) (strcmp(a, b) == 0)
|
#define STREQ(a, b) (strcmp(a, b) == 0)
|
||||||
#define NULLSTR(s) ((s) ? (s) : "<null>")
|
#define NULLSTR(s) ((s) ? (s) : "<null>")
|
||||||
|
#define G_STATIC_ASSERT(cond) _Static_assert(cond, "verify (" #cond ")")
|
||||||
#if (4 < __GNUC__ + (6 <= __GNUC_MINOR__) \
|
#define G_GNUC_UNUSED __attribute__((__unused__))
|
||||||
&& (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
|
|
||||||
|
|
||||||
int run = 1;
|
int run = 1;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue