Git init
[external/curl.git] / src / setup.h
1 #ifndef HEADER_CURL_SRC_SETUP_H
2 #define HEADER_CURL_SRC_SETUP_H
3 /***************************************************************************
4  *                                  _   _ ____  _
5  *  Project                     ___| | | |  _ \| |
6  *                             / __| | | | |_) | |
7  *                            | (__| |_| |  _ <| |___
8  *                             \___|\___/|_| \_\_____|
9  *
10  * Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
11  *
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.
15  *
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.
19  *
20  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21  * KIND, either express or implied.
22  *
23  ***************************************************************************/
24
25 #define CURL_NO_OLDIES
26
27 /*
28  * Define WIN32 when build target is Win32 API
29  */
30
31 #if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32) && !defined(__SYMBIAN32__)
32 #define WIN32
33 #endif
34
35 /*
36  * Include configuration script results or hand-crafted
37  * configuration file for platforms which lack config tool.
38  */
39
40 #ifdef HAVE_CONFIG_H
41 #include "curl_config.h"
42 #else
43
44 #ifdef WIN32
45 #include "config-win32.h"
46 #endif
47
48 #if defined(macintosh) && defined(__MRC__)
49 #  include "config-mac.h"
50 #endif
51
52 #ifdef __riscos__
53 #include "config-riscos.h"
54 #endif
55
56 #ifdef __AMIGA__
57 #include "config-amigaos.h"
58 #endif
59
60 #ifdef __SYMBIAN32__
61 #include "config-symbian.h"
62 #endif
63
64 #ifdef TPF
65 #include "config-tpf.h"
66 #endif
67
68 #endif /* HAVE_CONFIG_H */
69
70 /*
71  * AIX 4.3 and newer needs _THREAD_SAFE defined to build
72  * proper reentrant code. Others may also need it.
73  */
74
75 #ifdef NEED_THREAD_SAFE
76 #  ifndef _THREAD_SAFE
77 #    define _THREAD_SAFE
78 #  endif
79 #endif
80
81 /*
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.
85  */
86
87 #ifdef NEED_REENTRANT
88 #  ifndef _REENTRANT
89 #    define _REENTRANT
90 #  endif
91 #endif
92
93 /*
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.
102  */
103
104 #ifdef HAVE_WINDOWS_H
105 #  ifndef WIN32_LEAN_AND_MEAN
106 #    define WIN32_LEAN_AND_MEAN
107 #  endif
108 #  include <windows.h>
109 #  ifdef HAVE_WINSOCK2_H
110 #    include <winsock2.h>
111 #    ifdef HAVE_WS2TCPIP_H
112 #       include <ws2tcpip.h>
113 #    endif
114 #  else
115 #    ifdef HAVE_WINSOCK_H
116 #      include <winsock.h>
117 #    endif
118 #  endif
119 #endif
120
121 /*
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.
125  */
126
127 #undef USE_WINSOCK
128
129 #ifdef HAVE_WINSOCK2_H
130 #  define USE_WINSOCK 2
131 #else
132 #  ifdef HAVE_WINSOCK_H
133 #    define USE_WINSOCK 1
134 #  endif
135 #endif
136
137 #ifdef TPF
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)
143 #endif
144
145 #include <stdio.h>
146
147 #ifdef __TANDEM
148 #include <floss.h>
149 #endif
150
151
152 #ifndef OS
153 #define OS "unknown"
154 #endif
155
156 #if !defined(fileno) && !defined(WIN32) /* sunos 4 have this as a macro! */
157 int fileno( FILE *stream);
158 #endif
159
160 #ifdef WIN32
161 #define DIR_CHAR      "\\"
162 #define DOT_CHAR      "_"
163 #else
164 #ifdef __EMX__
165 /* 20000318 mgs
166  * OS/2 supports leading dots in filenames if the volume is formatted
167  * with JFS or HPFS. */
168 #define DIR_CHAR      "\\"
169 #define DOT_CHAR      "."
170 #else
171
172 #ifdef DJGPP
173 #include <tcp.h>
174 #ifdef word
175 #undef word
176 #endif
177 #define DIR_CHAR      "/"
178 #define DOT_CHAR      "_"
179 #else
180
181 #define DIR_CHAR      "/"
182 #define DOT_CHAR      "."
183
184 #endif /* !DJGPP */
185 #endif /* !__EMX__ */
186 #endif /* !WIN32 */
187
188 #ifdef __riscos__
189 #define USE_ENVIRONMENT
190 #endif
191
192 #ifdef __BEOS__
193 #define typedef_bool
194 #endif
195
196 #if (defined(NETWARE) && !defined(__NOVELL_LIBC__))
197 #include <sys/timeval.h>
198 #endif
199
200 #ifndef UNPRINTABLE_CHAR
201 /* define what to use for unprintable characters */
202 #define UNPRINTABLE_CHAR '.'
203 #endif
204
205 #ifndef HAVE_STRDUP
206 #include "strdup.h"
207 #define strdup(ptr) curlx_strdup(ptr)
208 #endif
209
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)
213 #endif
214
215 /*
216  * Include macros and defines that should only be processed once.
217  */
218
219 #ifndef __SETUP_ONCE_H
220 #include "setup_once.h"
221 #endif
222
223 #endif /* HEADER_CURL_SRC_SETUP_H */