#include "ares_dns.h"
#include "ares_private.h"
-#ifndef TRUE
-/* at least Solaris 7 does not have TRUE at this point */
-#define TRUE 1
-#endif
static int try_again(int errnum);
static void write_tcp_data(ares_channel channel, fd_set *write_fds,
int flags;
flags = fcntl(sockfd, F_GETFL, 0);
- if (TRUE == nonblock)
+ if (FALSE != nonblock)
return fcntl(sockfd, F_SETFL, flags | O_NONBLOCK);
else
return fcntl(sockfd, F_SETFL, flags & (~O_NONBLOCK));
netdb.h \
netinet/in.h \
net/if.h \
+ errno.h \
+ stdbool.h \
arpa/nameser.h \
arpa/nameser_compat.h \
arpa/inet.h,
AC_CHECK_TYPE(ssize_t, ,
AC_DEFINE(ssize_t, int, [the signed version of size_t]))
+# check for bool type
+AC_CHECK_TYPE([bool],[
+ AC_DEFINE(HAVE_BOOL_T, 1,
+ [Define to 1 if bool is an available type.])
+], ,[
+#ifdef HAVE_STDBOOL_H
+#include <stdbool.h>
+#endif
+])
+
# Check for socklen_t or equivalent
CURL_CHECK_TYPE_SOCKLEN_T
#include <fcntl.h>
#endif
+#ifdef HAVE_STDBOOL_H
+#include <stdbool.h>
+#endif
+
/*
* Definition of timeval struct for platforms that don't have it.
(((unsigned char)x) == '\t'))
+/*
+ * Typedef to 'unsigned char' if bool is not an available 'typedefed' type.
+ */
+
+#ifndef HAVE_BOOL_T
+typedef unsigned char bool;
+#define HAVE_BOOL_T
+#endif
+
+
+/*
+ * Default definition of uppercase TRUE and FALSE.
+ */
+
+#ifndef TRUE
+#define TRUE 1
+#endif
+#ifndef FALSE
+#define FALSE 0
+#endif
+
+
/*
* Typedef to 'int' if sig_atomic_t is not an available 'typedefed' type.
*/
libgen.h \
locale.h \
errno.h \
+ stdbool.h \
arpa/tftp.h \
sys/filio.h \
setjmp.h,
AC_CHECK_TYPE(ssize_t, ,
AC_DEFINE(ssize_t, int, [the signed version of size_t]))
+# check for bool type
+AC_CHECK_TYPE([bool],[
+ AC_DEFINE(HAVE_BOOL_T, 1,
+ [Define to 1 if bool is an available type.])
+], ,[
+#ifdef HAVE_STDBOOL_H
+#include <stdbool.h>
+#endif
+])
+
# Check for socklen_t or equivalent
CURL_CHECK_TYPE_SOCKLEN_T
#include <errno.h>
#include <string.h>
-#ifndef TRUE
-#define TRUE 1
-#define FALSE 0
-#endif
-
#include "urldata.h"
#include "sendf.h"
#include "if2ip.h"
int flags;
flags = fcntl(sockfd, F_GETFL, 0);
- if (TRUE == nonblock)
+ if (FALSE != nonblock)
return fcntl(sockfd, F_SETFL, flags | O_NONBLOCK);
else
return fcntl(sockfd, F_SETFL, flags & (~O_NONBLOCK));
#endif
-#ifndef TRUE
-#define TRUE 1
-#endif
-#ifndef FALSE
-#define FALSE 0
-#endif
-
-#if !defined(__cplusplus) && !defined(__BEOS__) && !defined(__ECOS) && !defined(typedef_bool)
-typedef unsigned char bool;
-#define typedef_bool
-#endif
-
#ifdef HAVE_LONGLONG
#define LONG_LONG long long
#define ENABLE_64BIT
#include <fcntl.h>
#endif
+#ifdef HAVE_STDBOOL_H
+#include <stdbool.h>
+#endif
+
/*
* Definition of timeval struct for platforms that don't have it.
(((unsigned char)x) == '\t'))
+/*
+ * Typedef to 'unsigned char' if bool is not an available 'typedefed' type.
+ */
+
+#ifndef HAVE_BOOL_T
+typedef unsigned char bool;
+#define HAVE_BOOL_T
+#endif
+
+
+/*
+ * Default definition of uppercase TRUE and FALSE.
+ */
+
+#ifndef TRUE
+#define TRUE 1
+#endif
+#ifndef FALSE
+#define FALSE 0
+#endif
+
+
/*
* Typedef to 'int' if sig_atomic_t is not an available 'typedefed' type.
*/
#include <floss.h>
#endif
-#ifndef TRUE
-#define TRUE 1
-#endif
-#ifndef FALSE
-#define FALSE 0
-#endif
-
-#if !defined(__cplusplus) && !defined(__BEOS__) && !defined(__ECOS) && !defined(typedef_bool)
-typedef unsigned char bool;
-#define typedef_bool
-#endif
#ifndef OS
#define OS "unknown"
version, but that might include "config.h" from the build dir so we need
both of them in the include path), so that we get good in-depth knowledge
about the system we're building this on */
+
#include "setup.h"
#include <curl.h>
#include <unistd.h>
#endif
-#ifndef FALSE
-#define FALSE 0
-#endif
-
-#ifndef TRUE
-#define TRUE 1
-#endif
-
#define TEST_ERR_MAJOR_BAD 100
#define TEST_ERR_RUNS_FOREVER 99
void logmsg(const char *msg, ...);
-#ifndef FALSE
-#define FALSE 0
-#endif
-#ifndef TRUE
-#define TRUE 1
-#endif
-
#define TEST_DATA_PATH "%s/data/test%ld"
/* global variable, where to find the 'data' dir */