1 #ifndef __SRC_CURL_SETUP_H
2 #define __SRC_CURL_SETUP_H
3 /***************************************************************************
5 * Project ___| | | | _ \| |
7 * | (__| |_| | _ <| |___
8 * \___|\___/|_| \_\_____|
10 * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
12 * This software is licensed as described in the file COPYING, which
13 * you should have received as part of this distribution. The terms
14 * are also available at http://curl.haxx.se/docs/copyright.html.
16 * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17 * copies of the Software, and permit persons to whom the Software is
18 * furnished to do so, under the terms of the COPYING file.
20 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 * KIND, either express or implied.
24 ***************************************************************************/
26 #define CURL_NO_OLDIES
29 * Define WIN32 when build target is Win32 API
32 #if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32) && !defined(__SYMBIAN32__)
37 * Include configuration script results or hand-crafted
38 * configuration file for platforms which lack config tool.
42 #include "curl_config.h"
46 #include "config-win32.h"
49 #if defined(macintosh) && defined(__MRC__)
50 # include "config-mac.h"
54 #include "config-riscos.h"
58 #include "config-amigaos.h"
62 #include "config-symbian.h"
66 #include "config-tpf.h"
69 #endif /* HAVE_CONFIG_H */
72 * AIX 4.3 and newer needs _THREAD_SAFE defined to build
73 * proper reentrant code. Others may also need it.
76 #ifdef NEED_THREAD_SAFE
83 * Tru64 needs _REENTRANT set for a few function prototypes and
84 * things to appear in the system header files. Unixware needs it
85 * to build proper reentrant code. Others may also need it.
95 * Include header files for windows builds before redefining anything.
96 * Use this preproessor block only to include or exclude windows.h,
97 * winsock2.h, ws2tcpip.h or winsock.h. Any other windows thing belongs
98 * to any other further and independent block. Under Cygwin things work
99 * just as under linux (e.g. <sys/socket.h>) and the winsock headers should
100 * never be included when __CYGWIN__ is defined. configure script takes
101 * care of this, not defining HAVE_WINDOWS_H, HAVE_WINSOCK_H, HAVE_WINSOCK2_H,
102 * neither HAVE_WS2TCPIP_H when __CYGWIN__ is defined.
105 #ifdef HAVE_WINDOWS_H
106 # ifndef WIN32_LEAN_AND_MEAN
107 # define WIN32_LEAN_AND_MEAN
109 # include <windows.h>
110 # ifdef HAVE_WINSOCK2_H
111 # include <winsock2.h>
112 # ifdef HAVE_WS2TCPIP_H
113 # include <ws2tcpip.h>
116 # ifdef HAVE_WINSOCK_H
117 # include <winsock.h>
123 * Define USE_WINSOCK to 2 if we have and use WINSOCK2 API, else
124 * define USE_WINSOCK to 1 if we have and use WINSOCK API, else
125 * undefine USE_WINSOCK.
130 #ifdef HAVE_WINSOCK2_H
131 # define USE_WINSOCK 2
133 # ifdef HAVE_WINSOCK_H
134 # define USE_WINSOCK 1
139 # include <sys/socket.h>
140 /* change which select is used for the curl command line tool */
141 # define select(a,b,c,d,e) tpf_select_bsd(a,b,c,d,e)
142 /* and turn off the progress meter */
143 # define CONF_DEFAULT (0|CONF_NOPROGRESS)
157 #if !defined(fileno) && !defined(WIN32) /* sunos 4 have this as a macro! */
158 int fileno( FILE *stream);
162 #define DIR_CHAR "\\"
167 * OS/2 supports leading dots in filenames if the volume is formatted
168 * with JFS or HPFS. */
169 #define DIR_CHAR "\\"
186 #endif /* !__EMX__ */
190 #define USE_ENVIRONMENT
197 #if (defined(NETWARE) && !defined(__NOVELL_LIBC__))
198 #include <sys/timeval.h>
201 #ifndef UNPRINTABLE_CHAR
202 /* define what to use for unprintable characters */
203 #define UNPRINTABLE_CHAR '.'
208 #define strdup(ptr) curlx_strdup(ptr)
212 * Include macros and defines that should only be processed once.
215 #ifndef __SETUP_ONCE_H
216 #include "setup_once.h"
219 #endif /* __SRC_CURL_SETUP_H */