]> sjero.net Git - wget/blob - windows/config-compiler.h
a4435ef99075883ae370cf04f363a99c049a2102
[wget] / windows / config-compiler.h
1 /* Support for various Windows compilation environments.
2    Copyright (C) 2005 Free Software Foundation, Inc.
3
4 This file is part of GNU Wget.
5
6 GNU Wget is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 GNU Wget is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with Wget; if not, write to the Free Software Foundation, Inc.,
18 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19
20 In addition, as a special exception, the Free Software Foundation
21 gives permission to link the code of its release of Wget with the
22 OpenSSL project's "OpenSSL" library (or with modified versions of it
23 that use the same license as the "OpenSSL" library), and distribute
24 the linked executables.  You must obey the GNU General Public License
25 in all respects for all of the code used other than "OpenSSL".  If you
26 modify this file, you may extend this exception to your version of the
27 file, but you are not obligated to do so.  If you do not wish to do
28 so, delete this exception statement from your version.  */
29
30
31 /* This file contains information about various compilers used to
32    build Wget on the Windows platform using its "native" API,
33    sometimes referred to as "Win32".  (This excludes Cygwin, which
34    defines a Unix-compatible layer and is handled with configure.)
35
36    The above "information about compilers" includes both actual
37    differences in compilers (such as how to construct 64-bit constants
38    or whether C99 `bool' is available) and the properties of the
39    compilation environment and run-time library shipped with the
40    compiler (such as whether stat handles large files or whether
41    strtoll is present).
42
43    The file is divided into sections for each compiler/environment.
44    Being based on free software, MinGW's section comes first and
45    contains most of the explanatory comments.  Things that apply to
46    *all* compilers, as well as things that are specific to Wget,
47    belong in src/mswindows.h.  */
48 \f
49 /* -------------------- */
50 /* MinGW (GCC) section. */
51 /* -------------------- */
52 #if defined __MINGW32__
53
54 #define OS_TYPE "Windows-MinGW"
55
56 #define LL(n) n##LL
57
58 /* Transparently support statting large files, like POSIX's LFS API
59    does, by aliasing stat and fstat to their equivalents that do LFS.
60    Most Windows compilers we support use _stati64 (but have different
61    names for 2nd argument type, see below), so we use that.  */
62 #define stat_alias _stati64
63 #define fstat_alias _fstati64
64
65 /* On Windows the 64-bit stat requires an explicitly different type
66    for the 2nd argument, so we define a struct_stat macro that expands
67    to the appropriate type on Windows, and to the regular struct stat
68    on Unix.
69
70    Note that Borland C 5.5 has 64-bit stat (_stati64), but not a
71    64-bit fstat!  Because of that we also need a struct_fstat that
72    points to struct_stat on Unix and on Windows, except under Borland,
73    where it points to the 32-bit struct stat.  */
74
75 #define struct_stat struct _stati64
76 #define struct_fstat struct _stati64
77
78 /* MinGW 3.7 (or older) prototypes gai_strerror(), but is missing
79    from all import libraries. */
80 #ifdef ENABLE_IPV6
81 # define NEED_GAI_STRERROR
82 #endif
83
84 /* MinGW and GCC support some POSIX and C99 features.  */
85 #define HAVE_INTTYPES_H 1
86
87 #define HAVE__BOOL 1
88 #undef SIZEOF_LONG_LONG         /* avoid redefinition warning */
89 #define SIZEOF_LONG_LONG 8
90 #define HAVE_INTPTR_T 1 
91 #define HAVE_UINTPTR_T 1
92
93 #define HAVE_STRTOLL 1
94 \f
95 /* -------------------- */
96 /* MS Visual C section. */
97 /* -------------------- */
98 #elif defined _MSC_VER
99
100 #define OS_TYPE "Windows-MSVC"
101
102 #define LL(n) n##I64
103
104 #define stat_alias _stati64
105 #define fstat_alias _fstati64
106 #define struct_stat struct _stati64
107 #define struct_fstat struct _stati64
108
109 #define isatty _isatty
110
111 #if _MSC_VER >= 1300
112 # define HAVE__STRTOI64 1
113 #endif
114
115 #if _MSC_VER >= 1400
116 #pragma warning ( disable : 4996 )
117 #define _CRT_SECURE_NO_DEPRECATE
118 #define HAVE_SYS_UTIME_H 1
119 #undef HAVE_UTIME_H
120 #endif
121 \f
122 /* ------------------ */
123 /* Borland C section. */
124 /* ------------------ */
125 #elif defined __BORLANDC__
126
127 #define OS_TYPE "Windows-Borland"
128
129 #define LL(n) n##I64
130
131 #define stat_alias _stati64
132 #undef fstat_alias
133 #define struct_stat struct stati64
134 #undef struct_fstat
135 \f
136 /* ------------------------------ */
137 /* Digital Mars Compiler section. */
138 /* ------------------------------ */
139 #elif defined __DMC__
140
141 #define OS_TYPE "Windows-DMC"
142
143 #define LL(n) n##LL
144
145 /* DMC supports 64-bit types, including long long, but not statting
146    large files.  */
147 #undef stat_alias
148 #undef fstat_alias
149 /* If left undefined, sysdep.h will define these to struct stat. */
150 #undef struct_stat
151 #undef struct_fstat
152
153 /* DMC's runtime supports some POSIX and C99 headers, types, and
154    functions that we use.  */
155
156 #define HAVE_STDINT_H 1
157 #define HAVE_INTTYPES_H 1
158 #define HAVE_STDBOOL_H 1
159
160 #define HAVE_UINT32_T 1
161 #undef SIZEOF_LONG_LONG
162 #define SIZEOF_LONG_LONG 8
163 #define HAVE__BOOL 1
164
165 #define HAVE_USLEEP 1
166 #define HAVE_STRTOLL 1
167
168 \f
169 /* -------------------- */
170 /* OpenWatcom section.  */
171 /* -------------------- */
172 #elif defined __WATCOMC__
173
174 #define OS_TYPE "Windows-Watcom"
175
176 #define LL(n) n##LL
177
178 #define stat_alias _stati64
179 #define fstat_alias _fstati64
180 #define struct_stat struct _stati64
181 #define struct_fstat struct _stati64
182
183 #ifdef ENABLE_IPV6
184 # define NEED_GAI_STRERROR
185 #endif
186
187 #define HAVE_STDINT_H 1
188 #define HAVE_INTTYPES_H 1
189 #define HAVE_STDBOOL_H 1
190 #define HAVE_STRTOLL 1
191 #define HAVE_UINT32_T 1
192 #define HAVE_SYS_UTIME_H 1
193 #undef HAVE_UTIME_H
194 #undef socklen_t                /* avoid clash with <ws2tcpip.h> */
195
196 #undef SIZEOF_LONG_LONG
197 #define SIZEOF_LONG_LONG 8
198 \f
199 #else
200 # error Your compiler is not supported.
201 #endif