aboutsummaryrefslogtreecommitdiff
path: root/ares/setup.h
diff options
context:
space:
mode:
authorGisle Vanem <gvanem@broadpark.no>2004-08-20 13:45:26 +0000
committerGisle Vanem <gvanem@broadpark.no>2004-08-20 13:45:26 +0000
commitb17e32baa750d9ce9459e06b144e4ed376dbaa32 (patch)
treeff1096681439c771456586b8e9e0d542e28ff1ca /ares/setup.h
parentcd52b9f0da6ad17287e85e55363248d9f7430ba4 (diff)
Changes for Watt-32 on Windows. I've assumed Configure
sets the required HAVE_xx defines for non-DOS/Win targets.
Diffstat (limited to 'ares/setup.h')
-rw-r--r--ares/setup.h35
1 files changed, 34 insertions, 1 deletions
diff --git a/ares/setup.h b/ares/setup.h
index a713ef9cb..7b933531b 100644
--- a/ares/setup.h
+++ b/ares/setup.h
@@ -19,6 +19,12 @@
#else
/* simple work-around for now, for systems without configure support */
#define ssize_t int
+
+#ifdef __MINGW32__
+#define HAVE_SYS_TIME_H
+#define HAVE_UNISTD_H
+#endif
+
#endif
/* Recent autoconf versions define these symbols in config.h. We don't want
@@ -33,7 +39,7 @@
#undef PACKAGE
/* now typedef our socket type */
-#ifdef WIN32
+#if defined(WIN32) && !defined(WATT32)
#include <winsock.h>
typedef SOCKET ares_socket_t;
#define ARES_SOCKET_BAD INVALID_SOCKET
@@ -42,4 +48,31 @@ typedef int ares_socket_t;
#define ARES_SOCKET_BAD -1
#endif
+/* Assume a few thing unless they're set by configure
+ */
+#if !defined(HAVE_SYS_TIME_H) && !defined(_MSC_VER)
+#define HAVE_SYS_TIME_H
+#endif
+
+#if !defined(HAVE_UNISTD_H) && !defined(_MSC_VER)
+#define HAVE_UNISTD_H
+#endif
+
+#if !defined(HAVE_SYS_UIO_H) && !defined(WIN32)
+#define HAVE_SYS_UIO_H
+#endif
+
+#if (defined(WIN32) || defined(WATT32)) && \
+ !(defined(__MINGW32__) || defined(NETWARE))
+/* protos for the functions we provide in windows_port.c */
+int ares_strncasecmp(const char *s1, const char *s2, int n);
+int ares_strcasecmp(const char *s1, const char *s2);
+
+/* use this define magic to prevent us from adding symbol names to the library
+ that is a high-risk to collide with another libraries' attempts to do the
+ same */
+#define strncasecmp(a,b,c) ares_strncasecmp(a,b,c)
+#define strcasecmp(a,b) ares_strcasecmp(a,b)
+#endif
+
#endif /* ARES_SETUP_H */