• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2004, 2005, 2006 Apple Inc.
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public License
15  * along with this library; see the file COPYING.LIB.  If not, write to
16  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  *
19  */
20 
21 #if defined(HAVE_CONFIG_H) && HAVE_CONFIG_H
22 #include "autotoolsconfig.h"
23 #endif
24 
25 #include <wtf/Platform.h>
26 
27 #if PLATFORM(WIN_OS) && !defined(BUILDING_WX__) && !COMPILER(GCC)
28 #if defined(BUILDING_JavaScriptCore) || defined(BUILDING_WTF)
29 #define JS_EXPORTDATA __declspec(dllexport)
30 #else
31 #define JS_EXPORTDATA __declspec(dllimport)
32 #endif
33 #if defined(BUILDING_WebCore) || defined(BUILDING_WebKit)
34 #define WEBKIT_EXPORTDATA __declspec(dllexport)
35 #else
36 #define WEBKIT_EXPORTDATA __declspec(dllimport)
37 #endif
38 #else
39 #define JS_EXPORTDATA
40 #define WEBKIT_EXPORTDATA
41 #endif
42 
43 #define MOBILE 0
44 
45 #ifdef __APPLE__
46 #define HAVE_FUNC_USLEEP 1
47 #endif /* __APPLE__ */
48 
49 #if PLATFORM(WIN_OS)
50 
51 #ifndef _WIN32_WINNT
52 #define _WIN32_WINNT 0x0500
53 #endif
54 
55 #ifndef WINVER
56 #define WINVER 0x0500
57 #endif
58 
59 // If we don't define these, they get defined in windef.h.
60 // We want to use std::min and std::max.
61 #ifndef max
62 #define max max
63 #endif
64 #ifndef min
65 #define min min
66 #endif
67 
68 // CURL needs winsock, so don't prevent inclusion of it
69 #if !USE(CURL)
70 #ifndef _WINSOCKAPI_
71 #define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h
72 #endif
73 #endif
74 
75 #endif /* PLATFORM(WIN_OS) */
76 
77 // On MSW, wx headers need to be included before windows.h is.
78 // The only way we can always ensure this is if we include wx here.
79 #if PLATFORM(WX)
80 // The defines in KeyboardCodes.h conflict with Windows as well, and the only way I've found
81 // to address the problem is include KeyboarddCodes.h before windows.h, so do it here.
82 #include "KeyboardCodes.h"
83 #include <wx/defs.h>
84 #endif
85 
86 // ANDROID def should be after all PLATFORM to avoid override.
87 // USE_SYSTEM_MALLOC needs to be defined before include FastMalloc.h
88 #if PLATFORM(ANDROID)
89 #define USE_SYSTEM_MALLOC 1
90 #define ANDROID_MOBILE      // change can be merged back to WebKit.org for MOBILE
91 #ifdef ANDROID_PLUGINS
92 #define WTF_USE_JAVASCRIPTCORE_BINDINGS 1
93 #define WTF_USE_NPOBJECT 1
94 #endif
95 #define LOG_DISABLED 1
96 #include <wtf/Assertions.h>
97 // center place to handle which option feature ANDROID will enable
98 #undef ENABLE_CHANNEL_MESSAGING
99 #define ENABLE_CHANNEL_MESSAGING 1
100 #undef ENABLE_DATABASE
101 #define ENABLE_DATABASE 1
102 #undef ENABLE_DOM_STORAGE
103 #define ENABLE_DOM_STORAGE 1
104 #undef ENABLE_FTPDIR
105 #define ENABLE_FTPDIR 0
106 #ifndef ENABLE_SVG
107 #define ENABLE_SVG 0
108 #undef ENABLE_V8_LOCKERS
109 #define ENABLE_V8_LOCKERS 1
110 #undef ENABLE_VIDEO
111 #define ENABLE_VIDEO 1
112 #undef ENABLE_WORKERS
113 #define ENABLE_WORKERS 1
114 #endif
115 #if ENABLE_SVG
116 #if !defined(ENABLE_SVG_ANIMATION)
117 #define ENABLE_SVG_ANIMATION 0 // to enable:
118     // fix error: no matching function for call to 'sort(WebCore::SVGSMILElement**, WebCore::SVGSMILElement**, WebCore::PriorityCompare)'
119     // fix error: no matching function for call to 'sort(WebCore::SMILTime*, WebCore::SMILTime*)'
120     // add ENABLE_SVG_ANIMATION=1 to SVG_FLAGS in JavaScriptCore.derived.mk
121 #endif
122 #define ENABLE_SVG_AS_IMAGE 1
123 #define ENABLE_SVG_FILTERS 1
124 #define ENABLE_SVG_FONTS 1
125 #define ENABLE_SVG_FOREIGN_OBJECT 1
126 #define ENABLE_SVG_USE 1
127 #endif
128 #define ENABLE_XBL 0
129 #define ENABLE_XPATH 0
130 #define ENABLE_XSLT 0
131 
132 #undef ENABLE_ARCHIVE
133 #define ENABLE_ARCHIVE 0 // ANDROID addition: allow web archive to be disabled
134 #define ENABLE_OFFLINE_WEB_APPLICATIONS 1
135 #define ENABLE_TOUCH_EVENTS 1
136 #undef ENABLE_GEOLOCATION
137 #define ENABLE_GEOLOCATION 1
138 #endif  // PLATFORM(ANDROID)
139 
140 #ifdef __cplusplus
141 
142 // These undefs match up with defines in WebCorePrefix.h for Mac OS X.
143 // Helps us catch if anyone uses new or delete by accident in code and doesn't include "config.h".
144 #undef new
145 #undef delete
146 #include <wtf/FastMalloc.h>
147 
148 #endif
149 
150 // this breaks compilation of <QFontDatabase>, at least, so turn it off for now
151 // Also generates errors on wx on Windows, presumably because these functions
152 // are used from wx headers.
153 #if !PLATFORM(QT) && !PLATFORM(WX)
154 #include <wtf/DisallowCType.h>
155 #endif
156 
157 #if COMPILER(MSVC)
158 #define SKIP_STATIC_CONSTRUCTORS_ON_MSVC 1
159 #else
160 #define SKIP_STATIC_CONSTRUCTORS_ON_GCC 1
161 #endif
162 
163 #if PLATFORM(WIN)
164 #if defined(WIN_CAIRO)
165 #undef WTF_PLATFORM_CG
166 #define WTF_PLATFORM_CAIRO 1
167 #undef WTF_USE_CFNETWORK
168 #define WTF_USE_CURL 1
169 #ifndef _WINSOCKAPI_
170 #define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h
171 #endif
172 #else
173 #define WTF_PLATFORM_CG 1
174 #undef WTF_PLATFORM_CAIRO
175 #define WTF_USE_CFNETWORK 1
176 #undef WTF_USE_CURL
177 #endif
178 #undef WTF_USE_WININET
179 #define WTF_PLATFORM_CF 1
180 #define WTF_USE_PTHREADS 0
181 #endif
182 
183 #if PLATFORM(MAC)
184 // ATSUI vs. CoreText
185 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
186 #define WTF_USE_ATSUI 0
187 #define WTF_USE_CORE_TEXT 1
188 #else
189 #define WTF_USE_ATSUI 1
190 #define WTF_USE_CORE_TEXT 0
191 #endif
192 
193 // New theme
194 #define WTF_USE_NEW_THEME 1
195 #endif // PLATFORM(MAC)
196 
197 #if PLATFORM(SYMBIAN)
198 #undef WIN32
199 #undef _WIN32
200 #undef SKIP_STATIC_CONSTRUCTORS_ON_GCC
201 #define USE_SYSTEM_MALLOC 1
202 #define U_HAVE_INT8_T 0
203 #define U_HAVE_INT16_T 0
204 #define U_HAVE_INT32_T 0
205 #define U_HAVE_INT64_T 0
206 #define U_HAVE_INTTYPES_H 0
207 
208 #include <stdio.h>
209 #include <limits.h>
210 #include <wtf/MathExtras.h>
211 #endif
212 
213 #if !defined(WTF_USE_V8)
214 /* Currently Chromium is the only platform which uses V8 by default */
215 #if PLATFORM(CHROMIUM)
216 #define WTF_USE_V8 1
217 #else
218 #define WTF_USE_V8 0
219 #endif /* PLATFORM(CHROMIUM) */
220 #endif /* !defined(WTF_USE_V8) */
221 
222 /* Using V8 implies not using JSC and vice versa */
223 #define WTF_USE_JSC !WTF_USE_V8
224 
225 #if PLATFORM(CG)
226 #ifndef CGFLOAT_DEFINED
227 #ifdef __LP64__
228 typedef double CGFloat;
229 #else
230 typedef float CGFloat;
231 #endif
232 #define CGFLOAT_DEFINED 1
233 #endif
234 #endif /* PLATFORM(CG) */
235 
236 #ifdef BUILDING_ON_TIGER
237 #undef ENABLE_FTPDIR
238 #define ENABLE_FTPDIR 0
239 #endif
240 
241 #if PLATFORM(WIN) && PLATFORM(CG)
242 #define WTF_USE_SAFARI_THEME 1
243 #endif
244