mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 15:48:49 -05:00
Changes for Watt-32 on Windows. I've assumed Configure
sets the required HAVE_xx defines for non-DOS/Win targets.
This commit is contained in:
parent
cd52b9f0da
commit
b17e32baa7
11
ares/ares.h
11
ares/ares.h
@ -27,11 +27,14 @@
|
|||||||
#include <sys/select.h>
|
#include <sys/select.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WIN32
|
#if defined(WATT32)
|
||||||
#include <winsock.h>
|
#include <netinet/in.h>
|
||||||
#include <windows.h>
|
#include <tcp.h>
|
||||||
|
#elif defined(WIN32)
|
||||||
|
#include <winsock.h>
|
||||||
|
#include <windows.h>
|
||||||
#else
|
#else
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define ARES_SUCCESS 0
|
#define ARES_SUCCESS 0
|
||||||
|
@ -16,10 +16,10 @@
|
|||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#ifdef WIN32
|
#ifdef HAVE_UNISTD_H
|
||||||
#else
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "ares.h"
|
#include "ares.h"
|
||||||
#include "ares_private.h"
|
#include "ares_private.h"
|
||||||
|
|
||||||
|
@ -16,9 +16,7 @@
|
|||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#ifdef WIN32
|
#if !defined(WIN32) || defined(WATT32)
|
||||||
|
|
||||||
#else
|
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#ifdef WIN32
|
#if defined(WIN32) && !defined(WATT32)
|
||||||
#include "nameser.h"
|
#include "nameser.h"
|
||||||
#else
|
#else
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#ifdef WIN32
|
#if defined(WIN32) && !defined(WATT32)
|
||||||
#include "nameser.h"
|
#include "nameser.h"
|
||||||
#else
|
#else
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
@ -16,9 +16,7 @@
|
|||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef HAVE_SYS_TIME_H
|
||||||
|
|
||||||
#else
|
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -16,9 +16,7 @@
|
|||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#ifdef WIN32
|
#if !defined(WIN32) || defined(WATT32)
|
||||||
|
|
||||||
#else
|
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -16,19 +16,25 @@
|
|||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#ifdef WIN32
|
#if defined(WIN32) && !defined(WATT32)
|
||||||
#include "nameser.h"
|
#include "nameser.h"
|
||||||
#include <iphlpapi.h>
|
#include <iphlpapi.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
|
#ifdef HAVE_SYS_TIME_H
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#include <arpa/nameser.h>
|
#include <arpa/nameser.h>
|
||||||
|
#ifdef HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -39,6 +45,10 @@
|
|||||||
#include "ares.h"
|
#include "ares.h"
|
||||||
#include "ares_private.h"
|
#include "ares_private.h"
|
||||||
|
|
||||||
|
#ifdef WATT32
|
||||||
|
#undef WIN32 /* Redefined in MingW/MSVC headers */
|
||||||
|
#endif
|
||||||
|
|
||||||
static int init_by_options(ares_channel channel, struct ares_options *options,
|
static int init_by_options(ares_channel channel, struct ares_options *options,
|
||||||
int optmask);
|
int optmask);
|
||||||
static int init_by_environment(ares_channel channel);
|
static int init_by_environment(ares_channel channel);
|
||||||
|
@ -18,9 +18,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#ifdef WIN32
|
#if !defined(WIN32) || defined(WATT32)
|
||||||
|
|
||||||
#else
|
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
/* We define closesocket() here so that we can use this function all over
|
/* We define closesocket() here so that we can use this function all over
|
||||||
the source code for closing sockets. */
|
the source code for closing sockets. */
|
||||||
@ -41,7 +39,7 @@
|
|||||||
#define INADDR_NONE 0xffffffff
|
#define INADDR_NONE 0xffffffff
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WIN32
|
#if defined(WIN32) && !defined(WATT32)
|
||||||
|
|
||||||
#define IsNT ((int)GetVersion()>0)
|
#define IsNT ((int)GetVersion()>0)
|
||||||
#define WIN_NS_9X "System\\CurrentControlSet\\Services\\VxD\\MSTCP"
|
#define WIN_NS_9X "System\\CurrentControlSet\\Services\\VxD\\MSTCP"
|
||||||
|
@ -16,27 +16,33 @@
|
|||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#ifdef WIN32
|
#if defined(WIN32) && !defined(WATT32)
|
||||||
#include "nameser.h"
|
#include "nameser.h"
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
#ifdef HAVE_SYS_UIO_H
|
||||||
#include <sys/uio.h>
|
#include <sys/uio.h>
|
||||||
|
#endif
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#include <arpa/nameser.h>
|
#include <arpa/nameser.h>
|
||||||
|
#ifdef HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#include "ares.h"
|
#include "ares.h"
|
||||||
#include "ares_dns.h"
|
#include "ares_dns.h"
|
||||||
#include "ares_private.h"
|
#include "ares_private.h"
|
||||||
|
|
||||||
#ifdef WIN32
|
#if defined(WIN32) || defined(WATT32)
|
||||||
#define GET_ERRNO() WSAGetLastError()
|
#define GET_ERRNO() WSAGetLastError()
|
||||||
#else
|
#else
|
||||||
#define GET_ERRNO() errno
|
#define GET_ERRNO() errno
|
||||||
@ -234,7 +240,8 @@ static void read_tcp_data(ares_channel channel, fd_set *read_fds, time_t now)
|
|||||||
*/
|
*/
|
||||||
process_answer(channel, server->tcp_buffer, server->tcp_length,
|
process_answer(channel, server->tcp_buffer, server->tcp_length,
|
||||||
i, 1, now);
|
i, 1, now);
|
||||||
free(server->tcp_buffer);
|
if (server->tcp_buffer)
|
||||||
|
free(server->tcp_buffer);
|
||||||
server->tcp_buffer = NULL;
|
server->tcp_buffer = NULL;
|
||||||
server->tcp_lenbuf_pos = 0;
|
server->tcp_lenbuf_pos = 0;
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#ifdef WIN32
|
#if defined(WIN32) && !defined(WATT32)
|
||||||
#include "nameser.h"
|
#include "nameser.h"
|
||||||
#else
|
#else
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
#ifdef WIN32
|
#if defined(WIN32) && !defined(WATT32)
|
||||||
#include "nameser.h"
|
#include "nameser.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#ifdef WIN32
|
#if defined(WIN32) && !defined(WATT32)
|
||||||
#include "nameser.h"
|
#include "nameser.h"
|
||||||
#else
|
#else
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
@ -16,13 +16,12 @@
|
|||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef HAVE_SYS_TIME_H
|
||||||
|
|
||||||
#else
|
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#include "ares.h"
|
#include "ares.h"
|
||||||
#include "ares_private.h"
|
#include "ares_private.h"
|
||||||
|
|
||||||
|
@ -221,16 +221,4 @@ typedef enum __ns_rcode {
|
|||||||
#define T_MAILA ns_t_maila
|
#define T_MAILA ns_t_maila
|
||||||
#define T_ANY ns_t_any
|
#define T_ANY ns_t_any
|
||||||
|
|
||||||
#if !(defined(__MINGW32__) || defined(NETWARE))
|
|
||||||
/* protos for the functions we provide in windows_port.c */
|
|
||||||
int ares_strncasecmp(const char *s1, const char *s2, size_t 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_NAMESER_H */
|
#endif /* ARES_NAMESER_H */
|
||||||
|
35
ares/setup.h
35
ares/setup.h
@ -19,6 +19,12 @@
|
|||||||
#else
|
#else
|
||||||
/* simple work-around for now, for systems without configure support */
|
/* simple work-around for now, for systems without configure support */
|
||||||
#define ssize_t int
|
#define ssize_t int
|
||||||
|
|
||||||
|
#ifdef __MINGW32__
|
||||||
|
#define HAVE_SYS_TIME_H
|
||||||
|
#define HAVE_UNISTD_H
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Recent autoconf versions define these symbols in config.h. We don't want
|
/* Recent autoconf versions define these symbols in config.h. We don't want
|
||||||
@ -33,7 +39,7 @@
|
|||||||
#undef PACKAGE
|
#undef PACKAGE
|
||||||
|
|
||||||
/* now typedef our socket type */
|
/* now typedef our socket type */
|
||||||
#ifdef WIN32
|
#if defined(WIN32) && !defined(WATT32)
|
||||||
#include <winsock.h>
|
#include <winsock.h>
|
||||||
typedef SOCKET ares_socket_t;
|
typedef SOCKET ares_socket_t;
|
||||||
#define ARES_SOCKET_BAD INVALID_SOCKET
|
#define ARES_SOCKET_BAD INVALID_SOCKET
|
||||||
@ -42,4 +48,31 @@ typedef int ares_socket_t;
|
|||||||
#define ARES_SOCKET_BAD -1
|
#define ARES_SOCKET_BAD -1
|
||||||
#endif
|
#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 */
|
#endif /* ARES_SETUP_H */
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
|
|
||||||
#ifdef WIN32 /* only do the following on windows */
|
/* only do the following on windows
|
||||||
|
*/
|
||||||
|
#if (defined(WIN32) || defined(WATT32)) && !defined(MSDOS)
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
@ -8,13 +10,19 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
|
|
||||||
|
#ifdef WATT32
|
||||||
|
#include <sys/socket.h>
|
||||||
|
#else
|
||||||
#include "nameser.h"
|
#include "nameser.h"
|
||||||
|
#endif
|
||||||
|
#include "ares.h"
|
||||||
|
#include "ares_private.h"
|
||||||
|
|
||||||
#ifndef __MINGW32__
|
#ifndef __MINGW32__
|
||||||
int
|
int
|
||||||
ares_strncasecmp(const char *a, const char *b, size_t n)
|
ares_strncasecmp(const char *a, const char *b, int n)
|
||||||
{
|
{
|
||||||
size_t i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < n; i++) {
|
for (i = 0; i < n; i++) {
|
||||||
int c1 = isupper(a[i]) ? tolower(a[i]) : a[i];
|
int c1 = isupper(a[i]) ? tolower(a[i]) : a[i];
|
||||||
@ -57,7 +65,7 @@ ares_gettimeofday(struct timeval *tv, struct timezone *tz)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ares_writev (SOCKET s, const struct iovec *vector, size_t count)
|
ares_writev (ares_socket_t s, const struct iovec *vector, size_t count)
|
||||||
{
|
{
|
||||||
char *buffer, *bp;
|
char *buffer, *bp;
|
||||||
size_t i, bytes = 0;
|
size_t i, bytes = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user