2004-07-23 06:18:45 +08:00
|
|
|
#ifndef ARES_SETUP_H
|
|
|
|
#define ARES_SETUP_H
|
|
|
|
|
2005-03-11 07:30:34 +08:00
|
|
|
/* Copyright (C) 2004 - 2005 by Daniel Stenberg et al
|
2004-07-23 06:18:45 +08:00
|
|
|
*
|
|
|
|
* Permission to use, copy, modify, and distribute this software and its
|
|
|
|
* documentation for any purpose and without fee is hereby granted, provided
|
|
|
|
* that the above copyright notice appear in all copies and that both that
|
|
|
|
* copyright notice and this permission notice appear in supporting
|
|
|
|
* documentation, and that the name of M.I.T. not be used in advertising or
|
|
|
|
* publicity pertaining to distribution of the software without specific,
|
|
|
|
* written prior permission. M.I.T. makes no representations about the
|
|
|
|
* suitability of this software for any purpose. It is provided "as is"
|
|
|
|
* without express or implied warranty.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#else
|
2005-11-11 00:55:59 +08:00
|
|
|
|
|
|
|
#ifdef WIN32
|
|
|
|
#include "config-win32.h"
|
|
|
|
#endif
|
|
|
|
|
2004-07-23 06:18:45 +08:00
|
|
|
/* simple work-around for now, for systems without configure support */
|
2005-11-11 00:55:59 +08:00
|
|
|
#ifndef __DJGPP__
|
2004-07-23 06:18:45 +08:00
|
|
|
#define ssize_t int
|
2005-11-11 00:55:59 +08:00
|
|
|
#endif
|
2005-11-10 05:38:58 +08:00
|
|
|
#ifndef _MSC_VER
|
2005-05-17 02:06:54 +08:00
|
|
|
#define socklen_t int
|
2004-07-23 06:18:45 +08:00
|
|
|
#endif
|
2005-11-11 00:55:59 +08:00
|
|
|
#endif /* HAVE_CONFIG_H */
|
2004-07-23 06:18:45 +08:00
|
|
|
|
|
|
|
/* 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. */
|
|
|
|
#undef PACKAGE_STRING
|
|
|
|
#undef PACKAGE_TARNAME
|
|
|
|
#undef PACKAGE_VERSION
|
|
|
|
#undef PACKAGE_BUGREPORT
|
|
|
|
#undef PACKAGE_NAME
|
|
|
|
#undef VERSION
|
|
|
|
#undef PACKAGE
|
|
|
|
|
|
|
|
/* now typedef our socket type */
|
2004-08-20 21:45:26 +08:00
|
|
|
#if defined(WIN32) && !defined(WATT32)
|
2005-11-10 05:38:58 +08:00
|
|
|
#include <winsock2.h>
|
|
|
|
#include <ws2tcpip.h>
|
2004-07-23 06:18:45 +08:00
|
|
|
typedef SOCKET ares_socket_t;
|
|
|
|
#define ARES_SOCKET_BAD INVALID_SOCKET
|
|
|
|
#else
|
|
|
|
typedef int ares_socket_t;
|
|
|
|
#define ARES_SOCKET_BAD -1
|
|
|
|
#endif
|
|
|
|
|
2004-08-20 21:45:26 +08:00
|
|
|
/* Assume a few thing unless they're set by configure
|
|
|
|
*/
|
|
|
|
#if !defined(HAVE_SYS_TIME_H) && !defined(_MSC_VER)
|
2005-03-11 07:30:34 +08:00
|
|
|
#define HAVE_SYS_TIME_H
|
2004-08-20 21:45:26 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined(HAVE_UNISTD_H) && !defined(_MSC_VER)
|
2005-03-22 18:36:20 +08:00
|
|
|
#define HAVE_UNISTD_H 1
|
2004-08-20 21:45:26 +08:00
|
|
|
#endif
|
|
|
|
|
2004-08-20 21:48:24 +08:00
|
|
|
#if !defined(HAVE_SYS_UIO_H) && !defined(WIN32) && !defined(MSDOS)
|
2004-08-20 21:45:26 +08:00
|
|
|
#define HAVE_SYS_UIO_H
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if (defined(WIN32) || defined(WATT32)) && \
|
2005-11-11 00:55:59 +08:00
|
|
|
!(defined(__MINGW32__) || defined(NETWARE) || defined(__DJGPP__))
|
2004-08-20 21:45:26 +08:00
|
|
|
/* 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
|
|
|
|
|
2005-03-11 07:30:34 +08:00
|
|
|
/* IPv6 compatibility */
|
|
|
|
#if !defined(HAVE_AF_INET6)
|
|
|
|
#if defined(HAVE_PF_INET6)
|
|
|
|
#define AF_INET6 PF_INET6
|
|
|
|
#else
|
|
|
|
#define AF_INET6 AF_MAX+1
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2004-07-23 06:18:45 +08:00
|
|
|
#endif /* ARES_SETUP_H */
|