Watt-32 tcp/ip  2.2 dev-rel.10
config.h
Go to the documentation of this file.
1 
6 #ifndef _w32_CONFIG_H
7 #define _w32_CONFIG_H
8 
9 #if defined(_w32_WATTCP_H) && !defined(_w32_TARGET_H)
10 #error CONFIG.H must be included after TARGET.H
11 #endif
12 
21 #undef USE_DEBUG /* Include debug code */
22 #undef USE_MULTICAST /* Include IP multicast code by Jim Martin */
23 #undef USE_BIND /* Include Bind resolver code */
24 #undef USE_BSD_API /* Include BSD-sockets */
25 #undef USE_BSD_FATAL /* Exit application on BSD-socket fatal errors */
26 #undef USE_BOOTP /* Include BOOTP client code */
27 #undef USE_DHCP /* Include DHCP boot client code */
28 #undef USE_RARP /* Include RARP boot client code. Contributed by Dan Kegel. */
29 #undef USE_IPV6 /* Include IPv6 dual-stack support */
30 #undef USE_LANGUAGE /* Include Language translation code */
31 #undef USE_FRAGMENTS /* Include IP-fragment handling */
32 #undef USE_STATISTICS /* Include protocol statistics count */
33 #undef USE_FORTIFY /* Use Fortify malloc-lib for allocations */
34 #undef USE_MPATROL /* Use mpatrol malloc-lib for allocations etc. */
35 #undef USE_FSEXT /* Use djgpp's File Extensions for file I/O functions */
36 #undef USE_LOOPBACK /* Use the simple loopback device */
37 #undef USE_EMBEDDED /* Make an embeddable (ROM-able) target. See note at end */
38 #undef USE_BUFFERED_IO /* Use buffered I/O in pcconfig.c */
39 #undef USE_TFTP /* Include TFTP protocol for simple file retrival */
40 #undef USE_UDP_ONLY /* Exclude all stuff related to the TCP protocol */
41 #undef USE_TCP_SACK /* Include TCP Selective ACK feature (not yet) */
42 #undef USE_ECHO_DISC /* Include echo/discard servers */
43 #undef USE_PPPOE /* PPP-over-Ethernet encapsulation */
44 #undef USE_RS232_DBG /* Include RS232 serial port writing of trace-info */
45 #undef USE_FAST_PKT /* Use faster all real-mode PKTDRVR receiver (DOSX only) */
46 #undef USE_DEAD_GWD /* Dead Gateway detection in ARP module */
47 #undef USE_GZIP /* Use gzip compression for PPPP and/or pcap debug file. Also for SCTP. */
48 #undef USE_PROFILER /* Include simple execution profiler (only DOSX with 64-bit types) */
49 #undef USE_TCP_MD5 /* TCP MD5 signature option */
50 #undef USE_IDNA /* Support national characters in DNS name lookups. */
51 #undef USE_DYNIP_CLI /* Support DynDNS.org name/IP client */
52 #undef USE_SCTP /* Stream Control Transfer Protocol; experimental */
53 
54 #undef USE_BIGENDIAN /* Hard to believe, but someone uses Watt-32 on
55  * Motorola/PowerPC embedded target.
56  */
57 
58 /*
59  * No options needed if you want to make a TSR.
60  * You can reduce code further by "#define USE_UDP_ONLY".
61  */
62 #if defined(MAKE_TSR)
63  #define OPT_DEFINED
64 #endif
65 
66 
67 /*
68  * Building small-model applications doesn't leave
69  * much room for the fancy stuff :-(
70  */
71 #if !defined(OPT_DEFINED) && defined(__SMALL__) && !defined(__SMALL32__)
72  #define USE_UDP_ONLY /* test udp-only (cookie,ping) */
73  #define OPT_DEFINED
74 #endif
75 
76 /*
77  * MS's Quick-C (6.0 at least) is severly limited in many ways..
78  */
79 #if !defined(OPT_DEFINED) && (defined(_MSC_VER) && (_MSC_VER <= 600) && defined(__LARGE__))
80  #define OPT_DEFINED
81 #endif
82 
83 /*
84  * So is Turbo-C (2.01 at least)
85  */
86 #if !defined(OPT_DEFINED) && (defined(OLD_TURBOC) && defined(__LARGE__))
87  #define OPT_DEFINED
88 #endif
89 
90 /*
91  * For other large models define these options:
92  */
93 #if !defined(OPT_DEFINED) && defined(__LARGE__)
94  #define USE_DEBUG
95  #define OPT_DEFINED
96 #endif
97 
98 /*
99  * Otherwise, for all targets define these options:
100  */
101 #if !defined(OPT_DEFINED)
102  #define USE_DEBUG
103  #define USE_BOOTP
104  #define USE_DHCP
105  #define USE_LANGUAGE
106  #define USE_FRAGMENTS
107  #define USE_STATISTICS
108  #define USE_BIND
109  #define USE_BSD_API
110  #define USE_BSD_FATAL
111  #define USE_LOOPBACK
112  #define USE_BUFFERED_IO
113  #define USE_TFTP
114  #define USE_MULTICAST
115  #define OPT_DEFINED
116 #endif
117 
118 /*
119  * Add some more options for djgpp, HighC, 32-bit Watcom/DMC and Win32/64
120  */
121 #if defined(__DJGPP__) || defined(__HIGHC__) || defined(WATCOM386) || \
122  defined(DMC386) || defined(WIN32) || defined(WIN64)
123  #define USE_ECHO_DISC
124  #define USE_RARP
125  #define USE_IPV6
126  #define USE_IDNA
127  #define USE_TCP_MD5
128  #define USE_GZIP
129  #define USE_DYNIP_CLI
130  #define USE_SCTP
131  #define USE_DEAD_GWD
132 #endif
133 
134 #if defined(__DJGPP__)
135  #define USE_FSEXT
136 /*#define USE_RS232_DBG */
137 /*#define USE_FORTIFY */
138 #endif
139 
140 #if defined(__HIGHC__)
141 /*#define USE_FORTIFY */
142 #endif
143 
144 #if (DOSX && DOSX != WINWATT)
145  #define USE_FAST_PKT
146 #endif
147 
148 #if (DOSX) && defined(HAVE_UINT64)
149  #define USE_PROFILER
150 #endif
151 
152 #if defined(__POCC__)
153  #undef USE_IDNA /* compiling punycode.c crashes pocc */
154  #undef USE_IPV6 /* pocc has problems with IPv6 code */
155 #endif
156 
157 
158 /*
159  * SCTP needs gzip compress/uncompress.
160  */
161 #if defined(USE_SCTP)
162  #define USE_GZIP
163 #endif
164 
165 /*
166  * Select malloc debuggers on Windows
167  */
168 #if defined(WIN32) && defined(_MSC_VER) && defined(_DEBUG) /* cl -MDd -D_DEBUG */
169 /*#define USE_CRTDBG */ /* use CrtDebug; faster than Fortify? */
170 /*#define USE_MPATROL */
171 
172 #elif defined(__MINGW32__) && !defined(NDEBUG)
173 /*#define USE_MPATROL */
174 /*#define USE_FORTIFY */
175 
176 #elif defined(WIN32) && defined(__WATCOMC__)
177 /* #define USE_STACKWALKER */ /* Not possible */
178 
179 #elif defined(__CYGWIN__) && !defined(NDEBUG)
180 /* #define USE_FORTIFY */
181 #endif
182 
183 #if defined(WIN32) && defined(_MSC_VER)
184  /* Use BugTrap DLL loaded at runtime.
185  * Ref: http://www.intellesoft.net/default.shtml
186  */
187 /*#define USE_BUGTRAP */
188  #define USE_STACKWALKER
189 #endif
190 
191 /*
192  * When generating a Swig wrapper for Python, misc.c is included
193  * in the Swig interface file (watt32_swig.i). Then we must use
194  * whatever mallocer python*.lib was built with.
195  */
196 #if defined(SWIG)
197  #undef USE_CRTDBG
198  #undef USE_BUGTRAP
199  #undef USE_MPATROL
200  #undef USE_FORTIFY
201 #endif
202 
203 #if defined(_MSC_VER) && 0
204  #undef USE_FRAGMENTS
205  #undef USE_MULTICAST
206  #undef USE_DHCP
207  #undef USE_RARP
208  #undef USE_IPV6
209  #undef USE_SCTP
210  #undef USE_LANGUAGE
211  #undef USE_BUFFERED_IO
212  #undef USE_TFTP
213  #undef USE_LOOPBACK
214  #undef USE_FORTIFY
215  #undef USE_BIND
216 #endif
217 
218 /*
219  * Test some illegal combinations.
220  */
221 #if defined(USE_IPV6) && !defined(USE_BSD_API)
222 #error USE_IPV6 requires USE_BSD_API
223 #endif
224 
225 #if defined(USE_BIND) && !defined(USE_BSD_API)
226 #error USE_BIND requires USE_BSD_API
227 #endif
228 
229 #if defined(USE_SCTP) && !defined(USE_IPV6)
230 #error USE_SCTP requires USE_IPV6
231 #endif
232 
233 #if defined(USE_UDP_ONLY) && defined(USE_BSD_API)
234 #error USE_UDP_ONLY and USE_BSD_API are meaningless
235 #endif
236 
237 #if defined(USE_UDP_ONLY) && defined(USE_DYNIP_CLI)
238 #error USE_UDP_ONLY and USE_DYNIP_CLI are meaningless
239 #endif
240 
241 #if defined(MAKE_TSR) && (DOSX)
242 #error Making 32-bit TSRs is unsupported
243 #endif
244 
245 #if defined(USE_PROFILER) && (!DOSX || !defined(HAVE_UINT64))
246 #error Cannot define USE_PROFILER for this target
247 #endif
248 
249 #if defined(__TURBOC__) && (__TURBOC__ <= 0x301)
250  #if defined(USE_BIND) || defined(USE_SOCKET) || defined(USE_STATISTICS)
251  #error tcc 2.0 cannot compile resolver, socket code or statistics
252  #endif
253 #endif
254 
255 #if defined(USE_FORTIFY) && defined(USE_MPATROL)
256  #error Cannot use both Fortify and mpatrol malloc libs.
257 #endif
258 
259 #if defined(USE_FORTIFY) && defined(USE_CRTDBG)
260  #error Cannot use both Fortify and CrtDebug.
261 #endif
262 
263 #if defined(USE_MPATROL) && defined(USE_CRTDBG)
264  #error Cannot use both mpatrol malloc libs and CrtDebug.
265 #endif
266 
267 #if defined(USE_MPATROL) && defined(USE_STACKWALKER)
268  #error Cannot use mpatrol with StackWalker.
269 #endif
270 
282 /*
283  * Hack fix: When building with djgpp 2.04, but the
284  * ./util/dj_err.exe was compiled with 2.03, it's
285  * necessary to define the following.
286  */
287 #undef MIXING_DJGPP_203_AND_204
288 
289 /*
290  * If building .html-documentation with doxygen, document everything.
291  * Add some stuff doxygen doesn't know about.
292  */
293 #ifdef DOXYGEN
294  #define __far
295  #define far
296  #define __interrupt
297  #define interrupt
298  #define __cdecl
299  #define cdecl
300  #define USE_DEBUG
301  #define USE_MULTICAST
302  #define USE_BIND
303  #define USE_BSD_API
304  #define USE_BSD_FATAL
305  #define USE_BOOTP
306  #define USE_DHCP
307  #define USE_RARP
308  #define USE_IPV6
309  #define USE_LANGUAGE
310  #define USE_FRAGMENTS
311  #define USE_STATISTICS
312  #define USE_FORTIFY
313  #define USE_FSEXT
314  #define USE_LOOPBACK
315  #define USE_EMBEDDED
316  #define USE_BUFFERED_IO
317  #define USE_TFTP
318  #define USE_UDP_ONLY
319  #define USE_TCP_SACK
320  #define USE_ECHO_DISC
321  #define USE_RS232_DBG
322  #define USE_FAST_PKT
323  #define USE_TCP_MD5
324 #endif
325 
326 #if defined(USE_GZIP)
327 /*#define Z_NO_INFLATE */ /* we don't need to read gzip streams */
328  #define Z_PREFIX /* use 'z_' prefix for zlib functions */
329  #define FASTEST /* use fastest deflate method */
330 /*#define ASMV */ /* use assembly version of longest_match() */
331  #define NO_vsnprintf
332  #define Z_PRINTF_BUFSIZE 1024
333 #endif
334 
335 /*
336  * A small HAVE_x section here.
337  */
338 #if defined(WIN32) || defined(WIN64)
339  #define HAVE_WINDNS_H
340 #endif
341 
342 #if (defined(__BORLANDC__) && (__BORLANDC__ < 0x5600)) || \
343  defined(__SALFORDC__) || defined(__DMC__)
344  #undef HAVE_WINDNS_H
345 #endif
346 
347 #endif /* _w32_CONFIG_H */
348