From 4acce42720275c463eebc0416aa01f019ed39816 Mon Sep 17 00:00:00 2001 From: Jim Hague Date: Mon, 2 Oct 2017 14:15:16 +0100 Subject: [PATCH] Check for implementations of sigemptyset, sigfillset and sigaddset and add if not present. mingw64 doesn't have them and compilation fails at link time. --- configure.ac | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/configure.ac b/configure.ac index 1c1d6453..769879ae 100644 --- a/configure.ac +++ b/configure.ac @@ -699,6 +699,8 @@ AC_CHECK_TYPE([sigset_t], [ #endif ]) +AC_CHECK_FUNCS(sigemptyset sigfillset sigaddset) + my_with_libidn=1 AC_ARG_WITH(libidn, AS_HELP_STRING([--with-libidn=pathname], [path to libidn (default: search /usr/local ..)]), @@ -1544,12 +1546,26 @@ static inline int _gldns_custom_vsnprintf(char *str, size_t size, const char *fo # endif #endif +#ifdef __cplusplus +extern "C" { +#endif + #if !defined(HAVE_STRPTIME) || !defined(STRPTIME_WORKS) #define strptime unbound_strptime struct tm; char *strptime(const char *s, const char *format, struct tm *tm); #endif +#if !defined(HAVE_SIGEMPTYSET) +# define sigemptyset(pset) (*(pset) = 0) +#endif +#if !defined(HAVE_SIGFILLSET) +# define sigfillset(pset) (*(pset) = (_sigset_t)-1) +#endif +#if !defined(HAVE_SIGADDSET) +# define sigaddset(pset, num) (*(pset) |= (1L<<(num))) +#endif + #ifdef HAVE_LIBUNBOUND # include # ifdef HAVE_UNBOUND_EVENT_H @@ -1567,6 +1583,10 @@ int ub_resolve_event(struct ub_ctx* ctx, const char* name, int rrtype, # endif # endif #endif + +#ifdef __cplusplus +} +#endif ]) dnl ---------------------------------------------------------------------------