]> granicus.if.org Git - curl/commitdiff
Gisle Vanem made this build fine with djgpp and the Watt-32 stack.
authorDaniel Stenberg <daniel@haxx.se>
Thu, 1 Jul 2004 06:58:47 +0000 (06:58 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 1 Jul 2004 06:58:47 +0000 (06:58 +0000)
ares/ares_init.c
ares/ares_private.h
ares/ares_process.c

index bd23234529d6de5eab285a90abc69472ebe2e662..c5e35d060671a6ed9d39d3ef996625c8ffb84a1b 100644 (file)
@@ -506,6 +506,24 @@ DhcpNameServer
     free(resolvers);
   }
 
+#elif defined(WATT32)
+  int i;
+
+  sock_init();
+  for (i = 0; def_nameservers[i]; i++)
+      ;
+  if (i == 0)
+    return ARES_SUCCESS; /* use localhost DNS server */
+
+  nservers = i;
+  servers = calloc(sizeof(*servers), i);
+  if (!servers)
+     return ARES_ENOMEM;
+
+  for (i = 0; def_nameservers[i]; i++)
+      servers[i].addr.s_addr = htonl(def_nameservers[i]);
+  status = ARES_EOF;
+
 #else
   {
     char *p;
index 7a755e00460d91772601130e0ed647896ecb37cb..caff53b345b336d7890620c768d45bfeaa0dea00 100644 (file)
 #define closesocket(x) close(x)
 #endif
 
+#ifdef WATT32
+#include <tcp.h>
+#include <sys/ioctl.h>
+#undef  closesocket
+#define closesocket(s)    close_s(s)
+#define select(n,r,w,x,t) select_s(n,r,w,x,t)
+#define writev(s,v,c)     writev_s(s,v,c)
+#endif
+
 #define        DEFAULT_TIMEOUT         5
 #define DEFAULT_TRIES          4
 #ifndef INADDR_NONE
index 6a7585c0a174d9ef77975eaa800f197f3488f7e7..a8dd0c750a9b697f8dc93a56fdee18489608f6b1 100644 (file)
@@ -458,7 +458,7 @@ static int open_tcp_socket(ares_channel channel, struct server_state *server)
 
   /* Set the socket non-blocking. */
 
-#ifdef WIN32
+#if defined(WIN32) || defined(WATT32)
   flags = 1;
   ioctlsocket(s, FIONBIO, &flags);
 #else