curl-library
[Patch] c-ares on Windows
Date: Mon, 8 Mar 2004 23:14:45 +0100
A small patch to compile on MingW.
I assume the nameser.h file isn't used for Cygwin, so the
"struct timezone" should be required for every other Win32 target
(which doesn't have this struct).
---------
diff -u3 -H -B -w c-ares-1.0.0\ahost.c .\ahost.c
--- c-ares-1.0.0\ahost.c Mon Feb 02 23:58:16 2004
+++ .\ahost.c Fri Feb 06 01:05:35 2004
@@ -53,7 +53,7 @@
WSAStartup(wVersionRequested, &wsaData);
#endif
- if (argc == 0)
+ if (argc <= 1)
usage();
status = ares_init(&channel);
diff -u3 -H -B -w c-ares-1.0.0\nameser.h .\nameser.h
--- c-ares-1.0.0\nameser.h Sun Jan 04 13:17:29 2004
+++ .\nameser.h Fri Feb 06 01:04:11 2004
@@ -17,6 +17,8 @@
#define getpid() _getpid()
+struct timezone { int dummy; };
+
int strcasecmp(const char *a, const char *b);
int ares_gettimeofday(struct timeval *tv, struct timezone *tz);
#define gettimeofday(tv,tz) ares_gettimeofday(tv,tz)
diff -u3 -H -B -w c-ares-1.0.0\windows_port.c .\windows_port.c
--- c-ares-1.0.0\windows_port.c Sun Jan 04 13:17:41 2004
+++ .\windows_port.c Wed Feb 11 11:00:42 2004
@@ -5,6 +5,7 @@
#include "nameser.h"
+#ifndef __MINGW32__
int
strncasecmp(const char *a, const char *b, size_t n)
{
@@ -23,6 +24,7 @@
{
return strncasecmp(a, b, strlen(a)+1);
}
+#endif
int
ares_gettimeofday(struct timeval *tv, struct timezone *tz)
--------------
--gv
Received on 2004-03-08