]> sjero.net Git - wget/blob - windows/config-compiler.h
[svn] Doc fixes.
[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
49 /* For all compilers: must include <sys/stat.h> *before* redefining
50    stat.  */
51 #include <sys/stat.h>
52 \f
53 /* -------------------- */
54 /* MinGW (GCC) section. */
55 /* -------------------- */
56 #if defined __MINGW32__
57
58 #define OS_TYPE "Windows-MinGW"
59
60 #define LL(n) n##LL
61
62 /* Transparently support statting large files, like POSIX's LFS API
63    does.  All Windows compilers we support use _stati64 (but have
64    different names for 2nd argument type, see below), so we use
65    that.  */
66 #define stat(fname, buf) _stati64 (fname, buf)
67
68 /* On Windows the 64-bit stat requires an explicitly different type
69    for the 2nd argument, so we define a struct_stat macro that expands
70    to the appropriate type on Windows, and to the regular struct stat
71    on Unix.
72
73    Note that Borland C 5.5 has 64-bit stat (_stati64), but not a
74    64-bit fstat!  Because of that we also need a struct_fstat that
75    points to struct_stat on Unix and on Windows, except under Borland,
76    where it points to the 32-bit struct stat.  */
77
78 #define struct_stat struct _stati64
79 #define struct_fstat struct _stati64
80
81 /* MinGW 3.7 (or older) prototypes gai_strerror(), but is missing
82    from all import libraries. */
83 #ifdef ENABLE_IPV6
84 # undef gai_strerror
85 # define gai_strerror windows_strerror
86 #endif
87 \f
88 /* -------------------- */
89 /* MS Visual C section. */
90 /* -------------------- */
91 #elif defined _MSC_VER
92
93 #define OS_TYPE "Windows-MSVC"
94
95 #define LL(n) n##I64
96
97 #define stat(fname, buf) _stati64 (fname, buf)
98 #define struct_stat struct _stati64
99 #define struct_fstat struct _stati64
100
101 #define isatty _isatty
102
103 #if _MSC_VER >= 1300
104 # define HAVE__STRTOI64 1
105 #endif
106 \f
107 /* ------------------ */
108 /* Borland C section. */
109 /* ------------------ */
110 #elif defined __BORLANDC__
111
112 #define OS_TYPE "Windows-Borland"
113
114 #define LL(n) n##I64
115 #define stat(fname, buf) _stati64 (fname, buf)
116 #define struct_stat struct stati64
117 #define struct_fstat struct stat
118 \f
119 /* ------------------------------ */
120 /* Digital Mars Compiler section. */
121 /* ------------------------------ */
122 #elif defined __DMC__
123
124 #define OS_TYPE "Windows-DMC"
125
126 #define LL(n) n##LL
127
128 /* DMC supports 64-bit types, including long long, but not statting
129    large files.  */
130 #undef stat
131 /* If left undefined, sysdep.h will define these to struct stat. */
132 #undef struct_stat
133 #undef struct_fstat
134
135 /* DMC's runtime supports some POSIX and C99 headers, types, and
136    functions that we use.  */
137
138 #define HAVE_STDINT_H 1
139 #define HAVE_INTTYPES_H 1
140 #define HAVE_STDBOOL_H 1
141
142 #define HAVE_UINT32_T 1
143 #undef SIZEOF_LONG_LONG         /* avoid redefinition warning */
144 #define SIZEOF_LONG_LONG 8
145 #define HAVE__BOOL 1
146
147 #define HAVE_USLEEP 1
148 #define HAVE_STRTOLL 1
149
150 \f
151 #else
152 # error Your compiler is not supported.
153 #endif