OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006 Apple Inc. | 2 * Copyright (C) 2004, 2005, 2006 Apple Inc. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 * Library General Public License for more details. | 12 * Library General Public License for more details. |
13 * | 13 * |
14 * You should have received a copy of the GNU Library General Public License | 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 | 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, | 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
17 * Boston, MA 02110-1301, USA. | 17 * Boston, MA 02110-1301, USA. |
18 * | 18 * |
19 */ | 19 */ |
20 | 20 |
21 #if defined(HAVE_CONFIG_H) && HAVE_CONFIG_H | 21 #if defined(HAVE_CONFIG_H) && HAVE_CONFIG_H |
22 #include "autotoolsconfig.h" | 22 #include "autotoolsconfig.h" |
23 #endif | 23 #endif |
24 | 24 |
25 #include <wtf/Platform.h> | 25 #include <wtf/Platform.h> |
26 | 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 |
27 #define MOBILE 0 | 43 #define MOBILE 0 |
28 | 44 |
29 #ifdef __APPLE__ | 45 #ifdef __APPLE__ |
30 #define HAVE_FUNC_USLEEP 1 | 46 #define HAVE_FUNC_USLEEP 1 |
31 #endif /* __APPLE__ */ | 47 #endif /* __APPLE__ */ |
32 | 48 |
33 #if PLATFORM(WIN_OS) | 49 #if PLATFORM(WIN_OS) |
34 | 50 |
35 #ifndef _WIN32_WINNT | 51 #ifndef _WIN32_WINNT |
36 #define _WIN32_WINNT 0x0500 | 52 #define _WIN32_WINNT 0x0500 |
(...skipping 14 matching lines...) Expand all Loading... |
51 | 67 |
52 // CURL needs winsock, so don't prevent inclusion of it | 68 // CURL needs winsock, so don't prevent inclusion of it |
53 #if !USE(CURL) | 69 #if !USE(CURL) |
54 #ifndef _WINSOCKAPI_ | 70 #ifndef _WINSOCKAPI_ |
55 #define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h | 71 #define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h |
56 #endif | 72 #endif |
57 #endif | 73 #endif |
58 | 74 |
59 #endif /* PLATFORM(WIN_OS) */ | 75 #endif /* PLATFORM(WIN_OS) */ |
60 | 76 |
61 // On MSW, wx headers need to be included before windows.h is. | |
62 // The only way we can always ensure this is if we include wx here. | |
63 #if PLATFORM(WX) | |
64 // The defines in KeyboardCodes.h conflict with Windows as well, and the only wa
y I've found | |
65 // to address the problem is include KeyboarddCodes.h before windows.h, so do it
here. | |
66 #include "KeyboardCodes.h" | |
67 #include <wx/defs.h> | |
68 #endif | |
69 | |
70 #if !PLATFORM(SYMBIAN) | |
71 #define IMPORT_C | |
72 #define EXPORT_C | |
73 #endif | |
74 | |
75 #define WTF_CHANGES 1 | |
76 | |
77 #ifdef __cplusplus | 77 #ifdef __cplusplus |
78 | 78 |
79 // These undefs match up with defines in WebCorePrefix.h for Mac OS X. | 79 // These undefs match up with defines in WebCorePrefix.h for Mac OS X. |
80 // Helps us catch if anyone uses new or delete by accident in code and doesn't i
nclude "config.h". | 80 // Helps us catch if anyone uses new or delete by accident in code and doesn't i
nclude "config.h". |
81 #undef new | 81 #undef new |
82 #undef delete | 82 #undef delete |
83 #include <wtf/FastMalloc.h> | 83 #include <wtf/FastMalloc.h> |
84 | 84 |
85 #endif | 85 #endif |
86 | 86 |
| 87 // On MSW, wx headers need to be included before windows.h is. |
| 88 // The only way we can always ensure this is if we include wx here. |
| 89 #if PLATFORM(WX) |
| 90 // The defines in KeyboardCodes.h conflict with Windows as well, and the only wa
y I've found |
| 91 // to address the problem is include KeyboarddCodes.h before windows.h, so do it
here. |
| 92 #include "KeyboardCodes.h" |
| 93 #include <wx/defs.h> |
| 94 #endif |
| 95 |
87 // this breaks compilation of <QFontDatabase>, at least, so turn it off for now | 96 // this breaks compilation of <QFontDatabase>, at least, so turn it off for now |
88 // Also generates errors on wx on Windows, presumably because these functions | 97 // Also generates errors on wx on Windows, presumably because these functions |
89 // are used from wx headers. | 98 // are used from wx headers. |
90 #if !PLATFORM(QT) && !PLATFORM(WX) && !PLATFORM(CHROMIUM) | 99 #if !PLATFORM(QT) && !PLATFORM(WX) && !PLATFORM(CHROMIUM) |
91 #include <wtf/DisallowCType.h> | 100 #include <wtf/DisallowCType.h> |
92 #endif | 101 #endif |
93 | 102 |
94 #if COMPILER(MSVC) | 103 #if COMPILER(MSVC) |
95 #define SKIP_STATIC_CONSTRUCTORS_ON_MSVC 1 | 104 #define SKIP_STATIC_CONSTRUCTORS_ON_MSVC 1 |
96 #else | 105 #else |
97 #define SKIP_STATIC_CONSTRUCTORS_ON_GCC 1 | 106 #define SKIP_STATIC_CONSTRUCTORS_ON_GCC 1 |
98 #endif | 107 #endif |
99 | 108 |
100 #if PLATFORM(WIN) | 109 #if PLATFORM(WIN) |
| 110 #if defined(WIN_CAIRO) |
| 111 #undef WTF_PLATFORM_CG |
| 112 #define WTF_PLATFORM_CAIRO 1 |
| 113 #undef WTF_USE_CFNETWORK |
| 114 #define WTF_USE_CURL 1 |
| 115 #ifndef _WINSOCKAPI_ |
| 116 #define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h |
| 117 #endif |
| 118 #else |
101 #define WTF_PLATFORM_CG 1 | 119 #define WTF_PLATFORM_CG 1 |
102 #undef WTF_PLATFORM_CAIRO | 120 #undef WTF_PLATFORM_CAIRO |
103 #define WTF_USE_CFNETWORK 1 | 121 #define WTF_USE_CFNETWORK 1 |
| 122 #undef WTF_USE_CURL |
| 123 #endif |
104 #undef WTF_USE_WININET | 124 #undef WTF_USE_WININET |
105 #define WTF_PLATFORM_CF 1 | 125 #define WTF_PLATFORM_CF 1 |
106 #define WTF_USE_PTHREADS 0 | 126 #define WTF_USE_PTHREADS 0 |
107 #endif | 127 #endif |
108 | 128 |
| 129 #if PLATFORM(MAC) |
| 130 // ATSUI vs. CoreText |
| 131 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) |
| 132 #define WTF_USE_ATSUI 0 |
| 133 #define WTF_USE_CORE_TEXT 1 |
| 134 #else |
| 135 #define WTF_USE_ATSUI 1 |
| 136 #define WTF_USE_CORE_TEXT 0 |
| 137 #endif |
| 138 |
| 139 // New theme |
| 140 #define WTF_USE_NEW_THEME 1 |
| 141 #endif // PLATFORM(MAC) |
| 142 |
109 #if PLATFORM(SYMBIAN) | 143 #if PLATFORM(SYMBIAN) |
110 #undef WIN32 | 144 #undef WIN32 |
111 #undef _WIN32 | 145 #undef _WIN32 |
112 #undef SKIP_STATIC_CONSTRUCTORS_ON_GCC | 146 #undef SKIP_STATIC_CONSTRUCTORS_ON_GCC |
113 #define USE_SYSTEM_MALLOC 1 | 147 #define USE_SYSTEM_MALLOC 1 |
114 #define U_HAVE_INT8_T 0 | 148 #define U_HAVE_INT8_T 0 |
115 #define U_HAVE_INT16_T 0 | 149 #define U_HAVE_INT16_T 0 |
116 #define U_HAVE_INT32_T 0 | 150 #define U_HAVE_INT32_T 0 |
117 #define U_HAVE_INT64_T 0 | 151 #define U_HAVE_INT64_T 0 |
118 #define U_HAVE_INTTYPES_H 0 | 152 #define U_HAVE_INTTYPES_H 0 |
119 | 153 |
120 #include <stdio.h> | 154 #include <stdio.h> |
121 #include <snprintf.h> | |
122 #include <limits.h> | 155 #include <limits.h> |
123 #include <wtf/MathExtras.h> | 156 #include <wtf/MathExtras.h> |
124 #endif | 157 #endif |
125 | 158 |
126 #if PLATFORM(CHROMIUM) | 159 #if PLATFORM(CHROMIUM) |
127 | 160 |
| 161 #if !PLATFORM(DARWIN) |
| 162 // Define SKIA on non-Mac. |
| 163 #define WTF_PLATFORM_SKIA 1 |
| 164 #endif // !PLATFORM(DARWIN) |
| 165 |
| 166 // WebCore should compile with WTF_CHANGES as WTF does. |
| 167 #define WTF_CHANGES 1 |
| 168 |
| 169 // Use the Googleurl library. |
128 #define WTF_USE_GOOGLEURL 1 | 170 #define WTF_USE_GOOGLEURL 1 |
129 | 171 |
130 #if PLATFORM(DARWIN) | 172 /* Chromium uses V8 by default */ |
131 | |
132 // Chromium's version of WebCore includes the following Objective-C classes. | |
133 // The system-provided WebCore framework may also provide these classes. | |
134 // Because of the nature of Objective-C binding (dynamically at runtime), | |
135 // it's possible for the Chromium-provided versions to interfere with the | |
136 // system-provided versions. This may happen when a system framework attempts | |
137 // to use WebCore.framework, such as when converting an HTML-flavored string | |
138 // to an NSAttributedString. The solution is to force Objective-C class names | |
139 // that would conflict to use alternate names. | |
140 // | |
141 // TODO(mark): This list will hopefully shrink but may also grow. Periodically | |
142 // run "nm libwebcore.a | grep -E '[atsATS] ([+-]\[|\.objc_class_name)'" and | |
143 // make sure that everything listed there has the alternate ChromiumWebCoreObjC | |
144 // name, and that nothing extraneous is listed here. If all Objective-C can | |
145 // be eliminated from Chromium's WebCore library, these defines should be | |
146 // removed entirely. | |
147 | |
148 #define ScrollbarPrefsObserver \ | |
149 ChromiumWebCoreObjCScrollbarPrefsObserver | |
150 #define WebCoreControlTintObserver \ | |
151 ChromiumWebCoreObjCWebCoreControlTintObserver | |
152 #define WebCoreRenderThemeNotificationObserver \ | |
153 ChromiumWebCoreObjCWebCoreRenderThemeNotificationObserver | |
154 #define WebFontCache \ | |
155 ChromiumWebCoreObjCWebFontCache | |
156 | |
157 #else // !PLATFORM(DARWIN) | |
158 | |
159 // Don't define SKIA on Mac. Undefine other things as well that might get set | |
160 // as side-effects. | |
161 #define WTF_PLATFORM_SKIA 1 | |
162 #undef WTF_PLATFORM_CG | |
163 #undef WTF_PLATFORM_CF | |
164 | |
165 #endif // !PLATFORM(DARWIN) | |
166 | |
167 #if !defined(WTF_USE_V8) | 173 #if !defined(WTF_USE_V8) |
168 #define WTF_USE_V8 1 | 174 #define WTF_USE_V8 1 |
169 #endif | 175 #endif |
170 | 176 |
| 177 // Chromium doesn't use CFNetwork |
171 #undef WTF_USE_CFNETWORK | 178 #undef WTF_USE_CFNETWORK |
| 179 |
172 // Upstream Platform.h's #ifdef check for other graphics libraries doesn't | 180 // Upstream Platform.h's #ifdef check for other graphics libraries doesn't |
173 // check SKIA, so it falls back on defining CAIRO. Undo that here. | 181 // check SKIA, so it falls back on defining CAIRO. Undo that here. |
174 // TODO(evanm): clean this up. | 182 // TODO(yaar): clean this up once config.h.in is upstreamed back to webkit. |
175 #undef WTF_PLATFORM_CAIRO | 183 #undef WTF_PLATFORM_CAIRO |
| 184 |
176 #endif // if PLATFORM(CHROMIUM) | 185 #endif // if PLATFORM(CHROMIUM) |
177 | 186 |
178 #if !defined(WTF_USE_V8) | 187 #if !defined(WTF_USE_V8) |
179 #define WTF_USE_V8 0 | 188 #define WTF_USE_V8 0 |
180 #endif | 189 #endif |
181 | 190 |
182 /* Using V8 implies not using JSC and vice versa */ | 191 /* Using V8 implies not using JSC and vice versa */ |
183 #define WTF_USE_JSC !WTF_USE_V8 | 192 #define WTF_USE_JSC !WTF_USE_V8 |
184 | 193 |
185 #if PLATFORM(CG) | 194 #if PLATFORM(CG) |
186 #ifndef CGFLOAT_DEFINED | 195 #ifndef CGFLOAT_DEFINED |
187 #ifdef __LP64__ | 196 #ifdef __LP64__ |
188 typedef double CGFloat; | 197 typedef double CGFloat; |
189 #else | 198 #else |
190 typedef float CGFloat; | 199 typedef float CGFloat; |
191 #endif | 200 #endif |
192 #define CGFLOAT_DEFINED 1 | 201 #define CGFLOAT_DEFINED 1 |
193 #endif | 202 #endif |
194 #endif /* PLATFORM(CG) */ | 203 #endif /* PLATFORM(CG) */ |
195 | 204 |
196 #ifdef BUILDING_ON_TIGER | 205 #ifdef BUILDING_ON_TIGER |
197 #undef ENABLE_FTPDIR | 206 #undef ENABLE_FTPDIR |
198 #define ENABLE_FTPDIR 0 | 207 #define ENABLE_FTPDIR 0 |
199 #endif | 208 #endif |
200 | 209 |
201 #if PLATFORM(WIN) && PLATFORM(CG) | 210 #if PLATFORM(WIN) && PLATFORM(CG) |
202 #define WTF_USE_SAFARI_THEME 1 | 211 #define WTF_USE_SAFARI_THEME 1 |
203 #endif | 212 #endif |
204 | |
205 #ifndef WEBCORE_NAVIGATOR_VENDOR | |
206 #ifdef GOOGLE_CHROME_BUILD | |
207 #define WEBCORE_NAVIGATOR_VENDOR "Google Inc." | |
208 #else | |
209 #define WEBCORE_NAVIGATOR_VENDOR "" | |
210 #endif // ifdef GOOGLE_CHROME_BUILD | |
211 #endif // ifndef WEBCORE_NAVIGATOR_VENDOR | |
OLD | NEW |