fIX *__SOCKLEN_T definitions for MVS and 370 targets
[platform/upstream/c-ares.git] / ares_build.h.dist
1 #ifndef __CARES_BUILD_H
2 #define __CARES_BUILD_H
3
4 /* $Id$ */
5
6 /* Copyright (C) 2009 by Daniel Stenberg et al
7  *
8  * Permission to use, copy, modify, and distribute this software and its
9  * documentation for any purpose and without fee is hereby granted, provided
10  * that the above copyright notice appear in all copies and that both that
11  * copyright notice and this permission notice appear in supporting
12  * documentation, and that the name of M.I.T. not be used in advertising or
13  * publicity pertaining to distribution of the software without specific,
14  * written prior permission.  M.I.T. makes no representations about the
15  * suitability of this software for any purpose.  It is provided "as is"
16  * without express or implied warranty.
17  */
18
19 /* ================================================================ */
20 /*               NOTES FOR CONFIGURE CAPABLE SYSTEMS                */
21 /* ================================================================ */
22
23 /*
24  * NOTE 1:
25  * -------
26  *
27  * See file ares_build.h.in, run configure, and forget that this file
28  * exists it is only used for non-configure systems.
29  * But you can keep reading if you want ;-)
30  *
31  */
32
33 /* ================================================================ */
34 /*                 NOTES FOR NON-CONFIGURE SYSTEMS                  */
35 /* ================================================================ */
36
37 /*
38  * NOTE 1:
39  * -------
40  *
41  * Nothing in this file is intended to be modified or adjusted by the
42  * c-ares library user nor by the c-ares library builder.
43  *
44  * If you think that something actually needs to be changed, adjusted
45  * or fixed in this file, then, report it on the c-ares development
46  * mailing list: http://cool.haxx.se/mailman/listinfo/c-ares/
47  *
48  * Try to keep one section per platform, compiler and architecture,
49  * otherwise, if an existing section is reused for a different one and
50  * later on the original is adjusted, probably the piggybacking one can
51  * be adversely changed.
52  *
53  * In order to differentiate between platforms/compilers/architectures
54  * use only compiler built in predefined preprocessor symbols.
55  *
56  * This header file shall only export symbols which are 'cares' or 'CARES'
57  * prefixed, otherwise public name space would be polluted.
58  *
59  * NOTE 2:
60  * -------
61  *
62  * Right now you might be staring at file ares_build.h.dist or ares_build.h,
63  * this is due to the following reason: file ares_build.h.dist is renamed
64  * to ares_build.h when the c-ares source code distribution archive file is
65  * created.
66  *
67  * File ares_build.h.dist is not included in the distribution archive.
68  * File ares_build.h is not present in the CVS tree.
69  *
70  * The distributed ares_build.h file is only intended to be used on systems
71  * which can not run the also distributed configure script.
72  *
73  * On systems capable of running the configure script, the configure process
74  * will overwrite the distributed ares_build.h file with one that is suitable
75  * and specific to the library being configured and built, which is generated
76  * from the ares_build.h.in template file.
77  *
78  * If you check out from CVS on a non-configure platform, you must run the
79  * appropriate buildconf* script to set up ares_build.h and other local files.
80  *
81  */
82
83 /* ================================================================ */
84 /*  DEFINITION OF THESE SYMBOLS SHALL NOT TAKE PLACE ANYWHERE ELSE  */
85 /* ================================================================ */
86
87 #ifdef CARES_SIZEOF_LONG
88 #  error "CARES_SIZEOF_LONG shall not be defined except in ares_build.h"
89    Error Compilation_aborted_CARES_SIZEOF_LONG_already_defined
90 #endif
91
92 #ifdef CARES_TYPEOF_ARES_SOCKLEN_T
93 #  error "CARES_TYPEOF_ARES_SOCKLEN_T shall not be defined except in ares_build.h"
94    Error Compilation_aborted_CARES_TYPEOF_ARES_SOCKLEN_T_already_defined
95 #endif
96
97 #ifdef CARES_SIZEOF_ARES_SOCKLEN_T
98 #  error "CARES_SIZEOF_ARES_SOCKLEN_T shall not be defined except in ares_build.h"
99    Error Compilation_aborted_CARES_SIZEOF_ARES_SOCKLEN_T_already_defined
100 #endif
101
102 /* ================================================================ */
103 /*    EXTERNAL INTERFACE SETTINGS FOR NON-CONFIGURE SYSTEMS ONLY    */
104 /* ================================================================ */
105
106 #if defined(__DJGPP__) || defined(__GO32__)
107 #  define CARES_SIZEOF_LONG           4
108 #  define CARES_TYPEOF_ARES_SOCKLEN_T int
109 #  define CARES_SIZEOF_ARES_SOCKLEN_T 4
110
111 #elif defined(__SALFORDC__)
112 #  define CARES_SIZEOF_LONG           4
113 #  define CARES_TYPEOF_ARES_SOCKLEN_T int
114 #  define CARES_SIZEOF_ARES_SOCKLEN_T 4
115
116 #elif defined(__BORLANDC__)
117 #  define CARES_SIZEOF_LONG           4
118 #  define CARES_TYPEOF_ARES_SOCKLEN_T FIXME
119 #  define CARES_SIZEOF_ARES_SOCKLEN_T -1
120
121 #elif defined(__TURBOC__)
122 #  define CARES_SIZEOF_LONG           4
123 #  define CARES_TYPEOF_ARES_SOCKLEN_T FIXME
124 #  define CARES_SIZEOF_ARES_SOCKLEN_T -1
125
126 #elif defined(__WATCOMC__)
127 #  define CARES_SIZEOF_LONG           4
128 #  define CARES_TYPEOF_ARES_SOCKLEN_T FIXME
129 #  define CARES_SIZEOF_ARES_SOCKLEN_T -1
130
131 #elif defined(__POCC__)
132 #  define CARES_SIZEOF_LONG           4
133 #  define CARES_TYPEOF_ARES_SOCKLEN_T int
134 #  define CARES_SIZEOF_ARES_SOCKLEN_T 4
135
136 #elif defined(__LCC__)
137 #  define CARES_SIZEOF_LONG           4
138 #  define CARES_TYPEOF_ARES_SOCKLEN_T FIXME
139 #  define CARES_SIZEOF_ARES_SOCKLEN_T -1
140
141 #elif defined(__SYMBIAN32__)
142 #  define CARES_SIZEOF_LONG           4
143 #  define CARES_TYPEOF_ARES_SOCKLEN_T FIXME
144 #  define CARES_SIZEOF_ARES_SOCKLEN_T -1
145
146 #elif defined(__MWERKS__)
147 #  define CARES_SIZEOF_LONG           4
148 #  define CARES_TYPEOF_ARES_SOCKLEN_T FIXME
149 #  define CARES_SIZEOF_ARES_SOCKLEN_T -1
150
151 #elif defined(_WIN32_WCE)
152 #  define CARES_SIZEOF_LONG           4
153 #  define CARES_TYPEOF_ARES_SOCKLEN_T int
154 #  define CARES_SIZEOF_ARES_SOCKLEN_T 4
155
156 #elif defined(__MINGW32__)
157 #  define CARES_SIZEOF_LONG           4
158 #  define CARES_TYPEOF_ARES_SOCKLEN_T int
159 #  define CARES_SIZEOF_ARES_SOCKLEN_T 4
160
161 #elif defined(__VMS)
162 #  define CARES_SIZEOF_LONG           4
163 #  define CARES_TYPEOF_ARES_SOCKLEN_T FIXME
164 #  define CARES_SIZEOF_ARES_SOCKLEN_T -1
165
166 #elif defined(__OS400__)
167 #  if defined(__ILEC400__)
168 #    define CARES_SIZEOF_LONG           4
169 #    define CARES_TYPEOF_ARES_SOCKLEN_T FIXME
170 #    define CARES_SIZEOF_ARES_SOCKLEN_T -1
171 #  endif
172
173 #elif defined(__MVS__)
174 #  if defined(__IBMC__) || defined(__IBMCPP__)
175 #    if defined(_ILP32)
176 #      define CARES_SIZEOF_LONG           4
177 #    elif defined(_LP64)
178 #      define CARES_SIZEOF_LONG           8
179 #    endif
180 #    define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t
181 #    define CARES_SIZEOF_ARES_SOCKLEN_T 4
182 #    define CARES_PULL_SYS_TYPES_H      1
183 #    define CARES_PULL_SYS_SOCKET_H     1
184 #  endif
185
186 #elif defined(__370__)
187 #  if defined(__IBMC__) || defined(__IBMCPP__)
188 #    if defined(_ILP32)
189 #      define CARES_SIZEOF_LONG           4
190 #    elif defined(_LP64)
191 #      define CARES_SIZEOF_LONG           8
192 #    endif
193 #    define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t
194 #    define CARES_SIZEOF_ARES_SOCKLEN_T 4
195 #    define CARES_PULL_SYS_TYPES_H      1
196 #    define CARES_PULL_SYS_SOCKET_H     1
197 #  endif
198
199 #elif defined(TPF)
200 #  define CARES_SIZEOF_LONG           8
201 #  define CARES_TYPEOF_ARES_SOCKLEN_T int
202 #  define CARES_SIZEOF_ARES_SOCKLEN_T 4
203
204 /* ===================================== */
205 /*    KEEP MSVC THE PENULTIMATE ENTRY    */
206 /* ===================================== */
207
208 #elif defined(_MSC_VER)
209 #  define CARES_SIZEOF_LONG           4
210 #  define CARES_TYPEOF_ARES_SOCKLEN_T int
211 #  define CARES_SIZEOF_ARES_SOCKLEN_T 4
212
213 /* ===================================== */
214 /*    KEEP GENERIC GCC THE LAST ENTRY    */
215 /* ===================================== */
216
217 #elif defined(__GNUC__)
218 #  if defined(__i386__) || defined(__ppc__)
219 #    define CARES_SIZEOF_LONG           4
220 #    define CARES_TYPEOF_ARES_SOCKLEN_T FIXME
221 #    define CARES_SIZEOF_ARES_SOCKLEN_T -1
222 #  elif defined(__x86_64__) || defined(__ppc64__)
223 #    define CARES_SIZEOF_LONG           8
224 #    define CARES_TYPEOF_ARES_SOCKLEN_T FIXME
225 #    define CARES_SIZEOF_ARES_SOCKLEN_T -1
226 #  endif
227
228 #else
229 #  error "Unknown non-configure build target!"
230    Error Compilation_aborted_Unknown_non_configure_build_target
231 #endif
232
233 /* CARES_PULL_SYS_TYPES_H is defined above when inclusion of header file  */
234 /* sys/types.h is required here to properly make type definitions below.  */
235 #ifdef CARES_PULL_SYS_TYPES_H
236 #  include <sys/types.h>
237 #endif
238
239 /* CARES_PULL_SYS_SOCKET_H is defined above when inclusion of header file  */
240 /* sys/socket.h is required here to properly make type definitions below.  */
241 #ifdef CARES_PULL_SYS_SOCKET_H
242 #  include <sys/socket.h>
243 #endif
244
245 /* Data type definition of ares_socklen_t. */
246
247 #ifdef CARES_TYPEOF_ARES_SOCKLEN_T
248   typedef CARES_TYPEOF_ARES_SOCKLEN_T ares_socklen_t;
249 #endif
250
251 #endif /* __CARES_BUILD_H */