1 #ifndef __CARES_BUILD_H
2 #define __CARES_BUILD_H
5 /* Copyright (C) 2009 - 2013 by Daniel Stenberg et al
7 * Permission to use, copy, modify, and distribute this software and its
8 * documentation for any purpose and without fee is hereby granted, provided
9 * that the above copyright notice appear in all copies and that both that
10 * copyright notice and this permission notice appear in supporting
11 * documentation, and that the name of M.I.T. not be used in advertising or
12 * publicity pertaining to distribution of the software without specific,
13 * written prior permission. M.I.T. makes no representations about the
14 * suitability of this software for any purpose. It is provided "as is"
15 * without express or implied warranty.
18 /* ================================================================ */
19 /* NOTES FOR CONFIGURE CAPABLE SYSTEMS */
20 /* ================================================================ */
26 * See file ares_build.h.in, run configure, and forget that this file
27 * exists it is only used for non-configure systems.
28 * But you can keep reading if you want ;-)
32 /* ================================================================ */
33 /* NOTES FOR NON-CONFIGURE SYSTEMS */
34 /* ================================================================ */
40 * Nothing in this file is intended to be modified or adjusted by the
41 * c-ares library user nor by the c-ares library builder.
43 * If you think that something actually needs to be changed, adjusted
44 * or fixed in this file, then, report it on the c-ares development
45 * mailing list: http://cool.haxx.se/mailman/listinfo/c-ares/
47 * Try to keep one section per platform, compiler and architecture,
48 * otherwise, if an existing section is reused for a different one and
49 * later on the original is adjusted, probably the piggybacking one can
50 * be adversely changed.
52 * In order to differentiate between platforms/compilers/architectures
53 * use only compiler built in predefined preprocessor symbols.
55 * This header file shall only export symbols which are 'cares' or 'CARES'
56 * prefixed, otherwise public name space would be polluted.
61 * Right now you might be staring at file ares_build.h.dist or ares_build.h,
62 * this is due to the following reason: file ares_build.h.dist is renamed
63 * to ares_build.h when the c-ares source code distribution archive file is
66 * File ares_build.h.dist is not included in the distribution archive.
67 * File ares_build.h is not present in the git tree.
69 * The distributed ares_build.h file is only intended to be used on systems
70 * which can not run the also distributed configure script.
72 * On systems capable of running the configure script, the configure process
73 * will overwrite the distributed ares_build.h file with one that is suitable
74 * and specific to the library being configured and built, which is generated
75 * from the ares_build.h.in template file.
77 * If you check out from git on a non-configure platform, you must run the
78 * appropriate buildconf* script to set up ares_build.h and other local files.
82 /* ================================================================ */
83 /* DEFINITION OF THESE SYMBOLS SHALL NOT TAKE PLACE ANYWHERE ELSE */
84 /* ================================================================ */
86 #ifdef CARES_TYPEOF_ARES_SOCKLEN_T
87 # error "CARES_TYPEOF_ARES_SOCKLEN_T shall not be defined except in ares_build.h"
88 Error Compilation_aborted_CARES_TYPEOF_ARES_SOCKLEN_T_already_defined
91 /* ================================================================ */
92 /* EXTERNAL INTERFACE SETTINGS FOR NON-CONFIGURE SYSTEMS ONLY */
93 /* ================================================================ */
95 #if defined(__DJGPP__) || defined(__GO32__)
96 # define CARES_TYPEOF_ARES_SOCKLEN_T int
98 #elif defined(__SALFORDC__)
99 # define CARES_TYPEOF_ARES_SOCKLEN_T int
101 #elif defined(__BORLANDC__)
102 # define CARES_TYPEOF_ARES_SOCKLEN_T int
104 #elif defined(__TURBOC__)
105 # define CARES_TYPEOF_ARES_SOCKLEN_T int
107 #elif defined(__WATCOMC__)
108 # define CARES_TYPEOF_ARES_SOCKLEN_T int
110 #elif defined(__POCC__)
111 # define CARES_TYPEOF_ARES_SOCKLEN_T int
113 #elif defined(__LCC__)
114 # define CARES_TYPEOF_ARES_SOCKLEN_T int
116 #elif defined(__SYMBIAN32__)
117 # define CARES_TYPEOF_ARES_SOCKLEN_T unsigned int
119 #elif defined(__MWERKS__)
120 # define CARES_TYPEOF_ARES_SOCKLEN_T int
122 #elif defined(_WIN32_WCE)
123 # define CARES_TYPEOF_ARES_SOCKLEN_T int
125 #elif defined(__MINGW32__)
126 # define CARES_TYPEOF_ARES_SOCKLEN_T int
129 # define CARES_TYPEOF_ARES_SOCKLEN_T unsigned int
131 #elif defined(__OS400__)
132 # if defined(__ILEC400__)
133 # define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t
134 # define CARES_PULL_SYS_TYPES_H 1
135 # define CARES_PULL_SYS_SOCKET_H 1
138 #elif defined(__MVS__)
139 # if defined(__IBMC__) || defined(__IBMCPP__)
140 # define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t
141 # define CARES_PULL_SYS_TYPES_H 1
142 # define CARES_PULL_SYS_SOCKET_H 1
145 #elif defined(__370__)
146 # if defined(__IBMC__) || defined(__IBMCPP__)
147 # define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t
148 # define CARES_PULL_SYS_TYPES_H 1
149 # define CARES_PULL_SYS_SOCKET_H 1
153 # define CARES_TYPEOF_ARES_SOCKLEN_T int
155 /* ===================================== */
156 /* KEEP MSVC THE PENULTIMATE ENTRY */
157 /* ===================================== */
159 #elif defined(_MSC_VER)
160 # define CARES_TYPEOF_ARES_SOCKLEN_T int
162 /* ===================================== */
163 /* KEEP GENERIC GCC THE LAST ENTRY */
164 /* ===================================== */
166 #elif defined(__GNUC__)
167 # define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t
168 # define CARES_PULL_SYS_TYPES_H 1
169 # define CARES_PULL_SYS_SOCKET_H 1
172 # error "Unknown non-configure build target!"
173 Error Compilation_aborted_Unknown_non_configure_build_target
176 /* CARES_PULL_SYS_TYPES_H is defined above when inclusion of header file */
177 /* sys/types.h is required here to properly make type definitions below. */
178 #ifdef CARES_PULL_SYS_TYPES_H
179 # include <sys/types.h>
182 /* CARES_PULL_SYS_SOCKET_H is defined above when inclusion of header file */
183 /* sys/socket.h is required here to properly make type definitions below. */
184 #ifdef CARES_PULL_SYS_SOCKET_H
185 # include <sys/socket.h>
188 /* Data type definition of ares_socklen_t. */
190 #ifdef CARES_TYPEOF_ARES_SOCKLEN_T
191 typedef CARES_TYPEOF_ARES_SOCKLEN_T ares_socklen_t;
194 #endif /* __CARES_BUILD_H */