]> sjero.net Git - wget/blob - windows/config-compiler.h
[svn] Define SIZEOF_LONG_LONG under DMC.
[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 specifics of various compilers supported on the
32    Windows platform.  In this case "compiler" can refer either to the
33    specific compiler feature (such as how to construct a 64-bit
34    constant) or to a feature of the compilation environment shipped
35    with the compiler.
36
37    The file is divided into sections for each compiler.  Most of the
38    explanatory comments are in the first (MinGW) section to avoid
39    repetition.
40
41    Things that apply to *all* compilers, as well as things that are
42    specific to Wget, belong in src/mswindows.h.  */
43
44 /* For all compilers: must include <sys/stat.h> before redefining
45    stat.  */
46
47 #include <sys/stat.h>
48 \f
49 /* -------------------- */
50 /* MinGW (GCC) section. */
51 /* -------------------- */
52 #if defined __GNUC__
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.  All Windows compilers we support use _stati64 (but have
60    different names for 2nd argument type, see below), so we use
61    that.  */
62 #define stat(fname, buf) _stati64 (fname, buf)
63
64 /* On Windows the 64-bit stat requires an explicitly different type
65    for the 2nd argument, so we define a struct_stat macro that expands
66    to the appropriate type on Windows, and to the regular struct stat
67    on Unix.
68
69    Note that Borland C 5.5 has 64-bit stat (_stati64), but not a
70    64-bit fstat!  Because of that we also need a struct_fstat that
71    points to struct_stat on Unix and on Windows, except under Borland,
72    where it points to the 32-bit struct stat.  */
73
74 #define struct_stat struct _stati64
75 #define struct_fstat struct _stati64
76
77 /* MinGW 3.7 (or older) prototypes gai_strerror(), but is missing
78    from all import libraries. */
79 #ifdef ENABLE_IPV6
80 # undef gai_strerror
81 # define gai_strerror windows_strerror
82 #endif
83 \f
84 /* -------------------- */
85 /* MS Visual C section. */
86 /* -------------------- */
87 #elif defined _MSC_VER
88
89 #define OS_TYPE "Windows-MSVC"
90
91 #define LL(n) n##I64
92
93 #define stat(fname, buf) _stati64 (fname, buf)
94 #define struct_stat struct _stati64
95 #define struct_fstat struct _stati64
96
97 #define isatty _isatty
98 \f
99 /* ------------------ */
100 /* Borland C section. */
101 /* ------------------ */
102 #elif defined __BORLANDC__
103
104 #define OS_TYPE "Windows-Borland"
105
106 #define LL(n) n##I64
107 #define stat(fname, buf) _stati64 (fname, buf)
108 #define struct_stat struct stati64
109 #define struct_fstat struct stat
110 \f
111 /* ------------------------------ */
112 /* Digital Mars Compiler section. */
113 /* ------------------------------ */
114 #elif defined __DMC__
115
116 #define OS_TYPE "Windows-DMC"
117
118 #define LL(n) n##LL
119 #undef stat
120 #undef struct_stat
121 #undef struct_fstat
122
123 /* DMC's runtime supports some POSIX and C99 features we use.  */
124 #define HAVE_USLEEP 1
125 #define HAVE_STDBOOL_H 1
126 #define HAVE__BOOL 1
127 #undef SIZEOF_LONG_LONG
128 #define SIZEOF_LONG_LONG 8
129 \f
130 #else
131 # error Your compiler is not supported.
132 #endif