Commit 59cea24a authored by Ghislain MARY's avatar Ghislain MARY

Fix build with Clang on Linux.

parent e26d9233
......@@ -243,7 +243,9 @@
#if DNS_GNUC_PREREQ(0,0,0) && !DNS_GNUC_PREREQ(4,6,0)
#define HAVE_STATIC_ASSERT 0 /* glibc doesn't check GCC version */
#else
#define HAVE_STATIC_ASSERT (defined static_assert)
#if (defined static_assert)
#define HAVE_STATIC_ASSERT 1
#endif
#endif
#endif
......@@ -414,11 +416,15 @@ const char *dns_strerror(int error) {
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef HAVE___ATOMIC_FETCH_ADD
#define HAVE___ATOMIC_FETCH_ADD (defined __ATOMIC_RELAXED)
#if (defined __ATOMIC_RELAXED)
#define HAVE___ATOMIC_FETCH_ADD 1
#endif
#endif
#ifndef HAVE___ATOMIC_FETCH_SUB
#define HAVE___ATOMIC_FETCH_SUB HAVE___ATOMIC_FETCH_ADD
#if (defined __ATOMIC_RELAXED)
#define HAVE___ATOMIC_FETCH_SUB 1
#endif
#endif
#ifndef DNS_ATOMIC_FETCH_ADD
......@@ -787,7 +793,9 @@ DNS_NOTUSED static size_t dns_strnlcpy(char *dst, size_t lim, const char *src, s
} /* dns_strnlcpy() */
#define DNS_HAVE_SOCKADDR_UN (defined AF_UNIX && !defined _WIN32)
#if (defined AF_UNIX && !defined _WIN32)
#define DNS_HAVE_SOCKADDR_UN 1
#endif
static size_t dns_af_len(int af) {
static const size_t table[AF_MAX] = {
......@@ -6261,11 +6269,15 @@ static void dns_socketclose(int *fd, const struct dns_options *opts) {
#endif
#ifndef HAVE_SOCK_CLOEXEC
#define HAVE_SOCK_CLOEXEC (defined SOCK_CLOEXEC)
#if (defined SOCK_CLOEXEC)
#define HAVE_SOCK_CLOEXEC 1
#endif
#endif
#ifndef HAVE_SOCK_NONBLOCK
#define HAVE_SOCK_NONBLOCK (defined SOCK_NONBLOCK)
#if (defined SOCK_NONBLOCK)
#define HAVE_SOCK_NONBLOCK 1
#endif
#endif
#define DNS_SO_MAXTRY 7
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment