]> git.saurik.com Git - apple/javascriptcore.git/blob - wtf/Platform.h
961e80fe8b4321be293e91f61a8601eafd04f832
[apple/javascriptcore.git] / wtf / Platform.h
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_OR_LOWER) Microsoft Visual C++ 2003 or lower*/
62 /* COMPILER(MSVC9_OR_LOWER) Microsoft Visual C++ 2008 or lower*/
63 #if defined(_MSC_VER)
64 #define WTF_COMPILER_MSVC 1
65 #if _MSC_VER < 1400
66 #define WTF_COMPILER_MSVC7_OR_LOWER 1
67 #elif _MSC_VER < 1600
68 #define WTF_COMPILER_MSVC9_OR_LOWER 1
69 #endif
70 #endif
71
72 /* COMPILER(RVCT) - ARM RealView Compilation Tools */
73 #if defined(__CC_ARM) || defined(__ARMCC__)
74 #define WTF_COMPILER_RVCT 1
75 #endif
76
77 /* COMPILER(GCC) - GNU Compiler Collection */
78 /* --gnu option of the RVCT compiler also defines __GNUC__ */
79 #if defined(__GNUC__) && !COMPILER(RVCT)
80 #define WTF_COMPILER_GCC 1
81 #define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
82 #endif
83
84 /* COMPILER(MINGW) - MinGW GCC */
85 /* COMPILER(MINGW64) - mingw-w64 GCC - only used as additional check to exclude mingw.org specific functions */
86 #if defined(__MINGW32__)
87 #define WTF_COMPILER_MINGW 1
88 #include <_mingw.h> /* private MinGW header */
89 #if defined(__MINGW64_VERSION_MAJOR) /* best way to check for mingw-w64 vs mingw.org */
90 #define WTF_COMPILER_MINGW64 1
91 #endif /* __MINGW64_VERSION_MAJOR */
92 #endif /* __MINGW32__ */
93
94 /* COMPILER(WINSCW) - CodeWarrior for Symbian emulator */
95 #if defined(__WINSCW__)
96 #define WTF_COMPILER_WINSCW 1
97 /* cross-compiling, it is not really windows */
98 #undef WIN32
99 #undef _WIN32
100 #endif
101
102
103
104 /* ==== CPU() - the target CPU architecture ==== */
105
106 /* This also defines CPU(BIG_ENDIAN) or CPU(MIDDLE_ENDIAN) or neither, as appropriate. */
107
108 /* CPU(ALPHA) - DEC Alpha */
109 #if defined(__alpha__)
110 #define WTF_CPU_ALPHA 1
111 #endif
112
113 /* CPU(IA64) - Itanium / IA-64 */
114 #if defined(__ia64__)
115 #define WTF_CPU_IA64 1
116 /* 32-bit mode on Itanium */
117 #if !defined(__LP64__)
118 #define WTF_CPU_IA64_32 1
119 #endif
120 #endif
121
122 /* CPU(MIPS) - MIPS 32-bit */
123 /* Note: Only O32 ABI is tested, so we enable it for O32 ABI for now. */
124 #if (defined(mips) || defined(__mips__)) \
125 && defined(_ABIO32)
126 #define WTF_CPU_MIPS 1
127 #if defined(__MIPSEB__)
128 #define WTF_CPU_BIG_ENDIAN 1
129 #endif
130 #define WTF_MIPS_PIC (defined __PIC__)
131 #define WTF_MIPS_ARCH __mips
132 #define WTF_MIPS_ISA(v) (defined WTF_MIPS_ARCH && WTF_MIPS_ARCH == v)
133 #define WTF_MIPS_ISA_AT_LEAST(v) (defined WTF_MIPS_ARCH && WTF_MIPS_ARCH >= v)
134 #define WTF_MIPS_ARCH_REV __mips_isa_rev
135 #define WTF_MIPS_ISA_REV(v) (defined WTF_MIPS_ARCH_REV && WTF_MIPS_ARCH_REV == v)
136 #define WTF_MIPS_DOUBLE_FLOAT (defined __mips_hard_float && !defined __mips_single_float)
137 #endif /* MIPS */
138
139 /* CPU(PPC) - PowerPC 32-bit */
140 #if defined(__ppc__) \
141 || defined(__PPC__) \
142 || defined(__powerpc__) \
143 || defined(__powerpc) \
144 || defined(__POWERPC__) \
145 || defined(_M_PPC) \
146 || defined(__PPC)
147 #define WTF_CPU_PPC 1
148 #define WTF_CPU_BIG_ENDIAN 1
149 #endif
150
151 /* CPU(PPC64) - PowerPC 64-bit */
152 #if defined(__ppc64__) \
153 || defined(__PPC64__)
154 #define WTF_CPU_PPC64 1
155 #define WTF_CPU_BIG_ENDIAN 1
156 #endif
157
158 /* CPU(SH4) - SuperH SH-4 */
159 #if defined(__SH4__)
160 #define WTF_CPU_SH4 1
161 #endif
162
163 /* CPU(SPARC32) - SPARC 32-bit */
164 #if defined(__sparc) && !defined(__arch64__) || defined(__sparcv8)
165 #define WTF_CPU_SPARC32 1
166 #define WTF_CPU_BIG_ENDIAN 1
167 #endif
168
169 /* CPU(SPARC64) - SPARC 64-bit */
170 #if defined(__sparc__) && defined(__arch64__) || defined (__sparcv9)
171 #define WTF_CPU_SPARC64 1
172 #define WTF_CPU_BIG_ENDIAN 1
173 #endif
174
175 /* CPU(SPARC) - any SPARC, true for CPU(SPARC32) and CPU(SPARC64) */
176 #if CPU(SPARC32) || CPU(SPARC64)
177 #define WTF_CPU_SPARC 1
178 #endif
179
180 /* CPU(X86) - i386 / x86 32-bit */
181 #if defined(__i386__) \
182 || defined(i386) \
183 || defined(_M_IX86) \
184 || defined(_X86_) \
185 || defined(__THW_INTEL)
186 #define WTF_CPU_X86 1
187 #endif
188
189 /* CPU(X86_64) - AMD64 / Intel64 / x86_64 64-bit */
190 #if defined(__x86_64__) \
191 || defined(_M_X64)
192 #define WTF_CPU_X86_64 1
193 #endif
194
195 /* CPU(ARM) - ARM, any version*/
196 #if defined(arm) \
197 || defined(__arm__) \
198 || defined(ARM) \
199 || defined(_ARM_)
200 #define WTF_CPU_ARM 1
201
202 #if defined(__ARMEB__)
203 #define WTF_CPU_BIG_ENDIAN 1
204
205 #elif !defined(__ARM_EABI__) \
206 && !defined(__EABI__) \
207 && !defined(__VFP_FP__) \
208 && !defined(_WIN32_WCE) \
209 && !defined(ANDROID)
210 #define WTF_CPU_MIDDLE_ENDIAN 1
211
212 #endif
213
214 #define WTF_ARM_ARCH_AT_LEAST(N) (CPU(ARM) && WTF_ARM_ARCH_VERSION >= N)
215
216 /* Set WTF_ARM_ARCH_VERSION */
217 #if defined(__ARM_ARCH_4__) \
218 || defined(__ARM_ARCH_4T__) \
219 || defined(__MARM_ARMV4__) \
220 || defined(_ARMV4I_)
221 #define WTF_ARM_ARCH_VERSION 4
222
223 #elif defined(__ARM_ARCH_5__) \
224 || defined(__ARM_ARCH_5T__) \
225 || defined(__ARM_ARCH_5E__) \
226 || defined(__ARM_ARCH_5TE__) \
227 || defined(__ARM_ARCH_5TEJ__) \
228 || defined(__MARM_ARMV5__)
229 #define WTF_ARM_ARCH_VERSION 5
230
231 #elif defined(__ARM_ARCH_6__) \
232 || defined(__ARM_ARCH_6J__) \
233 || defined(__ARM_ARCH_6K__) \
234 || defined(__ARM_ARCH_6Z__) \
235 || defined(__ARM_ARCH_6ZK__) \
236 || defined(__ARM_ARCH_6T2__) \
237 || defined(__ARMV6__)
238 #define WTF_ARM_ARCH_VERSION 6
239
240 #elif defined(__ARM_ARCH_7A__) \
241 || defined(__ARM_ARCH_7R__)
242 #define WTF_ARM_ARCH_VERSION 7
243
244 /* RVCT sets _TARGET_ARCH_ARM */
245 #elif defined(__TARGET_ARCH_ARM)
246 #define WTF_ARM_ARCH_VERSION __TARGET_ARCH_ARM
247
248 #else
249 #define WTF_ARM_ARCH_VERSION 0
250
251 #endif
252
253 /* Set WTF_THUMB_ARCH_VERSION */
254 #if defined(__ARM_ARCH_4T__)
255 #define WTF_THUMB_ARCH_VERSION 1
256
257 #elif defined(__ARM_ARCH_5T__) \
258 || defined(__ARM_ARCH_5TE__) \
259 || defined(__ARM_ARCH_5TEJ__)
260 #define WTF_THUMB_ARCH_VERSION 2
261
262 #elif defined(__ARM_ARCH_6J__) \
263 || defined(__ARM_ARCH_6K__) \
264 || defined(__ARM_ARCH_6Z__) \
265 || defined(__ARM_ARCH_6ZK__) \
266 || defined(__ARM_ARCH_6M__)
267 #define WTF_THUMB_ARCH_VERSION 3
268
269 #elif defined(__ARM_ARCH_6T2__) \
270 || defined(__ARM_ARCH_7__) \
271 || defined(__ARM_ARCH_7A__) \
272 || defined(__ARM_ARCH_7R__) \
273 || defined(__ARM_ARCH_7M__)
274 #define WTF_THUMB_ARCH_VERSION 4
275
276 /* RVCT sets __TARGET_ARCH_THUMB */
277 #elif defined(__TARGET_ARCH_THUMB)
278 #define WTF_THUMB_ARCH_VERSION __TARGET_ARCH_THUMB
279
280 #else
281 #define WTF_THUMB_ARCH_VERSION 0
282 #endif
283
284
285 /* CPU(ARMV5_OR_LOWER) - ARM instruction set v5 or earlier */
286 /* On ARMv5 and below the natural alignment is required.
287 And there are some other differences for v5 or earlier. */
288 #if !defined(ARMV5_OR_LOWER) && !WTF_ARM_ARCH_AT_LEAST(6)
289 #define WTF_CPU_ARMV5_OR_LOWER 1
290 #endif
291
292
293 /* CPU(ARM_TRADITIONAL) - Thumb2 is not available, only traditional ARM (v4 or greater) */
294 /* CPU(ARM_THUMB2) - Thumb2 instruction set is available */
295 /* Only one of these will be defined. */
296 #if !defined(WTF_CPU_ARM_TRADITIONAL) && !defined(WTF_CPU_ARM_THUMB2)
297 # if defined(thumb2) || defined(__thumb2__) \
298 || ((defined(__thumb) || defined(__thumb__)) && WTF_THUMB_ARCH_VERSION == 4)
299 # define WTF_CPU_ARM_TRADITIONAL 0
300 # define WTF_CPU_ARM_THUMB2 1
301 # elif WTF_ARM_ARCH_AT_LEAST(4)
302 # define WTF_CPU_ARM_TRADITIONAL 1
303 # define WTF_CPU_ARM_THUMB2 0
304 # else
305 # error "Not supported ARM architecture"
306 # endif
307 #elif CPU(ARM_TRADITIONAL) && CPU(ARM_THUMB2) /* Sanity Check */
308 # error "Cannot use both of WTF_CPU_ARM_TRADITIONAL and WTF_CPU_ARM_THUMB2 platforms"
309 #endif /* !defined(WTF_CPU_ARM_TRADITIONAL) && !defined(WTF_CPU_ARM_THUMB2) */
310
311 #endif /* ARM */
312
313
314
315 /* ==== OS() - underlying operating system; only to be used for mandated low-level services like
316 virtual memory, not to choose a GUI toolkit ==== */
317
318 /* OS(ANDROID) - Android */
319 #ifdef ANDROID
320 #define WTF_OS_ANDROID 1
321 #endif
322
323 /* OS(AIX) - AIX */
324 #ifdef _AIX
325 #define WTF_OS_AIX 1
326 #endif
327
328 /* OS(DARWIN) - Any Darwin-based OS, including Mac OS X and iPhone OS */
329 #ifdef __APPLE__
330 #define WTF_OS_DARWIN 1
331
332 /* FIXME: BUILDING_ON_.., and TARGETING... macros should be folded into the OS() system */
333 #include <AvailabilityMacros.h>
334 #if !defined(MAC_OS_X_VERSION_10_5) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5
335 #define BUILDING_ON_TIGER 1
336 #elif !defined(MAC_OS_X_VERSION_10_6) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6
337 #define BUILDING_ON_LEOPARD 1
338 #elif !defined(MAC_OS_X_VERSION_10_7) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
339 #define BUILDING_ON_SNOW_LEOPARD 1
340 #endif
341 #if !defined(MAC_OS_X_VERSION_10_5) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5
342 #define TARGETING_TIGER 1
343 #elif !defined(MAC_OS_X_VERSION_10_6) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6
344 #define TARGETING_LEOPARD 1
345 #elif !defined(MAC_OS_X_VERSION_10_7) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_7
346 #define TARGETING_SNOW_LEOPARD 1
347 #endif
348 #include <Availability.h>
349 #include <TargetConditionals.h>
350
351 #endif
352
353 /* OS(IPHONE_OS) - iPhone OS */
354 /* OS(MAC_OS_X) - Mac OS X (not including iPhone OS) */
355 #if OS(DARWIN) && ((defined(TARGET_OS_EMBEDDED) && TARGET_OS_EMBEDDED) \
356 || (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE) \
357 || (defined(TARGET_IPHONE_SIMULATOR) && TARGET_IPHONE_SIMULATOR))
358 #define WTF_OS_IPHONE_OS 1
359 #elif OS(DARWIN) && defined(TARGET_OS_MAC) && TARGET_OS_MAC
360 #define WTF_OS_MAC_OS_X 1
361 #endif
362
363 /* OS(FREEBSD) - FreeBSD */
364 #ifdef __FreeBSD__
365 #define WTF_OS_FREEBSD 1
366 #endif
367
368 /* OS(HAIKU) - Haiku */
369 #ifdef __HAIKU__
370 #define WTF_OS_HAIKU 1
371 #endif
372
373 /* OS(LINUX) - Linux */
374 #ifdef __linux__
375 #define WTF_OS_LINUX 1
376 #endif
377
378 /* OS(NETBSD) - NetBSD */
379 #if defined(__NetBSD__)
380 #define WTF_PLATFORM_NETBSD 1
381 #endif
382
383 /* OS(OPENBSD) - OpenBSD */
384 #ifdef __OpenBSD__
385 #define WTF_OS_OPENBSD 1
386 #endif
387
388 /* OS(QNX) - QNX */
389 #if defined(__QNXNTO__)
390 #define WTF_OS_QNX 1
391 #endif
392
393 /* OS(SOLARIS) - Solaris */
394 #if defined(sun) || defined(__sun)
395 #define WTF_OS_SOLARIS 1
396 #endif
397
398 /* OS(WINCE) - Windows CE; note that for this platform OS(WINDOWS) is also defined */
399 #if defined(_WIN32_WCE)
400 #define WTF_OS_WINCE 1
401 #endif
402
403 /* OS(WINDOWS) - Any version of Windows */
404 #if defined(WIN32) || defined(_WIN32)
405 #define WTF_OS_WINDOWS 1
406 #endif
407
408 /* OS(SYMBIAN) - Symbian */
409 #if defined (__SYMBIAN32__)
410 #define WTF_OS_SYMBIAN 1
411 #endif
412
413 /* OS(UNIX) - Any Unix-like system */
414 #if OS(AIX) \
415 || OS(ANDROID) \
416 || OS(DARWIN) \
417 || OS(FREEBSD) \
418 || OS(HAIKU) \
419 || OS(LINUX) \
420 || OS(NETBSD) \
421 || OS(OPENBSD) \
422 || OS(QNX) \
423 || OS(SOLARIS) \
424 || OS(SYMBIAN) \
425 || defined(unix) \
426 || defined(__unix) \
427 || defined(__unix__)
428 #define WTF_OS_UNIX 1
429 #endif
430
431 /* Operating environments */
432
433 /* FIXME: these are all mixes of OS, operating environment and policy choices. */
434 /* PLATFORM(CHROMIUM) */
435 /* PLATFORM(QT) */
436 /* PLATFORM(WX) */
437 /* PLATFORM(GTK) */
438 /* PLATFORM(HAIKU) */
439 /* PLATFORM(MAC) */
440 /* PLATFORM(WIN) */
441 #if defined(BUILDING_CHROMIUM__)
442 #define WTF_PLATFORM_CHROMIUM 1
443 #elif defined(BUILDING_QT__)
444 #define WTF_PLATFORM_QT 1
445 #elif defined(BUILDING_WX__)
446 #define WTF_PLATFORM_WX 1
447 #elif defined(BUILDING_GTK__)
448 #define WTF_PLATFORM_GTK 1
449 #elif defined(BUILDING_HAIKU__)
450 #define WTF_PLATFORM_HAIKU 1
451 #elif defined(BUILDING_BREWMP__)
452 #define WTF_PLATFORM_BREWMP 1
453 #if defined(AEE_SIMULATOR)
454 #define WTF_PLATFORM_BREWMP_SIMULATOR 1
455 #else
456 #define WTF_PLATFORM_BREWMP_SIMULATOR 0
457 #endif
458 #undef WTF_OS_WINDOWS
459 #undef WTF_PLATFORM_WIN
460 #elif OS(DARWIN)
461 #define WTF_PLATFORM_MAC 1
462 #elif OS(WINDOWS)
463 #define WTF_PLATFORM_WIN 1
464 #endif
465
466 /* PLATFORM(IPHONE) */
467 /* FIXME: this is sometimes used as an OS switch and sometimes for higher-level things */
468 #if (defined(TARGET_OS_EMBEDDED) && TARGET_OS_EMBEDDED) || (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE)
469 #define WTF_PLATFORM_IPHONE 1
470 #endif
471
472 /* PLATFORM(IPHONE_SIMULATOR) */
473 #if defined(TARGET_IPHONE_SIMULATOR) && TARGET_IPHONE_SIMULATOR
474 #define WTF_PLATFORM_IPHONE 1
475 #define WTF_PLATFORM_IPHONE_SIMULATOR 1
476 #else
477 #define WTF_PLATFORM_IPHONE_SIMULATOR 0
478 #endif
479
480 #if !defined(WTF_PLATFORM_IPHONE)
481 #define WTF_PLATFORM_IPHONE 0
482 #endif
483
484 /* PLATFORM(ANDROID) */
485 /* FIXME: this is sometimes used as an OS() switch, and other times to drive
486 policy choices */
487 #if defined(ANDROID)
488 #define WTF_PLATFORM_ANDROID 1
489 #endif
490
491 /* Graphics engines */
492
493 /* PLATFORM(CG) and PLATFORM(CI) */
494 #define WTF_PLATFORM_CG 1
495
496 /* PLATFORM(SKIA) for Win/Linux, CG/CI for Mac */
497 #if PLATFORM(CHROMIUM)
498 #define ENABLE_HISTORY_ALWAYS_ASYNC 1
499 #if OS(DARWIN)
500 #define WTF_PLATFORM_CG 1
501 #define WTF_PLATFORM_CI 1
502 #define WTF_USE_ATSUI 1
503 #define WTF_USE_CORE_TEXT 1
504 #else
505 #define WTF_PLATFORM_SKIA 1
506 #endif
507 #endif
508
509 #if PLATFORM(GTK)
510 #define WTF_PLATFORM_CAIRO 1
511 #endif
512
513
514 /* OS(WINCE) && PLATFORM(QT)
515 We can not determine the endianess at compile time. For
516 Qt for Windows CE the endianess is specified in the
517 device specific makespec
518 */
519 #if OS(WINCE) && PLATFORM(QT)
520 # include <QtGlobal>
521 # undef WTF_CPU_BIG_ENDIAN
522 # undef WTF_CPU_MIDDLE_ENDIAN
523 # if Q_BYTE_ORDER == Q_BIG_ENDIAN
524 # define WTF_CPU_BIG_ENDIAN 1
525 # endif
526
527 # include <ce_time.h>
528 #endif
529
530 #if (PLATFORM(IPHONE) || PLATFORM(MAC) || PLATFORM(WIN) || (PLATFORM(QT) && OS(DARWIN) && !ENABLE(SINGLE_THREADED))) && !defined(ENABLE_JSC_MULTIPLE_THREADS)
531 #define ENABLE_JSC_MULTIPLE_THREADS 1
532 #endif
533
534 /* On Windows, use QueryPerformanceCounter by default */
535 #if OS(WINDOWS)
536 #define WTF_USE_QUERY_PERFORMANCE_COUNTER 1
537 #endif
538
539 #if OS(WINCE) && !PLATFORM(QT)
540 #undef ENABLE_JSC_MULTIPLE_THREADS
541 #define ENABLE_JSC_MULTIPLE_THREADS 0
542 #define USE_SYSTEM_MALLOC 0
543 #define ENABLE_ICONDATABASE 0
544 #define ENABLE_JAVASCRIPT_DEBUGGER 0
545 #define ENABLE_FTPDIR 0
546 #define ENABLE_PAN_SCROLLING 0
547 #define ENABLE_WML 1
548 #define HAVE_ACCESSIBILITY 0
549
550 #define NOMINMAX /* Windows min and max conflict with standard macros */
551 #define NOSHLWAPI /* shlwapi.h not available on WinCe */
552
553 /* MSDN documentation says these functions are provided with uspce.lib. But we cannot find this file. */
554 #define __usp10__ /* disable "usp10.h" */
555
556 #define _INC_ASSERT /* disable "assert.h" */
557 #define assert(x)
558
559 /* _countof is only included in CE6; for CE5 we need to define it ourself */
560 #ifndef _countof
561 #define _countof(x) (sizeof(x) / sizeof((x)[0]))
562 #endif
563
564 #endif /* OS(WINCE) && !PLATFORM(QT) */
565
566 #if PLATFORM(QT)
567 #define WTF_USE_QT4_UNICODE 1
568 #if !defined(ENABLE_WIDGETS_10_SUPPORT)
569 #define ENABLE_WIDGETS_10_SUPPORT 1
570 #endif
571 #elif OS(WINCE)
572 #define WTF_USE_WINCE_UNICODE 1
573 #elif PLATFORM(GTK)
574 /* The GTK+ Unicode backend is configurable */
575 #else
576 #define WTF_USE_ICU_UNICODE 1
577 #endif
578
579
580
581 #if PLATFORM(CHROMIUM) && OS(DARWIN)
582 #define WTF_PLATFORM_CF 1
583 #define WTF_USE_PTHREADS 1
584 #define HAVE_PTHREAD_RWLOCK 1
585 #define WTF_USE_CARBON_SECURE_INPUT_MODE 1
586 #endif
587
588 #define DONT_FINALIZE_ON_MAIN_THREAD 1
589
590 #if PLATFORM(QT) && OS(DARWIN)
591 #define WTF_PLATFORM_CF 1
592 #endif
593
594 #if OS(DARWIN) && !defined(BUILDING_ON_TIGER) && !PLATFORM(GTK) && !PLATFORM(QT)
595 #define ENABLE_PURGEABLE_MEMORY 1
596 #endif
597
598 #define ENABLE_CONTEXT_MENUS 0
599 #define ENABLE_DISK_IMAGE_CACHE 1
600 #define ENABLE_DRAG_SUPPORT 0
601 #define ENABLE_FTPDIR 1
602 #define ENABLE_GEOLOCATION 1
603 #define ENABLE_GEOLOCATION_PERMISSION_CACHE 1
604 #define ENABLE_ICONDATABASE 0
605 #define ENABLE_JAVA_BRIDGE 0
606 #define ENABLE_NETSCAPE_PLUGIN_API 0
607 #define ENABLE_ORIENTATION_EVENTS 1
608 #define ENABLE_RANGETYPE_AS_TEXT 1
609 #define ENABLE_REPAINT_THROTTLING 1
610 #define ENABLE_RESPECT_EXIF_ORIENTATION 1
611 #define HAVE_PTHREAD_RWLOCK 1
612 #define HAVE_READLINE 1
613 #define HAVE_RUNLOOP_TIMER 0
614 #define WTF_PLATFORM_CF 1
615 #define WTF_USE_PTHREADS 1
616 #define WTF_USE_WEB_THREAD 1
617
618 #undef ENABLE_PURGEABLE_MEMORY
619
620 #if defined(WTF_ARM_ARCH_VERSION) && WTF_ARM_ARCH_VERSION == 6
621 #define ENABLE_INSPECTOR 0
622 #define ENABLE_PURGEABLE_MEMORY 0
623 #else
624 #define ENABLE_INSPECTOR 1
625 #define ENABLE_PURGEABLE_MEMORY 1
626 #endif
627
628 #define WTF_USE_PTHREAD_GETSPECIFIC_DIRECT 1
629
630 #if defined(WTF_ARM_ARCH_VERSION) && WTF_ARM_ARCH_VERSION >= 7
631 // ARMv7;
632 #define WTF_USE_JSVALUE32_64 1
633 #define ENABLE_INTERPRETER 1
634 #define ENABLE_JIT 1
635 #define ENABLE_YARR 1
636 #define ENABLE_YARR_JIT 1
637 #else
638 // ARMv6; never use the JIT, use JSVALUE32_64 only if compiling with llvm.
639 #define ENABLE_JIT 0
640 #define ENABLE_YARR 0
641 #define ENABLE_YARR_JIT 0
642 /* FIXME: <rdar://problem/7478149> gcc-4.2 compiler bug with USE(JSVALUE32_64) and armv6 target */
643 #ifdef __llvm__
644 #define WTF_USE_JSVALUE32_64 1
645 #else
646 #define WTF_USE_JSVALUE32 1
647 #endif
648 #endif
649
650 #undef ENABLE_3D_CANVAS
651 #if defined(WTF_ARM_ARCH_VERSION) && WTF_ARM_ARCH_VERSION == 6
652 #define ENABLE_3D_CANVAS 0
653 #else
654 #define ENABLE_3D_CANVAS 1
655 #endif
656
657
658 #if PLATFORM(ANDROID)
659 #define WTF_USE_PTHREADS 1
660 #define WTF_PLATFORM_SGL 1
661 #define USE_SYSTEM_MALLOC 1
662 #define ENABLE_JAVA_BRIDGE 1
663 #define LOG_DISABLED 1
664 /* Prevents Webkit from drawing the caret in textfields and textareas
665 This prevents unnecessary invals. */
666 #define ENABLE_TEXT_CARET 1
667 #define ENABLE_JAVASCRIPT_DEBUGGER 0
668 #endif
669
670 #if PLATFORM(WIN)
671 #define WTF_USE_WININET 1
672 #endif
673
674 #if PLATFORM(WX)
675 #define ENABLE_ASSEMBLER 1
676 #define ENABLE_GLOBAL_FASTMALLOC_NEW 0
677 #if OS(DARWIN)
678 #define WTF_PLATFORM_CF 1
679 #ifndef BUILDING_ON_TIGER
680 #define WTF_USE_CORE_TEXT 1
681 #else
682 #define WTF_USE_ATSUI 1
683 #endif
684 #endif
685 #endif
686
687 #if PLATFORM(GTK)
688 #if HAVE(PTHREAD_H)
689 #define WTF_USE_PTHREADS 1
690 #define HAVE_PTHREAD_RWLOCK 1
691 #endif
692 #endif
693
694 #if PLATFORM(HAIKU)
695 #define HAVE_POSIX_MEMALIGN 1
696 #define WTF_USE_CURL 1
697 #define WTF_USE_PTHREADS 1
698 #define HAVE_PTHREAD_RWLOCK 1
699 #define USE_SYSTEM_MALLOC 1
700 #define ENABLE_NETSCAPE_PLUGIN_API 0
701 #endif
702
703 #if PLATFORM(BREWMP)
704 #define USE_SYSTEM_MALLOC 1
705 #endif
706
707 #if !defined(HAVE_ACCESSIBILITY)
708 #define HAVE_ACCESSIBILITY 1
709 #endif /* !defined(HAVE_ACCESSIBILITY) */
710
711 #if OS(UNIX) && !OS(SYMBIAN)
712 #define HAVE_SIGNAL_H 1
713 #endif
714
715 #if !OS(WINDOWS) && !OS(SOLARIS) && !OS(QNX) \
716 && !OS(SYMBIAN) && !OS(HAIKU) && !OS(RVCT) \
717 && !OS(ANDROID) && !PLATFORM(BREWMP)
718 #define HAVE_TM_GMTOFF 1
719 #define HAVE_TM_ZONE 1
720 #define HAVE_TIMEGM 1
721 #endif
722
723 #if OS(DARWIN)
724
725 #define HAVE_ERRNO_H 1
726 #define HAVE_LANGINFO_H 1
727 #define HAVE_MMAP 1
728 #define HAVE_MERGESORT 1
729 #define HAVE_SBRK 1
730 #define HAVE_STRINGS_H 1
731 #define HAVE_SYS_PARAM_H 1
732 #define HAVE_SYS_TIME_H 1
733 #define HAVE_SYS_TIMEB_H 1
734
735 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
736
737 #define HAVE_DISPATCH_H 1
738
739
740 #endif
741
742 #define HAVE_MADV_FREE 1
743 #define HAVE_PTHREAD_SETNAME_NP 1
744
745 #elif OS(WINDOWS)
746
747 #if OS(WINCE)
748 #define HAVE_ERRNO_H 0
749 #else
750 #define HAVE_SYS_TIMEB_H 1
751 #endif
752 #define HAVE_VIRTUALALLOC 1
753
754 #elif OS(SYMBIAN)
755
756 #define HAVE_ERRNO_H 1
757 #define HAVE_MMAP 0
758 #define HAVE_SBRK 1
759
760 #define HAVE_SYS_TIME_H 1
761 #define HAVE_STRINGS_H 1
762
763 #if !COMPILER(RVCT)
764 #define HAVE_SYS_PARAM_H 1
765 #endif
766
767 #elif PLATFORM(BREWMP)
768
769 #define HAVE_ERRNO_H 1
770
771 #elif OS(QNX)
772
773 #define HAVE_ERRNO_H 1
774 #define HAVE_MMAP 1
775 #define HAVE_SBRK 1
776 #define HAVE_STRINGS_H 1
777 #define HAVE_SYS_PARAM_H 1
778 #define HAVE_SYS_TIME_H 1
779
780 #elif OS(ANDROID)
781
782 #define HAVE_ERRNO_H 1
783 #define HAVE_LANGINFO_H 0
784 #define HAVE_MMAP 1
785 #define HAVE_SBRK 1
786 #define HAVE_STRINGS_H 1
787 #define HAVE_SYS_PARAM_H 1
788 #define HAVE_SYS_TIME_H 1
789
790 #else
791
792 /* FIXME: is this actually used or do other platforms generate their own config.h? */
793
794 #define HAVE_ERRNO_H 1
795 /* As long as Haiku doesn't have a complete support of locale this will be disabled. */
796 #if !OS(HAIKU)
797 #define HAVE_LANGINFO_H 1
798 #endif
799 #define HAVE_MMAP 1
800 #define HAVE_SBRK 1
801 #define HAVE_STRINGS_H 1
802 #define HAVE_SYS_PARAM_H 1
803 #define HAVE_SYS_TIME_H 1
804
805 #endif
806
807 /* ENABLE macro defaults */
808
809 #if PLATFORM(QT)
810 // We musn't customize the global operator new and delete for the Qt port.
811 #define ENABLE_GLOBAL_FASTMALLOC_NEW 0
812 #endif
813
814 /* fastMalloc match validation allows for runtime verification that
815 new is matched by delete, fastMalloc is matched by fastFree, etc. */
816 #if !defined(ENABLE_FAST_MALLOC_MATCH_VALIDATION)
817 #define ENABLE_FAST_MALLOC_MATCH_VALIDATION 0
818 #endif
819
820 #if !defined(ENABLE_ICONDATABASE)
821 #define ENABLE_ICONDATABASE 1
822 #endif
823
824 #if !defined(ENABLE_DATABASE)
825 #define ENABLE_DATABASE 1
826 #endif
827
828 #if !defined(ENABLE_JAVASCRIPT_DEBUGGER)
829 #define ENABLE_JAVASCRIPT_DEBUGGER 1
830 #endif
831
832 #if !defined(ENABLE_FTPDIR)
833 #define ENABLE_FTPDIR 1
834 #endif
835
836 #if !defined(ENABLE_CONTEXT_MENUS)
837 #define ENABLE_CONTEXT_MENUS 1
838 #endif
839
840 #if !defined(ENABLE_DISK_IMAGE_CACHE)
841 #define ENABLE_DISK_IMAGE_CACHE 0
842 #endif
843
844 #if !defined(ENABLE_DRAG_SUPPORT)
845 #define ENABLE_DRAG_SUPPORT 1
846 #endif
847
848 #if !defined(ENABLE_DASHBOARD_SUPPORT)
849 #define ENABLE_DASHBOARD_SUPPORT 0
850 #endif
851
852 #if !defined(ENABLE_WIDGETS_10_SUPPORT)
853 #define ENABLE_WIDGETS_10_SUPPORT 0
854 #endif
855
856 #if !defined(ENABLE_GEOLOCATION_PERMISSION_CACHE)
857 #define ENABLE_GEOLOCATION_PERMISSION_CACHE 0
858 #endif
859
860 #if !defined(ENABLE_INSPECTOR)
861 #define ENABLE_INSPECTOR 1
862 #endif
863
864 #if !defined(ENABLE_JAVA_BRIDGE)
865 #define ENABLE_JAVA_BRIDGE 0
866 #endif
867
868 #if !defined(ENABLE_NETSCAPE_PLUGIN_API)
869 #define ENABLE_NETSCAPE_PLUGIN_API 1
870 #endif
871
872 #if !defined(ENABLE_PURGEABLE_MEMORY)
873 #define ENABLE_PURGEABLE_MEMORY 0
874 #endif
875
876 #if !defined(WTF_USE_PLUGIN_HOST_PROCESS)
877 #define WTF_USE_PLUGIN_HOST_PROCESS 0
878 #endif
879
880 #if !defined(ENABLE_ORIENTATION_EVENTS)
881 #define ENABLE_ORIENTATION_EVENTS 0
882 #endif
883
884 #if !defined(ENABLE_RESPECT_EXIF_ORIENTATION)
885 #define ENABLE_RESPECT_EXIF_ORIENTATION 0
886 #endif
887
888 #if !defined(WTF_USE_PTHREAD_GETSPECIFIC_DIRECT)
889 #define WTF_USE_PTHREAD_GETSPECIFIC_DIRECT 0
890 #endif
891
892 #if !defined(ENABLE_OPCODE_STATS)
893 #define ENABLE_OPCODE_STATS 0
894 #endif
895
896 #if !defined(ENABLE_GLOBAL_FASTMALLOC_NEW)
897 #define ENABLE_GLOBAL_FASTMALLOC_NEW 1
898 #endif
899
900 #define ENABLE_DEBUG_WITH_BREAKPOINT 0
901 #define ENABLE_SAMPLING_COUNTERS 0
902 #define ENABLE_SAMPLING_FLAGS 0
903 #define ENABLE_OPCODE_SAMPLING 0
904 #define ENABLE_CODEBLOCK_SAMPLING 0
905 #if ENABLE(CODEBLOCK_SAMPLING) && !ENABLE(OPCODE_SAMPLING)
906 #error "CODEBLOCK_SAMPLING requires OPCODE_SAMPLING"
907 #endif
908 #if ENABLE(OPCODE_SAMPLING) || ENABLE(SAMPLING_FLAGS)
909 #define ENABLE_SAMPLING_THREAD 1
910 #endif
911
912 #if !defined(ENABLE_GEOLOCATION)
913 #define ENABLE_GEOLOCATION 0
914 #endif
915
916 #if !defined(ENABLE_NOTIFICATIONS)
917 #define ENABLE_NOTIFICATIONS 0
918 #endif
919
920 #define ENABLE_TEXT_CARET 0
921
922 #if !defined(ENABLE_TEXT_CARET)
923 #define ENABLE_TEXT_CARET 1
924 #endif
925
926 #if !defined(ENABLE_ON_FIRST_TEXTAREA_FOCUS_SELECT_ALL)
927 #define ENABLE_ON_FIRST_TEXTAREA_FOCUS_SELECT_ALL 0
928 #endif
929
930 #if !defined(ENABLE_CONTENTEDITABLE)
931 #define ENABLE_CONTENTEDITABLE 0
932 #endif
933
934 #if !defined(WTF_USE_JSVALUE64) && !defined(WTF_USE_JSVALUE32) && !defined(WTF_USE_JSVALUE32_64)
935 #if (CPU(X86_64) && (OS(UNIX) || OS(WINDOWS))) \
936 || (CPU(IA64) && !CPU(IA64_32)) \
937 || CPU(ALPHA) \
938 || CPU(SPARC64)
939 #define WTF_USE_JSVALUE64 1
940 #elif CPU(ARM_TRADITIONAL) && !PLATFORM(IPHONE) || CPU(PPC64) || CPU(MIPS) || (PLATFORM(IPHONE) && defined(WTF_ARM_ARCH_VERSION) && WTF_ARM_ARCH_VERSION == 6 && !defined(__llvm__))
941 /* FIXME: <rdar://problem/7478149> gcc-4.2 compiler bug with USE(JSVALUE32_64) and armv6 target */
942 #define WTF_USE_JSVALUE32 1
943 #elif OS(WINDOWS) && COMPILER(MINGW)
944 /* Using JSVALUE32_64 causes padding/alignement issues for JITStubArg
945 on MinGW. See https://bugs.webkit.org/show_bug.cgi?id=29268 */
946 #define WTF_USE_JSVALUE32 1
947 #else
948 #define WTF_USE_JSVALUE32_64 1
949 #endif
950 #endif /* !defined(WTF_USE_JSVALUE64) && !defined(WTF_USE_JSVALUE32) && !defined(WTF_USE_JSVALUE32_64) */
951
952 #if !defined(ENABLE_REPAINT_THROTTLING)
953 #define ENABLE_REPAINT_THROTTLING 0
954 #endif
955
956 #if !defined(ENABLE_JIT)
957
958 /* The JIT is tested & working on x86_64 Mac */
959 #if CPU(X86_64) && PLATFORM(MAC)
960 #define ENABLE_JIT 1
961 /* The JIT is tested & working on x86 Mac */
962 #elif CPU(X86) && PLATFORM(MAC)
963 #define ENABLE_JIT 1
964 #define WTF_USE_JIT_STUB_ARGUMENT_VA_LIST 1
965 #elif CPU(ARM_THUMB2) && PLATFORM(IPHONE)
966 #define ENABLE_JIT 1
967 /* The JIT is tested & working on Android */
968 #elif CPU(ARM_THUMB2) && PLATFORM(ANDROID) && ENABLE(ANDROID_JSC_JIT)
969 #define ENABLE_JIT 1
970 /* The JIT is tested & working on x86 Windows */
971 #elif CPU(X86) && PLATFORM(WIN)
972 #define ENABLE_JIT 1
973 #endif
974
975 #if PLATFORM(QT) || PLATFORM(WX)
976 #if CPU(X86_64) && OS(DARWIN)
977 #define ENABLE_JIT 1
978 #elif CPU(X86) && OS(DARWIN)
979 #define ENABLE_JIT 1
980 #define WTF_USE_JIT_STUB_ARGUMENT_VA_LIST 1
981 #elif CPU(X86) && OS(WINDOWS) && COMPILER(MINGW) && GCC_VERSION >= 40100
982 #define ENABLE_JIT 1
983 #define WTF_USE_JIT_STUB_ARGUMENT_VA_LIST 1
984 #elif CPU(X86_64) && OS(WINDOWS) && COMPILER(MINGW64) && GCC_VERSION >= 40100
985 #define ENABLE_JIT 1
986 #elif CPU(X86) && OS(WINDOWS) && COMPILER(MSVC)
987 #define ENABLE_JIT 1
988 #define WTF_USE_JIT_STUB_ARGUMENT_REGISTER 1
989 #elif CPU(X86) && OS(LINUX) && GCC_VERSION >= 40100
990 #define ENABLE_JIT 1
991 #define WTF_USE_JIT_STUB_ARGUMENT_VA_LIST 1
992 #elif CPU(X86_64) && OS(LINUX) && GCC_VERSION >= 40100
993 #define ENABLE_JIT 1
994 #elif CPU(ARM_TRADITIONAL) && OS(LINUX)
995 #define ENABLE_JIT 1
996 #elif CPU(ARM_TRADITIONAL) && OS(SYMBIAN) && COMPILER(RVCT)
997 #define ENABLE_JIT 1
998 #elif CPU(MIPS) && OS(LINUX)
999 #define ENABLE_JIT 1
1000 #define WTF_USE_JIT_STUB_ARGUMENT_VA_LIST 0
1001 #endif
1002 #endif /* PLATFORM(QT) */
1003
1004 #endif /* !defined(ENABLE_JIT) */
1005
1006 #if 1 || !ENABLE(JIT)
1007 #define ENABLE_INTERPRETER 1
1008 #endif
1009
1010 #if !(ENABLE(JIT) || ENABLE(INTERPRETER))
1011 #error You have to have at least one execution model enabled to build JSC
1012 #endif
1013
1014 /* CPU architecture specific optimizations */
1015 #if CPU(ARM_TRADITIONAL)
1016 #if ENABLE(JIT) && !defined(ENABLE_JIT_OPTIMIZE_MOD) && WTF_ARM_ARCH_AT_LEAST(5)
1017 #define ENABLE_JIT_OPTIMIZE_MOD 1
1018 #endif
1019 #endif
1020
1021 #if ENABLE(JIT)
1022 #ifndef ENABLE_JIT_OPTIMIZE_CALL
1023 #define ENABLE_JIT_OPTIMIZE_CALL 1
1024 #endif
1025 #ifndef ENABLE_JIT_OPTIMIZE_NATIVE_CALL
1026 #define ENABLE_JIT_OPTIMIZE_NATIVE_CALL 0
1027 #endif
1028 #ifndef ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS
1029 #define ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS 1
1030 #endif
1031 #ifndef ENABLE_JIT_OPTIMIZE_METHOD_CALLS
1032 #define ENABLE_JIT_OPTIMIZE_METHOD_CALLS 1
1033 #endif
1034 #ifndef ENABLE_JIT_OPTIMIZE_MOD
1035 #define ENABLE_JIT_OPTIMIZE_MOD 0
1036 #endif
1037 #endif
1038
1039 #if CPU(X86) && COMPILER(MSVC)
1040 #define JSC_HOST_CALL __fastcall
1041 #elif CPU(X86) && COMPILER(GCC)
1042 #define JSC_HOST_CALL __attribute__ ((fastcall))
1043 #else
1044 #define JSC_HOST_CALL
1045 #endif
1046
1047 #if COMPILER(GCC)
1048 #define HAVE_COMPUTED_GOTO 1
1049 #endif
1050
1051 #if HAVE(COMPUTED_GOTO) && ENABLE(INTERPRETER)
1052 #define ENABLE_COMPUTED_GOTO_INTERPRETER 1
1053 #endif
1054
1055 /* Yet Another Regex Runtime. */
1056 #if !defined(ENABLE_YARR_JIT)
1057
1058 /* YARR supports x86 & x86-64, and has been tested on Mac and Windows. */
1059 #if (CPU(X86) && PLATFORM(MAC)) \
1060 || (CPU(X86_64) && PLATFORM(MAC)) \
1061 || (CPU(ARM_THUMB2) && PLATFORM(IPHONE)) \
1062 || (CPU(ARM_THUMB2) && PLATFORM(ANDROID) && ENABLE(ANDROID_JSC_JIT)) \
1063 || (CPU(X86) && PLATFORM(WIN)) \
1064 || (CPU(X86) && PLATFORM(WX))
1065 #define ENABLE_YARR 1
1066 #define ENABLE_YARR_JIT 1
1067 #endif
1068
1069 #if PLATFORM(QT)
1070 #if (CPU(X86) && OS(WINDOWS) && COMPILER(MINGW) && GCC_VERSION >= 40100) \
1071 || (CPU(X86_64) && OS(WINDOWS) && COMPILER(MINGW64) && GCC_VERSION >= 40100) \
1072 || (CPU(X86) && OS(WINDOWS) && COMPILER(MSVC)) \
1073 || (CPU(X86) && OS(LINUX) && GCC_VERSION >= 40100) \
1074 || (CPU(X86_64) && OS(LINUX) && GCC_VERSION >= 40100) \
1075 || (CPU(ARM_TRADITIONAL) && OS(LINUX)) \
1076 || (CPU(ARM_TRADITIONAL) && OS(SYMBIAN) && COMPILER(RVCT)) \
1077 || (CPU(MIPS) && OS(LINUX))
1078 #define ENABLE_YARR 1
1079 #define ENABLE_YARR_JIT 1
1080 #endif
1081 #endif
1082
1083 #endif /* !defined(ENABLE_YARR_JIT) */
1084
1085 /* Sanity Check */
1086 #if ENABLE(YARR_JIT) && !ENABLE(YARR)
1087 #error "YARR_JIT requires YARR"
1088 #endif
1089
1090 #if ENABLE(JIT) || ENABLE(YARR_JIT)
1091 #define ENABLE_ASSEMBLER 1
1092 #endif
1093
1094 /* Pick which allocator to use; we only need an executable allocator if the assembler is compiled in.
1095 On x86-64 we use a single fixed mmap, on other platforms we mmap on demand. */
1096 #if ENABLE(ASSEMBLER)
1097 #define ENABLE_EXECUTABLE_ALLOCATOR_FIXED 1
1098 #endif
1099
1100 #if !defined(ENABLE_PAN_SCROLLING) && OS(WINDOWS)
1101 #define ENABLE_PAN_SCROLLING 1
1102 #endif
1103
1104 /* Use the QXmlStreamReader implementation for XMLTokenizer */
1105 /* Use the QXmlQuery implementation for XSLTProcessor */
1106 #if PLATFORM(QT)
1107 #define WTF_USE_QXMLSTREAM 1
1108 #define WTF_USE_QXMLQUERY 1
1109 #endif
1110
1111 #if !PLATFORM(QT)
1112 #define WTF_USE_FONT_FAST_PATH 1
1113 #endif
1114
1115 #if PLATFORM(MAC)
1116 /* Complex text framework */
1117 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
1118 #define WTF_USE_ATSUI 0
1119 #define WTF_USE_CORE_TEXT 1
1120 #else
1121 #define WTF_USE_ATSUI 1
1122 #define WTF_USE_CORE_TEXT 0
1123 #endif
1124
1125 /* Accelerated compositing */
1126 #if !defined(BUILDING_ON_TIGER)
1127 #define WTF_USE_ACCELERATED_COMPOSITING 1
1128 #endif
1129 #endif
1130
1131 #define WTF_USE_ACCELERATED_COMPOSITING 1
1132
1133 /* FIXME: Defining ENABLE_3D_RENDERING here isn't really right, but it's always used with
1134 with WTF_USE_ACCELERATED_COMPOSITING, and it allows the feature to be turned on and
1135 off in one place. */
1136 #if PLATFORM(WIN)
1137 #include "QuartzCorePresent.h"
1138 #if QUARTZCORE_PRESENT
1139 #define WTF_USE_ACCELERATED_COMPOSITING 1
1140 #define ENABLE_3D_RENDERING 1
1141 #endif
1142 #endif
1143
1144 #if (PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)) || PLATFORM(IPHONE)
1145 #define WTF_USE_PROTECTION_SPACE_AUTH_CALLBACK 1
1146 #endif
1147
1148 #if COMPILER(GCC)
1149 #define WARN_UNUSED_RETURN __attribute__ ((warn_unused_result))
1150 #else
1151 #define WARN_UNUSED_RETURN
1152 #endif
1153
1154 #if !ENABLE(NETSCAPE_PLUGIN_API) || (ENABLE(NETSCAPE_PLUGIN_API) && ((OS(UNIX) && (PLATFORM(QT) || PLATFORM(WX))) || PLATFORM(GTK)))
1155 #define ENABLE_PLUGIN_PACKAGE_SIMPLE_HASH 1
1156 #endif
1157
1158 /* Set up a define for a common error that is intended to cause a build error -- thus the space after Error. */
1159 #define WTF_PLATFORM_CFNETWORK Error USE_macro_should_be_used_with_CFNETWORK
1160
1161 #define ENABLE_JSC_ZOMBIES 0
1162
1163 #if CPU(ARM_THUMB2)
1164 #define ENABLE_BRANCH_COMPACTION 1
1165 #endif
1166
1167 #endif /* WTF_Platform_h */