AC_CHECK_DECLS() always defines the related HAVE_DECL_xxx symbol (either
as '1' or as '0').
Fix the related #if blocks to check additionally for value beside the
existence of this symbol. Checking for existence is required for
e.g. Windows builds.
https://github.com/oetiker/rrdtool-1.x/issues/1261
Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
inline static bool have_decl_o_cloexec(void)
{
-#ifdef HAVE_DECL_O_CLOEXEC
+#if defined(HAVE_DECL_O_CLOEXEC) && HAVE_DECL_O_CLOEXEC
return true;
#else
return false;
#include <rrd_config.h>
-#ifndef HAVE_DECL_O_CLOEXEC
+#if !defined(HAVE_DECL_O_CLOEXEC) || !HAVE_DECL_O_CLOEXEC
# define O_CLOEXEC 0
#endif
-#ifndef HAVE_DECL_SOCK_CLOEXEC
+#if !defined(HAVE_DECL_SOCK_CLOEXEC) || !HAVE_DECL_SOCK_CLOEXEC
# define SOCK_CLOEXEC 0
#endif