1 | /* |
2 | * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
3 | * Copyright (C) 2007-2009 Torch Mobile, Inc. |
4 | * |
5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions |
7 | * are met: |
8 | * 1. Redistributions of source code must retain the above copyright |
9 | * notice, this list of conditions and the following disclaimer. |
10 | * 2. Redistributions in binary form must reproduce the above copyright |
11 | * notice, this list of conditions and the following disclaimer in the |
12 | * documentation and/or other materials provided with the distribution. |
13 | * |
14 | * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY |
15 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
17 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR |
18 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
20 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
21 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
22 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
24 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
25 | */ |
26 | |
27 | #ifndef WTF_Platform_h |
28 | #define WTF_Platform_h |
29 | |
30 | /* ==== PLATFORM handles OS, operating environment, graphics API, and |
31 | CPU. This macro will be phased out in favor of platform adaptation |
32 | macros, policy decision macros, and top-level port definitions. ==== */ |
33 | #define PLATFORM(WTF_FEATURE) (defined WTF_PLATFORM_##WTF_FEATURE && WTF_PLATFORM_##WTF_FEATURE) |
34 | |
35 | |
36 | /* ==== Platform adaptation macros: these describe properties of the target environment. ==== */ |
37 | |
38 | /* COMPILER() - the compiler being used to build the project */ |
39 | #define COMPILER(WTF_FEATURE) (defined WTF_COMPILER_##WTF_FEATURE && WTF_COMPILER_##WTF_FEATURE) |
40 | /* CPU() - the target CPU architecture */ |
41 | #define CPU(WTF_FEATURE) (defined WTF_CPU_##WTF_FEATURE && WTF_CPU_##WTF_FEATURE) |
42 | /* HAVE() - specific system features (headers, functions or similar) that are present or not */ |
43 | #define HAVE(WTF_FEATURE) (defined HAVE_##WTF_FEATURE && HAVE_##WTF_FEATURE) |
44 | /* OS() - underlying operating system; only to be used for mandated low-level services like |
45 | virtual memory, not to choose a GUI toolkit */ |
46 | #define OS(WTF_FEATURE) (defined WTF_OS_##WTF_FEATURE && WTF_OS_##WTF_FEATURE) |
47 | |
48 | |
49 | /* ==== Policy decision macros: these define policy choices for a particular port. ==== */ |
50 | |
51 | /* USE() - use a particular third-party library or optional OS service */ |
52 | #define USE(WTF_FEATURE) (defined WTF_USE_##WTF_FEATURE && WTF_USE_##WTF_FEATURE) |
53 | /* ENABLE() - turn on a specific feature of WebKit */ |
54 | #define ENABLE(WTF_FEATURE) (defined ENABLE_##WTF_FEATURE && ENABLE_##WTF_FEATURE) |
55 | |
56 | |
57 | |
58 | /* ==== COMPILER() - the compiler being used to build the project ==== */ |
59 | |
60 | /* COMPILER(MSVC) Microsoft Visual C++ */ |
61 | /* COMPILER(MSVC7) Microsoft Visual C++ v7 or lower*/ |
62 | #if defined(_MSC_VER) |
63 | #define WTF_COMPILER_MSVC 1 |
64 | #if _MSC_VER < 1400 |
65 | #define WTF_COMPILER_MSVC7 1 |
66 | #endif |
67 | #endif |
68 | |
69 | /* COMPILER(RVCT) - ARM RealView Compilation Tools */ |
70 | #if defined(__CC_ARM) || defined(__ARMCC__) |
71 | #define WTF_COMPILER_RVCT 1 |
72 | #endif |
73 | |
74 | /* COMPILER(GCC) - GNU Compiler Collection */ |
75 | /* --gnu option of the RVCT compiler also defines __GNUC__ */ |
76 | #if defined(__GNUC__) && !COMPILER(RVCT) |
77 | #define WTF_COMPILER_GCC 1 |
78 | #define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) |
79 | #endif |
80 | |
81 | /* COMPILER(MINGW) - MinGW GCC */ |
82 | /* COMPILER(MINGW64) - mingw-w64 GCC - only used as additional check to exclude mingw.org specific functions */ |
83 | #if defined(__MINGW32__) |
84 | #define WTF_COMPILER_MINGW 1 |
85 | #include <_mingw.h> /* private MinGW header */ |
86 | #if defined(__MINGW64_VERSION_MAJOR) /* best way to check for mingw-w64 vs mingw.org */ |
87 | #define WTF_COMPILER_MINGW64 1 |
88 | #endif /* __MINGW64_VERSION_MAJOR */ |
89 | #endif /* __MINGW32__ */ |
90 | |
91 | /* COMPILER(SUNCC) - Sun CC compiler, also known as Sun Studio or Sun Pro */ |
92 | #if defined(__SUNPRO_CC) || defined(__SUNPRO_C) |
93 | #define WTF_COMPILER_SUNCC 1 |
94 | #endif |
95 | |
96 | /* COMPILER(WINSCW) - CodeWarrior for Symbian emulator */ |
97 | #if defined(__WINSCW__) |
98 | #define WTF_COMPILER_WINSCW 1 |
99 | #endif |
100 | |
101 | /* COMPILER(INTEL) - Intel C++ Compiler */ |
102 | #if defined(__INTEL_COMPILER) |
103 | #define WTF_COMPILER_INTEL 1 |
104 | #endif |
105 | |
106 | /* COMPILER(ACC) - HP aCC */ |
107 | #if defined(__HP_aCC) |
108 | #define WTF_COMPILER_ACC 1 |
109 | #endif |
110 | |
111 | /* COMPILER(XLC) - IBM XL */ |
112 | #if defined(__xlC__) |
113 | #define WTF_COMPILER_XLC 1 |
114 | #endif |
115 | |
116 | |
117 | /* ==== CPU() - the target CPU architecture ==== */ |
118 | |
119 | /* This also defines CPU(BIG_ENDIAN) or CPU(MIDDLE_ENDIAN) or neither, as appropriate. */ |
120 | |
121 | /* CPU(ALPHA) - DEC Alpha */ |
122 | #if defined(__alpha__) |
123 | #define WTF_CPU_ALPHA 1 |
124 | #endif |
125 | |
126 | /* CPU(IA64) - Itanium / IA-64 */ |
127 | #if defined(__ia64__) || defined(__ia64) || defined(_M_IA64) |
128 | #define WTF_CPU_IA64 1 |
129 | /* 32-bit mode on Itanium */ |
130 | #if !defined(__LP64__) |
131 | #define WTF_CPU_IA64_32 1 |
132 | #endif |
133 | /* Itanium can be both big- and little-endian; |
134 | we need to determine at compile time which one it is. |
135 | - HP's aCC compiler only compiles big-endian (so HP-UXi is always big-endian) |
136 | - GCC defines __BIG_ENDIAN__ for us (default on HP-UX) |
137 | - Linux is usually little-endian |
138 | - I've never seen AIX or Windows on IA-64, but they should be little-endian too |
139 | */ |
140 | #if defined(__BIG_ENDIAN__) || defined(__HP_aCC) |
141 | # define WTF_CPU_BIG_ENDIAN 1 |
142 | #endif |
143 | #endif |
144 | |
145 | /* CPU(HPPA) - a.k.a. PA-RISC */ |
146 | #if defined(__hppa) || defined(__hppa__) |
147 | #define WTF_CPU_HPPA 1 |
148 | #define WTF_CPU_BIG_ENDIAN 1 |
149 | #endif |
150 | |
151 | /* CPU(PPC) - PowerPC 32-bit */ |
152 | #if defined(__ppc__) \ |
153 | || defined(__PPC__) \ |
154 | || defined(__powerpc__) \ |
155 | || defined(__powerpc) \ |
156 | || defined(__POWERPC__) \ |
157 | || defined(_M_PPC) \ |
158 | || defined(__PPC) |
159 | #define WTF_CPU_PPC 1 |
160 | #define WTF_CPU_BIG_ENDIAN 1 |
161 | #endif |
162 | |
163 | /* CPU(PPC64) - PowerPC 64-bit */ |
164 | #if defined(__ppc64__) \ |
165 | || defined(__PPC64__) |
166 | #define WTF_CPU_PPC64 1 |
167 | #define WTF_CPU_BIG_ENDIAN 1 |
168 | #endif |
169 | |
170 | /* CPU(SH4) - SuperH SH-4 */ |
171 | #if defined(__SH4__) |
172 | #define WTF_CPU_SH4 1 |
173 | #endif |
174 | |
175 | /* CPU(SPARC32) - SPARC 32-bit */ |
176 | #if defined(__sparc) && !defined(__arch64__) || defined(__sparcv8) |
177 | #define WTF_CPU_SPARC32 1 |
178 | #define WTF_CPU_BIG_ENDIAN 1 |
179 | #endif |
180 | |
181 | /* CPU(SPARC64) - SPARC 64-bit */ |
182 | #if defined(__sparc__) && defined(__arch64__) || defined (__sparcv9) |
183 | #define WTF_CPU_SPARC64 1 |
184 | #define WTF_CPU_BIG_ENDIAN 1 |
185 | #endif |
186 | |
187 | /* CPU(SPARC) - any SPARC, true for CPU(SPARC32) and CPU(SPARC64) */ |
188 | #if CPU(SPARC32) || CPU(SPARC64) |
189 | #define WTF_CPU_SPARC 1 |
190 | #endif |
191 | |
192 | /* CPU(X86) - i386 / x86 32-bit */ |
193 | #if defined(__i386__) \ |
194 | || defined(i386) \ |
195 | || defined(_M_IX86) \ |
196 | || defined(_X86_) \ |
197 | || defined(__THW_INTEL) |
198 | #define WTF_CPU_X86 1 |
199 | #endif |
200 | |
201 | /* CPU(X86_64) - AMD64 / Intel64 / x86_64 64-bit */ |
202 | #if defined(__x86_64__) \ |
203 | || defined(_M_X64) |
204 | #define WTF_CPU_X86_64 1 |
205 | #endif |
206 | |
207 | /* 64-bit mode on AIX */ |
208 | #ifdef __64BIT__ |
209 | #define WTF_CPU_AIX64 1 |
210 | #endif |
211 | |
212 | /* CPU(AARCH64) - AArch64 */ |
213 | #if defined(__aarch64__) |
214 | #define WTF_CPU_AARCH64 1 |
215 | #if defined(__AARCH64EB__) |
216 | #define WTF_CPU_BIG_ENDIAN 1 |
217 | #endif |
218 | #endif |
219 | |
220 | /* CPU(ARM) - ARM, any version*/ |
221 | #if defined(arm) \ |
222 | || defined(__arm__) \ |
223 | || defined(__MARM__) |
224 | #define WTF_CPU_ARM 1 |
225 | |
226 | #if defined(__ARMEB__) |
227 | #define WTF_CPU_BIG_ENDIAN 1 |
228 | |
229 | #elif !defined(__ARM_EABI__) \ |
230 | && !defined(__EABI__) \ |
231 | && !defined(__VFP_FP__) \ |
232 | && !defined(ANDROID) |
233 | #define WTF_CPU_MIDDLE_ENDIAN 1 |
234 | |
235 | #endif |
236 | |
237 | #define WTF_ARM_ARCH_AT_LEAST(N) (CPU(ARM) && WTF_ARM_ARCH_VERSION >= N) |
238 | |
239 | /* Set WTF_ARM_ARCH_VERSION */ |
240 | #if defined(__ARM_ARCH_4__) \ |
241 | || defined(__ARM_ARCH_4T__) \ |
242 | || defined(__MARM_ARMV4__) \ |
243 | || defined(_ARMV4I_) |
244 | #define WTF_ARM_ARCH_VERSION 4 |
245 | |
246 | #elif defined(__ARM_ARCH_5__) \ |
247 | || defined(__ARM_ARCH_5T__) \ |
248 | || defined(__ARM_ARCH_5E__) \ |
249 | || defined(__ARM_ARCH_5TE__) \ |
250 | || defined(__ARM_ARCH_5TEJ__) \ |
251 | || defined(__MARM_ARMV5__) |
252 | #define WTF_ARM_ARCH_VERSION 5 |
253 | |
254 | #elif defined(__ARM_ARCH_6__) \ |
255 | || defined(__ARM_ARCH_6J__) \ |
256 | || defined(__ARM_ARCH_6K__) \ |
257 | || defined(__ARM_ARCH_6Z__) \ |
258 | || defined(__ARM_ARCH_6ZK__) \ |
259 | || defined(__ARM_ARCH_6T2__) \ |
260 | || defined(__ARMV6__) |
261 | #define WTF_ARM_ARCH_VERSION 6 |
262 | |
263 | #elif defined(__ARM_ARCH_7A__) \ |
264 | || defined(__ARM_ARCH_7R__) |
265 | #define WTF_ARM_ARCH_VERSION 7 |
266 | |
267 | /* RVCT sets _TARGET_ARCH_ARM */ |
268 | #elif defined(__TARGET_ARCH_ARM) |
269 | #define WTF_ARM_ARCH_VERSION __TARGET_ARCH_ARM |
270 | |
271 | #else |
272 | #define WTF_ARM_ARCH_VERSION 0 |
273 | |
274 | #endif |
275 | |
276 | /* Set WTF_THUMB_ARCH_VERSION */ |
277 | #if defined(__ARM_ARCH_4T__) |
278 | #define WTF_THUMB_ARCH_VERSION 1 |
279 | |
280 | #elif defined(__ARM_ARCH_5T__) \ |
281 | || defined(__ARM_ARCH_5TE__) \ |
282 | || defined(__ARM_ARCH_5TEJ__) |
283 | #define WTF_THUMB_ARCH_VERSION 2 |
284 | |
285 | #elif defined(__ARM_ARCH_6J__) \ |
286 | || defined(__ARM_ARCH_6K__) \ |
287 | || defined(__ARM_ARCH_6Z__) \ |
288 | || defined(__ARM_ARCH_6ZK__) \ |
289 | || defined(__ARM_ARCH_6M__) |
290 | #define WTF_THUMB_ARCH_VERSION 3 |
291 | |
292 | #elif defined(__ARM_ARCH_6T2__) \ |
293 | || defined(__ARM_ARCH_7__) \ |
294 | || defined(__ARM_ARCH_7A__) \ |
295 | || defined(__ARM_ARCH_7R__) \ |
296 | || defined(__ARM_ARCH_7M__) |
297 | #define WTF_THUMB_ARCH_VERSION 4 |
298 | |
299 | /* RVCT sets __TARGET_ARCH_THUMB */ |
300 | #elif defined(__TARGET_ARCH_THUMB) |
301 | #define WTF_THUMB_ARCH_VERSION __TARGET_ARCH_THUMB |
302 | |
303 | #else |
304 | #define WTF_THUMB_ARCH_VERSION 0 |
305 | #endif |
306 | |
307 | |
308 | /* CPU(ARMV5_OR_LOWER) - ARM instruction set v5 or earlier */ |
309 | /* On ARMv5 and below the natural alignment is required. |
310 | And there are some other differences for v5 or earlier. */ |
311 | #if !defined(ARMV5_OR_LOWER) && !WTF_ARM_ARCH_AT_LEAST(6) |
312 | #define WTF_CPU_ARMV5_OR_LOWER 1 |
313 | #endif |
314 | |
315 | |
316 | /* CPU(ARM_TRADITIONAL) - Thumb2 is not available, only traditional ARM (v4 or greater) */ |
317 | /* CPU(ARM_THUMB2) - Thumb2 instruction set is available */ |
318 | /* Only one of these will be defined. */ |
319 | #if !defined(WTF_CPU_ARM_TRADITIONAL) && !defined(WTF_CPU_ARM_THUMB2) |
320 | # if defined(thumb2) || defined(__thumb2__) \ |
321 | || ((defined(__thumb) || defined(__thumb__)) && WTF_THUMB_ARCH_VERSION == 4) |
322 | # define WTF_CPU_ARM_TRADITIONAL 0 |
323 | # define WTF_CPU_ARM_THUMB2 1 |
324 | # elif WTF_ARM_ARCH_AT_LEAST(4) |
325 | # define WTF_CPU_ARM_TRADITIONAL 1 |
326 | # define WTF_CPU_ARM_THUMB2 0 |
327 | # else |
328 | # error "Not supported ARM architecture" |
329 | # endif |
330 | #elif CPU(ARM_TRADITIONAL) && CPU(ARM_THUMB2) /* Sanity Check */ |
331 | # error "Cannot use both of WTF_CPU_ARM_TRADITIONAL and WTF_CPU_ARM_THUMB2 platforms" |
332 | #endif /* !defined(WTF_CPU_ARM_TRADITIONAL) && !defined(WTF_CPU_ARM_THUMB2) */ |
333 | |
334 | #endif /* ARM */ |
335 | |
336 | /* CPU(MIPS) - MIPS, any version */ |
337 | #if (defined(mips) || defined(__mips__) || defined(MIPS) || defined(_MIPS_)) |
338 | #define WTF_CPU_MIPS 1 |
339 | #include <sgidefs.h> |
340 | #if defined(__MIPSEB__) |
341 | #define WTF_CPU_BIG_ENDIAN 1 |
342 | #endif |
343 | /* CPU(MIPS64) - MIPS 64-bit both BIG and LITTLE endian */ |
344 | #if defined(_MIPS_SIM_ABI64) && (_MIPS_SIM == _MIPS_SIM_ABI64) |
345 | #define WTF_CPU_MIPS64 1 |
346 | #endif |
347 | |
348 | /* CPU(MIPSN32) - MIPS N32 ABI both BIG and LITTLE endian */ |
349 | #if defined(_MIPS_SIM_ABIN32) && (_MIPS_SIM == _MIPS_SIM_ABIN32) |
350 | #define WTF_CPU_MIPSN32 1 |
351 | #endif |
352 | |
353 | /* CPU(MIPS32) - MIPS O32 ABI both BIG and LITTLE endian */ |
354 | #if defined(_MIPS_SIM_ABI32) && (_MIPS_SIM == _MIPS_SIM_ABI32) |
355 | #define WTF_CPU_MIPS32 1 |
356 | #endif |
357 | #endif /* __mips__ */ |
358 | |
359 | |
360 | /* ==== OS() - underlying operating system; only to be used for mandated low-level services like |
361 | virtual memory, not to choose a GUI toolkit ==== */ |
362 | |
363 | /* OS(ANDROID) - Android */ |
364 | #ifdef ANDROID |
365 | #define WTF_OS_ANDROID 1 |
366 | #endif |
367 | |
368 | /* OS(AIX) - AIX */ |
369 | #ifdef _AIX |
370 | #define WTF_OS_AIX 1 |
371 | #endif |
372 | |
373 | /* OS(DARWIN) - Any Darwin-based OS, including Mac OS X and iPhone OS */ |
374 | #ifdef __APPLE__ |
375 | #define WTF_OS_DARWIN 1 |
376 | |
377 | /* FIXME: BUILDING_ON_.., and TARGETING... macros should be folded into the OS() system */ |
378 | #include <AvailabilityMacros.h> |
379 | #if !defined(MAC_OS_X_VERSION_10_5) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5 |
380 | #define BUILDING_ON_TIGER 1 |
381 | #elif !defined(MAC_OS_X_VERSION_10_6) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6 |
382 | #define BUILDING_ON_LEOPARD 1 |
383 | #elif !defined(MAC_OS_X_VERSION_10_7) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7 |
384 | #define BUILDING_ON_SNOW_LEOPARD 1 |
385 | #endif |
386 | #if !defined(MAC_OS_X_VERSION_10_5) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 |
387 | #define TARGETING_TIGER 1 |
388 | #elif !defined(MAC_OS_X_VERSION_10_6) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6 |
389 | #define TARGETING_LEOPARD 1 |
390 | #elif !defined(MAC_OS_X_VERSION_10_7) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_7 |
391 | #define TARGETING_SNOW_LEOPARD 1 |
392 | #endif |
393 | #include <TargetConditionals.h> |
394 | |
395 | #endif |
396 | |
397 | /* OS(IPHONE_OS) - iPhone OS */ |
398 | /* OS(MAC_OS_X) - Mac OS X (not including iPhone OS) */ |
399 | #if OS(DARWIN) && ((defined(TARGET_OS_EMBEDDED) && TARGET_OS_EMBEDDED) \ |
400 | || (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE) \ |
401 | || (defined(TARGET_IPHONE_SIMULATOR) && TARGET_IPHONE_SIMULATOR)) |
402 | #define WTF_OS_IPHONE_OS 1 |
403 | #elif OS(DARWIN) && defined(TARGET_OS_MAC) && TARGET_OS_MAC |
404 | #define WTF_OS_MAC_OS_X 1 |
405 | #endif |
406 | |
407 | /* OS(FREEBSD) - FreeBSD */ |
408 | #ifdef __FreeBSD__ |
409 | #define WTF_OS_FREEBSD 1 |
410 | #endif |
411 | |
412 | /* OS(HAIKU) - Haiku */ |
413 | #ifdef __HAIKU__ |
414 | #define WTF_OS_HAIKU 1 |
415 | #endif |
416 | |
417 | /* OS(HPUX) - HP-UX */ |
418 | #if defined(hpux) || defined(__hpux) |
419 | #define WTF_OS_HPUX 1 |
420 | #ifndef MAP_ANON |
421 | #define MAP_ANON MAP_ANONYMOUS |
422 | #endif |
423 | #endif |
424 | |
425 | /* OS(LINUX) - Linux */ |
426 | #ifdef __linux__ |
427 | #define WTF_OS_LINUX 1 |
428 | #endif |
429 | |
430 | /* OS(NETBSD) - NetBSD */ |
431 | #if defined(__NetBSD__) |
432 | #define WTF_PLATFORM_NETBSD 1 |
433 | #endif |
434 | |
435 | /* OS(OPENBSD) - OpenBSD */ |
436 | #ifdef __OpenBSD__ |
437 | #define WTF_OS_OPENBSD 1 |
438 | #endif |
439 | |
440 | /* OS(QNX) - QNX */ |
441 | #if defined(__QNXNTO__) |
442 | #define WTF_OS_QNX 1 |
443 | #endif |
444 | |
445 | /* OS(SOLARIS) - Solaris */ |
446 | #if defined(sun) || defined(__sun) |
447 | #define WTF_OS_SOLARIS 1 |
448 | #endif |
449 | |
450 | /* OS(WINCE) - Windows CE; note that for this platform OS(WINDOWS) is also defined */ |
451 | #if defined(_WIN32_WCE) |
452 | #define WTF_OS_WINCE 1 |
453 | #endif |
454 | |
455 | /* OS(WINDOWS) - Any version of Windows */ |
456 | #if defined(WIN32) || defined(_WIN32) |
457 | #define WTF_OS_WINDOWS 1 |
458 | #endif |
459 | |
460 | /* OS(SYMBIAN) - Symbian */ |
461 | #if defined (__SYMBIAN32__) |
462 | /* we are cross-compiling, it is not really windows */ |
463 | #undef WTF_OS_WINDOWS |
464 | #undef WTF_PLATFORM_WIN |
465 | #define WTF_OS_SYMBIAN 1 |
466 | #endif |
467 | |
468 | /* OS(UNIX) - Any Unix-like system */ |
469 | #if OS(AIX) \ |
470 | || OS(ANDROID) \ |
471 | || OS(DARWIN) \ |
472 | || OS(FREEBSD) \ |
473 | || OS(HAIKU) \ |
474 | || OS(HPUX) \ |
475 | || OS(LINUX) \ |
476 | || OS(NETBSD) \ |
477 | || OS(OPENBSD) \ |
478 | || OS(QNX) \ |
479 | || OS(SOLARIS) \ |
480 | || OS(SYMBIAN) \ |
481 | || defined(unix) \ |
482 | || defined(__unix) \ |
483 | || defined(__unix__) |
484 | #define WTF_OS_UNIX 1 |
485 | #endif |
486 | |
487 | /* Operating environments */ |
488 | |
489 | /* FIXME: these are all mixes of OS, operating environment and policy choices. */ |
490 | /* PLATFORM(CHROMIUM) */ |
491 | /* PLATFORM(QT) */ |
492 | /* PLATFORM(WX) */ |
493 | /* PLATFORM(GTK) */ |
494 | /* PLATFORM(HAIKU) */ |
495 | /* PLATFORM(MAC) */ |
496 | /* PLATFORM(WIN) */ |
497 | #if defined(BUILDING_CHROMIUM__) |
498 | #define WTF_PLATFORM_CHROMIUM 1 |
499 | #elif defined(BUILDING_QT__) |
500 | #define WTF_PLATFORM_QT 1 |
501 | #elif defined(BUILDING_WX__) |
502 | #define WTF_PLATFORM_WX 1 |
503 | #elif defined(BUILDING_GTK__) |
504 | #define WTF_PLATFORM_GTK 1 |
505 | #elif defined(BUILDING_HAIKU__) |
506 | #define WTF_PLATFORM_HAIKU 1 |
507 | #elif OS(DARWIN) |
508 | #define WTF_PLATFORM_MAC 1 |
509 | #elif OS(WINDOWS) |
510 | #define WTF_PLATFORM_WIN 1 |
511 | #endif |
512 | |
513 | /* PLATFORM(IPHONE) */ |
514 | /* FIXME: this is sometimes used as an OS switch and sometimes for higher-level things */ |
515 | #if (defined(TARGET_OS_EMBEDDED) && TARGET_OS_EMBEDDED) || (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE) |
516 | #define WTF_PLATFORM_IPHONE 1 |
517 | #endif |
518 | |
519 | /* PLATFORM(IPHONE_SIMULATOR) */ |
520 | #if defined(TARGET_IPHONE_SIMULATOR) && TARGET_IPHONE_SIMULATOR |
521 | #define WTF_PLATFORM_IPHONE 1 |
522 | #define WTF_PLATFORM_IPHONE_SIMULATOR 1 |
523 | #else |
524 | #define WTF_PLATFORM_IPHONE_SIMULATOR 0 |
525 | #endif |
526 | |
527 | #if !defined(WTF_PLATFORM_IPHONE) |
528 | #define WTF_PLATFORM_IPHONE 0 |
529 | #endif |
530 | |
531 | /* PLATFORM(ANDROID) */ |
532 | /* FIXME: this is sometimes used as an OS() switch, and other times to drive |
533 | policy choices */ |
534 | #if defined(ANDROID) |
535 | #define WTF_PLATFORM_ANDROID 1 |
536 | #endif |
537 | |
538 | /* Graphics engines */ |
539 | |
540 | /* PLATFORM(CG) and PLATFORM(CI) */ |
541 | #if PLATFORM(MAC) || PLATFORM(IPHONE) |
542 | #define WTF_PLATFORM_CG 1 |
543 | #endif |
544 | #if PLATFORM(MAC) && !PLATFORM(IPHONE) |
545 | #define WTF_PLATFORM_CI 1 |
546 | #endif |
547 | |
548 | /* PLATFORM(SKIA) for Win/Linux, CG/CI for Mac */ |
549 | #if PLATFORM(CHROMIUM) |
550 | #define ENABLE_HISTORY_ALWAYS_ASYNC 1 |
551 | #if OS(DARWIN) |
552 | #define WTF_PLATFORM_CG 1 |
553 | #define WTF_PLATFORM_CI 1 |
554 | #define WTF_USE_ATSUI 1 |
555 | #define WTF_USE_CORE_TEXT 1 |
556 | #else |
557 | #define WTF_PLATFORM_SKIA 1 |
558 | #endif |
559 | #endif |
560 | |
561 | #if PLATFORM(GTK) |
562 | #define WTF_PLATFORM_CAIRO 1 |
563 | #endif |
564 | |
565 | |
566 | /* OS(WINCE) && PLATFORM(QT) |
567 | We can not determine the endianess at compile time. For |
568 | Qt for Windows CE the endianess is specified in the |
569 | device specific makespec |
570 | */ |
571 | #if OS(WINCE) && PLATFORM(QT) |
572 | # include <QtGlobal> |
573 | # undef WTF_CPU_BIG_ENDIAN |
574 | # undef WTF_CPU_MIDDLE_ENDIAN |
575 | # if Q_BYTE_ORDER == Q_BIG_ENDIAN |
576 | # define WTF_CPU_BIG_ENDIAN 1 |
577 | # endif |
578 | |
579 | # include <ce_time.h> |
580 | #endif |
581 | |
582 | #if (PLATFORM(IPHONE) || PLATFORM(MAC) || PLATFORM(WIN) || (PLATFORM(QT) && OS(DARWIN) && !ENABLE(SINGLE_THREADED))) && !defined(ENABLE_JSC_MULTIPLE_THREADS) |
583 | #define ENABLE_JSC_MULTIPLE_THREADS 1 |
584 | #endif |
585 | |
586 | /* On Windows, use QueryPerformanceCounter by default */ |
587 | #if OS(WINDOWS) |
588 | #define WTF_USE_QUERY_PERFORMANCE_COUNTER 1 |
589 | #endif |
590 | |
591 | #if OS(WINCE) && !PLATFORM(QT) |
592 | #undef ENABLE_JSC_MULTIPLE_THREADS |
593 | #define ENABLE_JSC_MULTIPLE_THREADS 0 |
594 | #define USE_SYSTEM_MALLOC 0 |
595 | #define ENABLE_ICONDATABASE 0 |
596 | #define ENABLE_JAVASCRIPT_DEBUGGER 0 |
597 | #define ENABLE_FTPDIR 0 |
598 | #define ENABLE_PAN_SCROLLING 0 |
599 | #define ENABLE_WML 1 |
600 | #define HAVE_ACCESSIBILITY 0 |
601 | |
602 | #define NOMINMAX /* Windows min and max conflict with standard macros */ |
603 | #define NOSHLWAPI /* shlwapi.h not available on WinCe */ |
604 | |
605 | /* MSDN documentation says these functions are provided with uspce.lib. But we cannot find this file. */ |
606 | #define __usp10__ /* disable "usp10.h" */ |
607 | |
608 | #define _INC_ASSERT /* disable "assert.h" */ |
609 | #define assert(x) |
610 | |
611 | /* _countof is only included in CE6; for CE5 we need to define it ourself */ |
612 | #ifndef _countof |
613 | #define _countof(x) (sizeof(x) / sizeof((x)[0])) |
614 | #endif |
615 | |
616 | #endif /* OS(WINCE) && !PLATFORM(QT) */ |
617 | |
618 | #if PLATFORM(QT) |
619 | #define WTF_USE_QT4_UNICODE 1 |
620 | #elif OS(WINCE) |
621 | #define WTF_USE_WINCE_UNICODE 1 |
622 | #elif PLATFORM(GTK) |
623 | /* The GTK+ Unicode backend is configurable */ |
624 | #else |
625 | #define WTF_USE_ICU_UNICODE 1 |
626 | #endif |
627 | |
628 | #if PLATFORM(MAC) && !PLATFORM(IPHONE) |
629 | #define WTF_PLATFORM_CF 1 |
630 | #define WTF_USE_PTHREADS 1 |
631 | #define HAVE_PTHREAD_RWLOCK 1 |
632 | #if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_TIGER) && CPU(X86_64) |
633 | #define WTF_USE_PLUGIN_HOST_PROCESS 1 |
634 | #endif |
635 | #if !defined(ENABLE_MAC_JAVA_BRIDGE) |
636 | #define ENABLE_MAC_JAVA_BRIDGE 1 |
637 | #endif |
638 | #if !defined(ENABLE_DASHBOARD_SUPPORT) |
639 | #define ENABLE_DASHBOARD_SUPPORT 1 |
640 | #endif |
641 | #define HAVE_READLINE 1 |
642 | #define HAVE_RUNLOOP_TIMER 1 |
643 | #endif /* PLATFORM(MAC) && !PLATFORM(IPHONE) */ |
644 | |
645 | #if PLATFORM(CHROMIUM) && OS(DARWIN) |
646 | #define WTF_PLATFORM_CF 1 |
647 | #define WTF_USE_PTHREADS 1 |
648 | #define HAVE_PTHREAD_RWLOCK 1 |
649 | #endif |
650 | |
651 | #if PLATFORM(QT) && OS(DARWIN) |
652 | #define WTF_PLATFORM_CF 1 |
653 | #endif |
654 | |
655 | #if PLATFORM(IPHONE) |
656 | #define ENABLE_CONTEXT_MENUS 0 |
657 | #define ENABLE_DRAG_SUPPORT 0 |
658 | #define ENABLE_FTPDIR 1 |
659 | #define ENABLE_GEOLOCATION 1 |
660 | #define ENABLE_ICONDATABASE 0 |
661 | #define ENABLE_INSPECTOR 0 |
662 | #define ENABLE_MAC_JAVA_BRIDGE 0 |
663 | #define ENABLE_NETSCAPE_PLUGIN_API 0 |
664 | #define ENABLE_ORIENTATION_EVENTS 1 |
665 | #define ENABLE_REPAINT_THROTTLING 1 |
666 | #define HAVE_READLINE 1 |
667 | #define WTF_PLATFORM_CF 1 |
668 | #endif |
669 | |
670 | #if OS(IPHONE_OS) && !PLATFORM(QT) |
671 | #define WTF_USE_PTHREADS 1 |
672 | #define HAVE_PTHREAD_RWLOCK 1 |
673 | #endif |
674 | |
675 | #if PLATFORM(ANDROID) |
676 | #define WTF_USE_PTHREADS 1 |
677 | #define WTF_PLATFORM_SGL 1 |
678 | #define USE_SYSTEM_MALLOC 1 |
679 | #define ENABLE_MAC_JAVA_BRIDGE 1 |
680 | #define LOG_DISABLED 1 |
681 | /* Prevents Webkit from drawing the caret in textfields and textareas |
682 | This prevents unnecessary invals. */ |
683 | #define ENABLE_TEXT_CARET 1 |
684 | #define ENABLE_JAVASCRIPT_DEBUGGER 0 |
685 | #endif |
686 | |
687 | #if PLATFORM(WIN) |
688 | #define WTF_USE_WININET 1 |
689 | #endif |
690 | |
691 | #if PLATFORM(WX) |
692 | #define ENABLE_ASSEMBLER 1 |
693 | #if OS(DARWIN) |
694 | #define WTF_PLATFORM_CF 1 |
695 | #endif |
696 | #endif |
697 | |
698 | #if PLATFORM(GTK) |
699 | #if HAVE(PTHREAD_H) |
700 | #define WTF_USE_PTHREADS 1 |
701 | #define HAVE_PTHREAD_RWLOCK 1 |
702 | #endif |
703 | #endif |
704 | |
705 | #if PLATFORM(HAIKU) |
706 | #define HAVE_POSIX_MEMALIGN 1 |
707 | #define WTF_USE_CURL 1 |
708 | #define WTF_USE_PTHREADS 1 |
709 | #define HAVE_PTHREAD_RWLOCK 1 |
710 | #define USE_SYSTEM_MALLOC 1 |
711 | #define ENABLE_NETSCAPE_PLUGIN_API 0 |
712 | #endif |
713 | |
714 | #if !defined(HAVE_ACCESSIBILITY) |
715 | #if PLATFORM(IPHONE) || PLATFORM(MAC) || PLATFORM(WIN) || PLATFORM(GTK) || PLATFORM(CHROMIUM) |
716 | #define HAVE_ACCESSIBILITY 1 |
717 | #endif |
718 | #endif /* !defined(HAVE_ACCESSIBILITY) */ |
719 | |
720 | #if OS(UNIX) && !OS(SYMBIAN) |
721 | #define HAVE_SIGNAL_H 1 |
722 | #endif |
723 | |
724 | #if !OS(WINDOWS) && !OS(SOLARIS) && !OS(QNX) \ |
725 | && !OS(SYMBIAN) && !OS(HAIKU) && !OS(RVCT) \ |
726 | && !OS(ANDROID) && !OS(AIX) && !OS(HPUX) |
727 | #define HAVE_TM_GMTOFF 1 |
728 | #define HAVE_TM_ZONE 1 |
729 | #define HAVE_TIMEGM 1 |
730 | #endif |
731 | |
732 | #if OS(DARWIN) |
733 | |
734 | #define HAVE_ERRNO_H 1 |
735 | #define HAVE_LANGINFO_H 1 |
736 | #define HAVE_MMAP 1 |
737 | #define HAVE_MERGESORT 1 |
738 | #define HAVE_SBRK 1 |
739 | #define HAVE_STRINGS_H 1 |
740 | #define HAVE_SYS_PARAM_H 1 |
741 | #define HAVE_SYS_TIME_H 1 |
742 | #define HAVE_SYS_TIMEB_H 1 |
743 | |
744 | #if !defined(TARGETING_TIGER) && !defined(TARGETING_LEOPARD) |
745 | |
746 | #define HAVE_DISPATCH_H 1 |
747 | |
748 | #if !PLATFORM(IPHONE) |
749 | #define HAVE_MADV_FREE_REUSE 1 |
750 | #define HAVE_MADV_FREE 1 |
751 | #define HAVE_PTHREAD_SETNAME_NP 1 |
752 | #endif |
753 | |
754 | #endif |
755 | |
756 | #if PLATFORM(IPHONE) |
757 | #define HAVE_MADV_FREE 1 |
758 | #endif |
759 | |
760 | #elif OS(WINDOWS) |
761 | |
762 | #if OS(WINCE) |
763 | #define HAVE_ERRNO_H 0 |
764 | #else |
765 | #define HAVE_SYS_TIMEB_H 1 |
766 | #endif |
767 | #define HAVE_VIRTUALALLOC 1 |
768 | |
769 | #elif OS(SYMBIAN) |
770 | |
771 | #define HAVE_ERRNO_H 1 |
772 | #define HAVE_MMAP 0 |
773 | #define HAVE_SBRK 1 |
774 | |
775 | #define HAVE_SYS_TIME_H 1 |
776 | #define HAVE_STRINGS_H 1 |
777 | |
778 | #if !COMPILER(RVCT) |
779 | #define HAVE_SYS_PARAM_H 1 |
780 | #endif |
781 | |
782 | #elif OS(QNX) |
783 | |
784 | #define HAVE_ERRNO_H 1 |
785 | #define HAVE_MMAP 1 |
786 | #define HAVE_SBRK 1 |
787 | #define HAVE_STRINGS_H 1 |
788 | #define HAVE_SYS_PARAM_H 1 |
789 | #define HAVE_SYS_TIME_H 1 |
790 | |
791 | #elif OS(ANDROID) |
792 | |
793 | #define HAVE_ERRNO_H 1 |
794 | #define HAVE_LANGINFO_H 0 |
795 | #define HAVE_MMAP 1 |
796 | #define HAVE_SBRK 1 |
797 | #define HAVE_STRINGS_H 1 |
798 | #define HAVE_SYS_PARAM_H 1 |
799 | #define HAVE_SYS_TIME_H 1 |
800 | |
801 | #else |
802 | |
803 | /* FIXME: is this actually used or do other platforms generate their own config.h? */ |
804 | |
805 | #define HAVE_ERRNO_H 1 |
806 | /* As long as Haiku doesn't have a complete support of locale this will be disabled. */ |
807 | #if !OS(HAIKU) |
808 | #define HAVE_LANGINFO_H 1 |
809 | #endif |
810 | #define HAVE_MMAP 1 |
811 | #define HAVE_SBRK 1 |
812 | #define HAVE_STRINGS_H 1 |
813 | #define HAVE_SYS_PARAM_H 1 |
814 | #define HAVE_SYS_TIME_H 1 |
815 | |
816 | #endif |
817 | |
818 | /* ENABLE macro defaults */ |
819 | |
820 | /* fastMalloc match validation allows for runtime verification that |
821 | new is matched by delete, fastMalloc is matched by fastFree, etc. */ |
822 | #if !defined(ENABLE_FAST_MALLOC_MATCH_VALIDATION) |
823 | #define ENABLE_FAST_MALLOC_MATCH_VALIDATION 0 |
824 | #endif |
825 | |
826 | #if !defined(ENABLE_ICONDATABASE) |
827 | #define ENABLE_ICONDATABASE 1 |
828 | #endif |
829 | |
830 | #if !defined(ENABLE_DATABASE) |
831 | #define ENABLE_DATABASE 1 |
832 | #endif |
833 | |
834 | #if !defined(ENABLE_JAVASCRIPT_DEBUGGER) |
835 | #define ENABLE_JAVASCRIPT_DEBUGGER 1 |
836 | #endif |
837 | |
838 | #if !defined(ENABLE_FTPDIR) |
839 | #define ENABLE_FTPDIR 1 |
840 | #endif |
841 | |
842 | #if !defined(ENABLE_CONTEXT_MENUS) |
843 | #define ENABLE_CONTEXT_MENUS 1 |
844 | #endif |
845 | |
846 | #if !defined(ENABLE_DRAG_SUPPORT) |
847 | #define ENABLE_DRAG_SUPPORT 1 |
848 | #endif |
849 | |
850 | #if !defined(ENABLE_DASHBOARD_SUPPORT) |
851 | #define ENABLE_DASHBOARD_SUPPORT 0 |
852 | #endif |
853 | |
854 | #if !defined(ENABLE_INSPECTOR) |
855 | #define ENABLE_INSPECTOR 1 |
856 | #endif |
857 | |
858 | #if !defined(ENABLE_MAC_JAVA_BRIDGE) |
859 | #define ENABLE_MAC_JAVA_BRIDGE 0 |
860 | #endif |
861 | |
862 | #if !defined(ENABLE_NETSCAPE_PLUGIN_API) |
863 | #define ENABLE_NETSCAPE_PLUGIN_API 1 |
864 | #endif |
865 | |
866 | #if !defined(WTF_USE_PLUGIN_HOST_PROCESS) |
867 | #define WTF_USE_PLUGIN_HOST_PROCESS 0 |
868 | #endif |
869 | |
870 | #if !defined(ENABLE_ORIENTATION_EVENTS) |
871 | #define ENABLE_ORIENTATION_EVENTS 0 |
872 | #endif |
873 | |
874 | #if !defined(ENABLE_OPCODE_STATS) |
875 | #define ENABLE_OPCODE_STATS 0 |
876 | #endif |
877 | |
878 | #define ENABLE_SAMPLING_COUNTERS 0 |
879 | #define ENABLE_SAMPLING_FLAGS 0 |
880 | #define ENABLE_OPCODE_SAMPLING 0 |
881 | #define ENABLE_CODEBLOCK_SAMPLING 0 |
882 | #if ENABLE(CODEBLOCK_SAMPLING) && !ENABLE(OPCODE_SAMPLING) |
883 | #error "CODEBLOCK_SAMPLING requires OPCODE_SAMPLING" |
884 | #endif |
885 | #if ENABLE(OPCODE_SAMPLING) || ENABLE(SAMPLING_FLAGS) |
886 | #define ENABLE_SAMPLING_THREAD 1 |
887 | #endif |
888 | |
889 | #if !defined(ENABLE_GEOLOCATION) |
890 | #define ENABLE_GEOLOCATION 0 |
891 | #endif |
892 | |
893 | #if !defined(ENABLE_NOTIFICATIONS) |
894 | #define ENABLE_NOTIFICATIONS 0 |
895 | #endif |
896 | |
897 | #if !defined(ENABLE_TEXT_CARET) |
898 | #define ENABLE_TEXT_CARET 1 |
899 | #endif |
900 | |
901 | #if !defined(ENABLE_ON_FIRST_TEXTAREA_FOCUS_SELECT_ALL) |
902 | #define ENABLE_ON_FIRST_TEXTAREA_FOCUS_SELECT_ALL 0 |
903 | #endif |
904 | |
905 | #if !defined(WTF_USE_JSVALUE64) && !defined(WTF_USE_JSVALUE32) && !defined(WTF_USE_JSVALUE32_64) |
906 | #if (CPU(X86_64) && (OS(UNIX) || OS(WINDOWS) || OS(SOLARIS) || OS(HPUX))) || (CPU(IA64) && !CPU(IA64_32)) || CPU(ALPHA) || CPU(AIX64) || CPU(SPARC64) || CPU(MIPS64) || CPU(AARCH64) |
907 | #define WTF_USE_JSVALUE64 1 |
908 | #elif CPU(ARM) || CPU(PPC64) |
909 | #define WTF_USE_JSVALUE32 1 |
910 | #elif OS(WINDOWS) && COMPILER(MINGW) |
911 | /* Using JSVALUE32_64 causes padding/alignement issues for JITStubArg |
912 | on MinGW. See https://bugs.webkit.org/show_bug.cgi?id=29268 */ |
913 | #define WTF_USE_JSVALUE32 1 |
914 | #else |
915 | #define WTF_USE_JSVALUE32_64 1 |
916 | #endif |
917 | #endif /* !defined(WTF_USE_JSVALUE64) && !defined(WTF_USE_JSVALUE32) && !defined(WTF_USE_JSVALUE32_64) */ |
918 | |
919 | #if !defined(ENABLE_REPAINT_THROTTLING) |
920 | #define ENABLE_REPAINT_THROTTLING 0 |
921 | #endif |
922 | |
923 | #if !defined(ENABLE_JIT) |
924 | |
925 | /* The JIT is tested & working on x86_64 Mac */ |
926 | #if CPU(X86_64) && PLATFORM(MAC) |
927 | #define ENABLE_JIT 1 |
928 | /* The JIT is tested & working on x86 Mac */ |
929 | #elif CPU(X86) && PLATFORM(MAC) |
930 | #define ENABLE_JIT 1 |
931 | #define WTF_USE_JIT_STUB_ARGUMENT_VA_LIST 1 |
932 | #elif CPU(ARM_THUMB2) && PLATFORM(IPHONE) |
933 | #define ENABLE_JIT 1 |
934 | /* The JIT is tested & working on x86 Windows */ |
935 | #elif CPU(X86) && PLATFORM(WIN) |
936 | #define ENABLE_JIT 1 |
937 | #endif |
938 | |
939 | #if PLATFORM(QT) |
940 | #if CPU(X86_64) && OS(DARWIN) |
941 | #define ENABLE_JIT 1 |
942 | #elif CPU(X86) && OS(DARWIN) |
943 | #define ENABLE_JIT 1 |
944 | #define WTF_USE_JIT_STUB_ARGUMENT_VA_LIST 1 |
945 | #elif CPU(X86) && OS(WINDOWS) && COMPILER(MINGW) && GCC_VERSION >= 40100 |
946 | #define ENABLE_JIT 1 |
947 | #define WTF_USE_JIT_STUB_ARGUMENT_VA_LIST 1 |
948 | #elif CPU(X86) && OS(WINDOWS) && COMPILER(MSVC) |
949 | #define ENABLE_JIT 1 |
950 | #define WTF_USE_JIT_STUB_ARGUMENT_REGISTER 1 |
951 | #elif CPU(X86) && OS(LINUX) && GCC_VERSION >= 40100 |
952 | #define ENABLE_JIT 1 |
953 | #define WTF_USE_JIT_STUB_ARGUMENT_VA_LIST 1 |
954 | #elif CPU(X86_64) && OS(LINUX) && GCC_VERSION >= 40100 |
955 | #define ENABLE_JIT 1 |
956 | #elif CPU(ARM_TRADITIONAL) && OS(LINUX) |
957 | #define ENABLE_JIT 1 |
958 | #endif |
959 | #endif /* PLATFORM(QT) */ |
960 | |
961 | #endif /* !defined(ENABLE_JIT) */ |
962 | |
963 | #if ENABLE(JIT) |
964 | #ifndef ENABLE_JIT_OPTIMIZE_CALL |
965 | #define ENABLE_JIT_OPTIMIZE_CALL 1 |
966 | #endif |
967 | #ifndef ENABLE_JIT_OPTIMIZE_NATIVE_CALL |
968 | #define ENABLE_JIT_OPTIMIZE_NATIVE_CALL 1 |
969 | #endif |
970 | #ifndef ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS |
971 | #define ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS 1 |
972 | #endif |
973 | #ifndef ENABLE_JIT_OPTIMIZE_METHOD_CALLS |
974 | #define ENABLE_JIT_OPTIMIZE_METHOD_CALLS 1 |
975 | #endif |
976 | #endif |
977 | |
978 | #if CPU(X86) && COMPILER(MSVC) |
979 | #define JSC_HOST_CALL __fastcall |
980 | #elif CPU(X86) && COMPILER(GCC) |
981 | #define JSC_HOST_CALL __attribute__ ((fastcall)) |
982 | #else |
983 | #define JSC_HOST_CALL |
984 | #endif |
985 | |
986 | #if COMPILER(GCC) && !ENABLE(JIT) |
987 | #define HAVE_COMPUTED_GOTO 1 |
988 | #endif |
989 | |
990 | #if ENABLE(JIT) && defined(COVERAGE) |
991 | #define WTF_USE_INTERPRETER 0 |
992 | #else |
993 | #define WTF_USE_INTERPRETER 1 |
994 | #endif |
995 | |
996 | /* Yet Another Regex Runtime. */ |
997 | #if !defined(ENABLE_YARR_JIT) |
998 | |
999 | /* YARR supports x86 & x86-64, and has been tested on Mac and Windows. */ |
1000 | #if (CPU(X86) && PLATFORM(MAC)) \ |
1001 | || (CPU(X86_64) && PLATFORM(MAC)) \ |
1002 | || (CPU(ARM_THUMB2) && PLATFORM(IPHONE)) \ |
1003 | || (CPU(X86) && PLATFORM(WIN)) |
1004 | #define ENABLE_YARR 1 |
1005 | #define ENABLE_YARR_JIT 1 |
1006 | #endif |
1007 | |
1008 | #if PLATFORM(QT) |
1009 | #if (CPU(X86) && OS(WINDOWS) && COMPILER(MINGW) && GCC_VERSION >= 40100) \ |
1010 | || (CPU(X86_64) && OS(WINDOWS) && COMPILER(MINGW64) && GCC_VERSION >= 40100) \ |
1011 | || (CPU(X86) && OS(WINDOWS) && COMPILER(MSVC)) \ |
1012 | || (CPU(X86) && OS(LINUX) && GCC_VERSION >= 40100) \ |
1013 | || (CPU(X86_64) && OS(LINUX) && GCC_VERSION >= 40100) \ |
1014 | || (CPU(ARM_TRADITIONAL) && OS(LINUX)) |
1015 | #define ENABLE_YARR 1 |
1016 | #define ENABLE_YARR_JIT 1 |
1017 | #endif |
1018 | #endif |
1019 | |
1020 | #endif /* !defined(ENABLE_YARR_JIT) */ |
1021 | |
1022 | /* Sanity Check */ |
1023 | #if ENABLE(YARR_JIT) && !ENABLE(YARR) |
1024 | #error "YARR_JIT requires YARR" |
1025 | #endif |
1026 | |
1027 | #if ENABLE(JIT) || ENABLE(YARR_JIT) |
1028 | #define ENABLE_ASSEMBLER 1 |
1029 | #endif |
1030 | /* Setting this flag prevents the assembler from using RWX memory; this may improve |
1031 | security but currectly comes at a significant performance cost. */ |
1032 | #if PLATFORM(IPHONE) |
1033 | #define ENABLE_ASSEMBLER_WX_EXCLUSIVE 1 |
1034 | #else |
1035 | #define ENABLE_ASSEMBLER_WX_EXCLUSIVE 0 |
1036 | #endif |
1037 | |
1038 | /* Pick which allocator to use; we only need an executable allocator if the assembler is compiled in. |
1039 | On x86-64 we use a single fixed mmap, on other platforms we mmap on demand. */ |
1040 | #if ENABLE(ASSEMBLER) |
1041 | #if CPU(X86_64) && !COMPILER(MINGW64) |
1042 | #define ENABLE_EXECUTABLE_ALLOCATOR_FIXED 1 |
1043 | #else |
1044 | #define ENABLE_EXECUTABLE_ALLOCATOR_DEMAND 1 |
1045 | #endif |
1046 | #endif |
1047 | |
1048 | #if !defined(ENABLE_PAN_SCROLLING) && OS(WINDOWS) |
1049 | #define ENABLE_PAN_SCROLLING 1 |
1050 | #endif |
1051 | |
1052 | /* Use the QXmlStreamReader implementation for XMLTokenizer */ |
1053 | /* Use the QXmlQuery implementation for XSLTProcessor */ |
1054 | #if PLATFORM(QT) |
1055 | #define WTF_USE_QXMLSTREAM 1 |
1056 | #define WTF_USE_QXMLQUERY 1 |
1057 | #endif |
1058 | |
1059 | #if !PLATFORM(QT) |
1060 | #define WTF_USE_FONT_FAST_PATH 1 |
1061 | #endif |
1062 | |
1063 | /* Accelerated compositing */ |
1064 | #if PLATFORM(MAC) |
1065 | #if !defined(BUILDING_ON_TIGER) |
1066 | #define WTF_USE_ACCELERATED_COMPOSITING 1 |
1067 | #endif |
1068 | #endif |
1069 | |
1070 | #if PLATFORM(IPHONE) |
1071 | #define WTF_USE_ACCELERATED_COMPOSITING 1 |
1072 | #endif |
1073 | |
1074 | /* FIXME: Defining ENABLE_3D_RENDERING here isn't really right, but it's always used with |
1075 | with WTF_USE_ACCELERATED_COMPOSITING, and it allows the feature to be turned on and |
1076 | off in one place. */ |
1077 | #if PLATFORM(WIN) |
1078 | #include "QuartzCorePresent.h" |
1079 | #if QUARTZCORE_PRESENT |
1080 | #define WTF_USE_ACCELERATED_COMPOSITING 1 |
1081 | #define ENABLE_3D_RENDERING 1 |
1082 | #endif |
1083 | #endif |
1084 | |
1085 | #if COMPILER(GCC) |
1086 | #define WARN_UNUSED_RETURN __attribute__ ((warn_unused_result)) |
1087 | #else |
1088 | #define WARN_UNUSED_RETURN |
1089 | #endif |
1090 | |
1091 | #if !ENABLE(NETSCAPE_PLUGIN_API) || (ENABLE(NETSCAPE_PLUGIN_API) && ((OS(UNIX) && (PLATFORM(QT) || PLATFORM(WX))) || PLATFORM(GTK))) |
1092 | #define ENABLE_PLUGIN_PACKAGE_SIMPLE_HASH 1 |
1093 | #endif |
1094 | |
1095 | /* Set up a define for a common error that is intended to cause a build error -- thus the space after Error. */ |
1096 | #define WTF_PLATFORM_CFNETWORK Error USE_macro_should_be_used_with_CFNETWORK |
1097 | |
1098 | #define ENABLE_JSC_ZOMBIES 0 |
1099 | |
1100 | #endif /* WTF_Platform_h */ |
1101 | |