1 #ifndef HEADER_CURL_SRC_SETUP_H
2 #define HEADER_CURL_SRC_SETUP_H
3 /***************************************************************************
5 * Project ___| | | | _ \| |
7 * | (__| |_| | _ <| |___
8 * \___|\___/|_| \_\_____|
10 * Copyright (C) 1998 - 2010, 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.
23 ***************************************************************************/
25 #define CURL_NO_OLDIES
28 * Define WIN32 when build target is Win32 API
31 #if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32) && !defined(__SYMBIAN32__)
36 * Include configuration script results or hand-crafted
37 * configuration file for platforms which lack config tool.
41 #include "curl_config.h"
45 #include "config-win32.h"
48 #if defined(macintosh) && defined(__MRC__)
49 # include "config-mac.h"
53 #include "config-riscos.h"
57 #include "config-amigaos.h"
61 #include "config-symbian.h"
65 #include "config-tpf.h"
68 #endif /* HAVE_CONFIG_H */
71 * AIX 4.3 and newer needs _THREAD_SAFE defined to build
72 * proper reentrant code. Others may also need it.
75 #ifdef NEED_THREAD_SAFE
82 * Tru64 needs _REENTRANT set for a few function prototypes and
83 * things to appear in the system header files. Unixware needs it
84 * to build proper reentrant code. Others may also need it.
94 * Include header files for windows builds before redefining anything.
95 * Use this preproessor block only to include or exclude windows.h,
96 * winsock2.h, ws2tcpip.h or winsock.h. Any other windows thing belongs
97 * to any other further and independent block. Under Cygwin things work
98 * just as under linux (e.g. <sys/socket.h>) and the winsock headers should
99 * never be included when __CYGWIN__ is defined. configure script takes
100 * care of this, not defining HAVE_WINDOWS_H, HAVE_WINSOCK_H, HAVE_WINSOCK2_H,
101 * neither HAVE_WS2TCPIP_H when __CYGWIN__ is defined.
104 #ifdef HAVE_WINDOWS_H
105 # ifndef WIN32_LEAN_AND_MEAN
106 # define WIN32_LEAN_AND_MEAN
108 # include <windows.h>
109 # ifdef HAVE_WINSOCK2_H
110 # include <winsock2.h>
111 # ifdef HAVE_WS2TCPIP_H
112 # include <ws2tcpip.h>
115 # ifdef HAVE_WINSOCK_H
116 # include <winsock.h>
122 * Define USE_WINSOCK to 2 if we have and use WINSOCK2 API, else
123 * define USE_WINSOCK to 1 if we have and use WINSOCK API, else
124 * undefine USE_WINSOCK.
129 #ifdef HAVE_WINSOCK2_H
130 # define USE_WINSOCK 2
132 # ifdef HAVE_WINSOCK_H
133 # define USE_WINSOCK 1
138 # include <sys/socket.h>
139 /* change which select is used for the curl command line tool */
140 # define select(a,b,c,d,e) tpf_select_bsd(a,b,c,d,e)
141 /* and turn off the progress meter */
142 # define CONF_DEFAULT (0|CONF_NOPROGRESS)
156 #if !defined(fileno) && !defined(WIN32) /* sunos 4 have this as a macro! */
157 int fileno( FILE *stream);
161 #define DIR_CHAR "\\"
166 * OS/2 supports leading dots in filenames if the volume is formatted
167 * with JFS or HPFS. */
168 #define DIR_CHAR "\\"
185 #endif /* !__EMX__ */
189 #define USE_ENVIRONMENT
196 #if (defined(NETWARE) && !defined(__NOVELL_LIBC__))
197 #include <sys/timeval.h>
200 #ifndef UNPRINTABLE_CHAR
201 /* define what to use for unprintable characters */
202 #define UNPRINTABLE_CHAR '.'
207 #define strdup(ptr) curlx_strdup(ptr)
210 /* Define S_ISREG if not defined by system headers, f.e. MSVC */
211 #if !defined(S_ISREG) && defined(S_IFMT) && defined(S_IFREG)
212 #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
216 * Include macros and defines that should only be processed once.
219 #ifndef __SETUP_ONCE_H
220 #include "setup_once.h"
223 #endif /* HEADER_CURL_SRC_SETUP_H */