From 47a8fd8210deb317d37dd3b5f7d91abafc8376e0 Mon Sep 17 00:00:00 2001 From: Tomas Krizek Date: Thu, 4 Apr 2019 16:15:47 +0200 Subject: [PATCH] GCC9 compatibility --- src/lib/dns.h | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/src/lib/dns.h b/src/lib/dns.h index 78d6402..f6ce1d6 100644 --- a/src/lib/dns.h +++ b/src/lib/dns.h @@ -149,27 +149,10 @@ DNS_PUBLIC int *dns_debug_p(void); * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#if defined __clang__ -#define DNS_PRAGMA_PUSH _Pragma("clang diagnostic push") -#define DNS_PRAGMA_QUIET _Pragma("clang diagnostic ignored \"-Winitializer-overrides\"") -#define DNS_PRAGMA_POP _Pragma("clang diagnostic pop") - -#define dns_quietinit(...) \ - DNS_PRAGMA_PUSH DNS_PRAGMA_QUIET __VA_ARGS__ DNS_PRAGMA_POP -#elif (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || __GNUC__ > 4 -#define DNS_PRAGMA_PUSH _Pragma("GCC diagnostic push") -#define DNS_PRAGMA_QUIET _Pragma("GCC diagnostic ignored \"-Woverride-init\"") -#define DNS_PRAGMA_POP _Pragma("GCC diagnostic pop") - -/* GCC parses the _Pragma operator less elegantly than clang. */ -#define dns_quietinit(...) \ - __extension__ ({ DNS_PRAGMA_PUSH DNS_PRAGMA_QUIET __VA_ARGS__; DNS_PRAGMA_POP }) -#else #define DNS_PRAGMA_PUSH #define DNS_PRAGMA_QUIET #define DNS_PRAGMA_POP #define dns_quietinit(...) __VA_ARGS__ -#endif #if defined __GNUC__ #define DNS_PRAGMA_EXTENSION __extension__ @@ -1056,7 +1039,7 @@ DNS_PUBLIC void dns_cache_close(struct dns_cache *); #define DNS_OPTS_INITIALIZER { DNS_OPTS_INITIALIZER_ } #define DNS_OPTS_INIT(...) { DNS_OPTS_INITIALIZER_, __VA_ARGS__ } -#define dns_opts(...) (&dns_quietinit((struct dns_options)DNS_OPTS_INIT(__VA_ARGS__))) +#define dns_opts(...) (&(struct dns_options){ __VA_ARGS__ }) struct dns_options { /* -- 2.21.0