From f1f32477e35aba50b84ec9892cd8b3357d2100cb Mon Sep 17 00:00:00 2001
From: Gisle Vanem <gvanem@broadpark.no>
Date: Tue, 20 Dec 2005 20:48:38 +0000
Subject: [PATCH] Changes for PellesC for Win32. It needs <unistd.h> for
 'ssize_t'. Hence the rearrangement in ares_process.c.

---
 ares/ares_process.c |  3 ++-
 ares/config-win32.h |  3 ++-
 ares/setup.h        | 21 +++++++++++----------
 3 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/ares/ares_process.c b/ares/ares_process.c
index 93e7196e0f..456d952183 100644
--- a/ares/ares_process.c
+++ b/ares/ares_process.c
@@ -30,6 +30,8 @@
 #ifdef HAVE_ARPA_NAMESER_COMPAT_H
 #include <arpa/nameser_compat.h>
 #endif
+#endif /* WIN32 && !WATT32 */
+
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
@@ -39,7 +41,6 @@
 #ifdef NETWARE
 #include <sys/filio.h>
 #endif
-#endif
 
 #include <string.h>
 #include <stdlib.h>
diff --git a/ares/config-win32.h b/ares/config-win32.h
index 3ce3caa423..ac41df1b97 100644
--- a/ares/config-win32.h
+++ b/ares/config-win32.h
@@ -30,7 +30,8 @@
 #endif
 
 /* Define if you have the <unistd.h> header file.  */
-#if defined(__MINGW32__) || defined(__WATCOMC__) || defined(__LCC__)
+#if defined(__MINGW32__) || defined(__WATCOMC__) || defined(__LCC__) || \
+    defined(__POCC__)
 #define HAVE_UNISTD_H 1
 #endif
 
diff --git a/ares/setup.h b/ares/setup.h
index 73ef0f11ce..44261411b3 100644
--- a/ares/setup.h
+++ b/ares/setup.h
@@ -39,10 +39,10 @@
 
 #endif /* HAVE_CONFIG_H */
 
-/* 
+/*
  * Include header files for windows builds before redefining anything.
- * Use this preproessor block only to include or exclude windows.h, 
- * winsock2.h, ws2tcpip.h or winsock.h. Any other windows thing belongs 
+ * Use this preproessor block only to include or exclude windows.h,
+ * winsock2.h, ws2tcpip.h or winsock.h. Any other windows thing belongs
  * to any other further and independant block.
  */
 
@@ -64,12 +64,13 @@
 #endif
 
 /*
- * Work-arounds for systems without configure support 
+ * Work-arounds for systems without configure support
  */
 
 #ifndef HAVE_CONFIG_H
 
-#if defined(__DJGPP__) || (defined(__WATCOMC__) && (__WATCOMC__ >= 1240))
+#if defined(__DJGPP__) || (defined(__WATCOMC__) && (__WATCOMC__ >= 1240)) || \
+    defined(__POCC__)
 #else
 #define ssize_t int
 #endif
@@ -80,8 +81,8 @@
 
 #endif /* HAVE_CONFIG_H */
 
-/* 
- * Recent autoconf versions define these symbols in config.h. We don't 
+/*
+ * Recent autoconf versions define these symbols in config.h. We don't
  * want them (since they collide with the libcurl ones when we build
  *  --enable-debug) so we undef them again here.
  */
@@ -94,8 +95,8 @@
 #undef VERSION
 #undef PACKAGE
 
-/* 
- * Typedef our socket type 
+/*
+ * Typedef our socket type
  */
 
 #if defined(WIN32) && !defined(WATT32)
@@ -106,7 +107,7 @@ typedef int ares_socket_t;
 #define ARES_SOCKET_BAD -1
 #endif
 
-/* 
+/*
  * Assume a few thing unless they're set by configure
  */
 
-- 
GitLab