~ubuntu-branches/ubuntu/hardy/curl/hardy-updates

« back to all changes in this revision

Viewing changes to lib/setup.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2006-10-30 10:56:48 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20061030105648-uo8q8w9xklb40b4k
Tags: 7.15.5-1ubuntu1
* Merge from debian unstable. Remaining Ubuntu changes:
  - debian/control: Drop libdb4.2 build dependency.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21
21
 * KIND, either express or implied.
22
22
 *
23
 
 * $Id: setup.h,v 1.110 2006-06-08 06:12:31 bagder Exp $
 
23
 * $Id: setup.h,v 1.117 2006-08-04 01:13:24 yangtse Exp $
24
24
 ***************************************************************************/
25
25
 
26
26
#ifdef HTTP_ONLY
81
81
 * winsock2.h, ws2tcpip.h or winsock.h. Any other windows thing belongs
82
82
 * to any other further and independant block.  Under Cygwin things work
83
83
 * just as under linux (e.g. <sys/socket.h>) and the winsock headers should
84
 
 * never be included.
 
84
 * never be included when __CYGWIN__ is defined.  configure script takes
 
85
 * care of this, not defining HAVE_WINDOWS_H, HAVE_WINSOCK_H, HAVE_WINSOCK2_H,
 
86
 * neither HAVE_WS2TCPIP_H when __CYGWIN__ is defined.
85
87
 */
86
88
 
87
 
#if defined(HAVE_WINDOWS_H) && !defined(__CYGWIN__)
 
89
#ifdef HAVE_WINDOWS_H
88
90
#  ifndef WIN32_LEAN_AND_MEAN
89
91
#    define WIN32_LEAN_AND_MEAN
90
92
#  endif
109
111
#define FALSE 0
110
112
#endif
111
113
 
112
 
#if !defined(__cplusplus) && !defined(__BEOS__) && !defined(typedef_bool)
 
114
#if !defined(__cplusplus) && !defined(__BEOS__) && !defined(__ECOS) && !defined(typedef_bool)
113
115
typedef unsigned char bool;
114
116
#define typedef_bool
115
117
#endif
193
195
#define curlassert(x)
194
196
#endif
195
197
 
196
 
#ifdef MSG_NOSIGNAL
197
 
/* If we have the MSG_NOSIGNAL define, we make sure to use that in the forth
198
 
   argument to send() and recv() */
199
 
#define SEND_4TH_ARG MSG_NOSIGNAL
200
 
#define HAVE_MSG_NOSIGNAL 1 /* we have MSG_NOSIGNAL */
201
 
#else
202
 
#define SEND_4TH_ARG 0
203
 
#endif /* MSG_NOSIGNAL */
204
198
 
205
199
/* To make large file support transparent even on Windows */
206
200
#if defined(WIN32) && (SIZEOF_CURL_OFF_T > 4)
215
209
#endif /* Win32 with large file support */
216
210
 
217
211
 
218
 
/* Below we define four functions. They should
 
212
/* Below we define some functions. They should
219
213
   1. close a socket
220
 
   2. read from a socket
221
 
   3. write to a socket
222
214
 
223
215
   4. set the SIGALRM signal timeout
224
216
   5. set dir/file naming defines
229
221
#if !defined(__GNUC__) || defined(__MINGW32__)
230
222
#define sclose(x) closesocket(x)
231
223
 
232
 
/* Since Windows doesn't have/use the POSIX prototype for send() and recv(),
233
 
   we typecast the third argument in the macros to avoid compiler warnings. */
234
 
#define sread(x,y,z) recv(x,y,(int)(z), SEND_4TH_ARG)
235
 
#define swrite(x,y,z) (size_t)send(x,y, (int)(z), SEND_4TH_ARG)
236
224
#undef HAVE_ALARM
237
225
#else
238
226
     /* gcc-for-win is still good :) */
239
227
#define sclose(x) close(x)
240
 
#define sread(x,y,z) recv(x,y,z, SEND_4TH_ARG)
241
 
#define swrite(x,y,z) send(x,y,z, SEND_4TH_ARG)
242
228
#define HAVE_ALARM
243
229
#endif /* !GNU or mingw */
244
230
 
250
236
#ifdef DJGPP
251
237
#include <sys/ioctl.h>
252
238
#define sclose(x)         close_s(x)
253
 
#define sread(x,y,z)      read_s(x,y,z)
254
 
#define swrite(x,y,z)     write_s(x,y,z)
255
239
#define select(n,r,w,x,t) select_s(n,r,w,x,t)
256
240
#define ioctl(x,y,z) ioctlsocket(x,y,(char *)(z))
257
241
#define IOCTL_3_ARGS
264
248
 
265
249
#ifdef __BEOS__
266
250
#define sclose(x) closesocket(x)
267
 
#define sread(x,y,z) (ssize_t)recv(x,y,z, SEND_4TH_ARG)
268
 
#define swrite(x,y,z) (ssize_t)send(x,y,z, SEND_4TH_ARG)
269
251
#else /* __BEOS__ */
270
252
#define sclose(x) close(x)
271
 
#define sread(x,y,z) recv(x,y,z, SEND_4TH_ARG)
272
 
#define swrite(x,y,z) send(x,y,z, SEND_4TH_ARG)
273
253
#endif /* __BEOS__ */
274
254
 
275
255
#define HAVE_ALARM
311
291
#endif /* curl_socket_typedef */
312
292
 
313
293
 
314
 
#if defined(ENABLE_IPV6) && defined(USE_ARES)
315
 
#error "ares does not yet support IPv6. Disable IPv6 or ares and rebuild"
316
 
#endif
317
 
 
318
294
#if defined(WIN32) && !defined(__CYGWIN__) && !defined(USE_ARES) && \
319
295
    !defined(__LCC__)  /* lcc-win32 doesn't have _beginthreadex() */
320
296
#ifdef ENABLE_IPV6
385
361
#define DEBUGF(x)
386
362
#endif
387
363
 
 
364
/*
 
365
 * Include macros and defines that should only be processed once.
 
366
 */
 
367
 
 
368
#ifndef __SETUP_ONCE_H
 
369
#include "setup_once.h"
 
370
#endif
 
371
 
388
372
#endif /* __LIB_CURL_SETUP_H */