made the ares_inet_net_pton() proto use size_t size, as the function in the
[platform/upstream/c-ares.git] / setup.h
1 #ifndef ARES_SETUP_H
2 #define ARES_SETUP_H
3
4 /* Copyright (C) 2004 - 2005 by Daniel Stenberg et al
5  *
6  * Permission to use, copy, modify, and distribute this software and its
7  * documentation for any purpose and without fee is hereby granted, provided
8  * that the above copyright notice appear in all copies and that both that
9  * copyright notice and this permission notice appear in supporting
10  * documentation, and that the name of M.I.T. not be used in advertising or
11  * publicity pertaining to distribution of the software without specific,
12  * written prior permission.  M.I.T. makes no representations about the
13  * suitability of this software for any purpose.  It is provided "as is"
14  * without express or implied warranty.
15  */
16
17 #ifdef HAVE_CONFIG_H
18 #include "config.h"
19 #else
20 /* simple work-around for now, for systems without configure support */
21 #define ssize_t int
22 #endif
23
24 /* Recent autoconf versions define these symbols in config.h. We don't want
25    them (since they collide with the libcurl ones when we build
26    --enable-debug) so we undef them again here. */
27 #undef PACKAGE_STRING
28 #undef PACKAGE_TARNAME
29 #undef PACKAGE_VERSION
30 #undef PACKAGE_BUGREPORT
31 #undef PACKAGE_NAME
32 #undef VERSION
33 #undef PACKAGE
34
35 /* now typedef our socket type */
36 #if defined(WIN32) && !defined(WATT32)
37 #include <winsock.h>
38 typedef SOCKET ares_socket_t;
39 #define ARES_SOCKET_BAD INVALID_SOCKET
40 #else
41 typedef int ares_socket_t;
42 #define ARES_SOCKET_BAD -1
43 #endif
44
45 /* Assume a few thing unless they're set by configure
46  */
47 #if !defined(HAVE_SYS_TIME_H) && !defined(_MSC_VER)
48 #define HAVE_SYS_TIME_H
49 #endif
50
51 #if !defined(HAVE_UNISTD_H) && !defined(_MSC_VER)
52 #define HAVE_UNISTD_H 1
53 #endif
54
55 #if !defined(HAVE_SYS_UIO_H) && !defined(WIN32) && !defined(MSDOS)
56 #define HAVE_SYS_UIO_H
57 #endif
58
59 #if (defined(WIN32) || defined(WATT32)) && \
60    !(defined(__MINGW32__) || defined(NETWARE))
61 /* protos for the functions we provide in windows_port.c */
62 int ares_strncasecmp(const char *s1, const char *s2, int n);
63 int ares_strcasecmp(const char *s1, const char *s2);
64
65 /* use this define magic to prevent us from adding symbol names to the library
66    that is a high-risk to collide with another libraries' attempts to do the
67    same */
68 #define strncasecmp(a,b,c) ares_strncasecmp(a,b,c)
69 #define strcasecmp(a,b) ares_strcasecmp(a,b)
70 #endif
71
72 /* IPv6 compatibility */
73 #if !defined(HAVE_AF_INET6)
74 #if defined(HAVE_PF_INET6)
75 #define AF_INET6 PF_INET6
76 #else
77 #define AF_INET6 AF_MAX+1
78 #endif
79 #endif
80
81 #ifndef HAVE_PF_INET6
82 #define PF_INET6 AF_INET6
83 #endif
84
85 #ifndef HAVE_STRUCT_IN6_ADDR
86 struct in6_addr
87 {
88   unsigned char s6_addr[16];
89 };
90 #endif
91
92 #if defined(HAVE_INET_PTON) && defined(HAVE_INET_PTON_IPV6)
93 #define ares_inet_pton(x,y,z) inet_pton(x,y,z)
94 #else
95 int ares_inet_pton(int af, const char *src, void *dst);
96 #endif
97 #if defined(HAVE_INET_NET_PTON) && defined(HAVE_INET_NET_PTON_IPV6)
98 #define ares_inet_net_pton(w,x,y,z) inet_net_pton(w,x,y,z)
99 #else
100 int ares_inet_net_pton(int af, const char *src, void *dst, size_t size);
101 #endif
102
103 #endif /* ARES_SETUP_H */