]> git.saurik.com Git - apple/javascriptcore.git/blob - wtf/Platform.h
621f0f2fe1d829d3e79f8e6388e76bd24c5b0831
[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_DRAG_SUPPORT 0
600 #define ENABLE_FTPDIR 1
601 #define ENABLE_GEOLOCATION 1
602 #define ENABLE_GEOLOCATION_PERMISSION_CACHE 1
603 #define ENABLE_ICONDATABASE 0
604 #define ENABLE_JAVA_BRIDGE 0
605 #define ENABLE_NETSCAPE_PLUGIN_API 0
606 #define ENABLE_ORIENTATION_EVENTS 1
607 #define ENABLE_RANGETYPE_AS_TEXT 1
608 #define ENABLE_REPAINT_THROTTLING 1
609 #define ENABLE_RESPECT_EXIF_ORIENTATION 1
610 #define HAVE_PTHREAD_RWLOCK 1
611 #define HAVE_READLINE 1
612 #define HAVE_RUNLOOP_TIMER 0
613 #define WTF_PLATFORM_CF 1
614 #define WTF_USE_PTHREADS 1
615 #define WTF_USE_WEB_THREAD 1
616
617 #undef ENABLE_PURGEABLE_MEMORY
618
619 #if defined(WTF_ARM_ARCH_VERSION) && WTF_ARM_ARCH_VERSION == 6
620 #define ENABLE_INSPECTOR 0
621 #define ENABLE_PURGEABLE_MEMORY 0
622 #else
623 #define ENABLE_INSPECTOR 1
624 #define ENABLE_PURGEABLE_MEMORY 1
625 #endif
626
627 #define WTF_USE_PTHREAD_GETSPECIFIC_DIRECT 1
628
629 #define ENABLE_JIT 0
630 #define ENABLE_YARR 0
631 #define ENABLE_YARR_JIT 0
632 #ifdef __llvm__
633 #define WTF_USE_JSVALUE32_64 1
634 #else
635 #define WTF_USE_JSVALUE32 1
636 #endif
637
638 #undef ENABLE_3D_CANVAS
639 #if defined(WTF_ARM_ARCH_VERSION) && WTF_ARM_ARCH_VERSION == 6
640 #define ENABLE_3D_CANVAS 0
641 #else
642 #define ENABLE_3D_CANVAS 1
643 #endif
644
645
646 #if PLATFORM(ANDROID)
647 #define WTF_USE_PTHREADS 1
648 #define WTF_PLATFORM_SGL 1
649 #define USE_SYSTEM_MALLOC 1
650 #define ENABLE_JAVA_BRIDGE 1
651 #define LOG_DISABLED 1
652 /* Prevents Webkit from drawing the caret in textfields and textareas
653 This prevents unnecessary invals. */
654 #define ENABLE_TEXT_CARET 1
655 #define ENABLE_JAVASCRIPT_DEBUGGER 0
656 #endif
657
658 #if PLATFORM(WIN)
659 #define WTF_USE_WININET 1
660 #endif
661
662 #if PLATFORM(WX)
663 #define ENABLE_ASSEMBLER 1
664 #define ENABLE_GLOBAL_FASTMALLOC_NEW 0
665 #if OS(DARWIN)
666 #define WTF_PLATFORM_CF 1
667 #ifndef BUILDING_ON_TIGER
668 #define WTF_USE_CORE_TEXT 1
669 #else
670 #define WTF_USE_ATSUI 1
671 #endif
672 #endif
673 #endif
674
675 #if PLATFORM(GTK)
676 #if HAVE(PTHREAD_H)
677 #define WTF_USE_PTHREADS 1
678 #define HAVE_PTHREAD_RWLOCK 1
679 #endif
680 #endif
681
682 #if PLATFORM(HAIKU)
683 #define HAVE_POSIX_MEMALIGN 1
684 #define WTF_USE_CURL 1
685 #define WTF_USE_PTHREADS 1
686 #define HAVE_PTHREAD_RWLOCK 1
687 #define USE_SYSTEM_MALLOC 1
688 #define ENABLE_NETSCAPE_PLUGIN_API 0
689 #endif
690
691 #if PLATFORM(BREWMP)
692 #define USE_SYSTEM_MALLOC 1
693 #endif
694
695 #if !defined(HAVE_ACCESSIBILITY)
696 #define HAVE_ACCESSIBILITY 1
697 #endif /* !defined(HAVE_ACCESSIBILITY) */
698
699 #if OS(UNIX) && !OS(SYMBIAN)
700 #define HAVE_SIGNAL_H 1
701 #endif
702
703 #if !OS(WINDOWS) && !OS(SOLARIS) && !OS(QNX) \
704 && !OS(SYMBIAN) && !OS(HAIKU) && !OS(RVCT) \
705 && !OS(ANDROID) && !PLATFORM(BREWMP)
706 #define HAVE_TM_GMTOFF 1
707 #define HAVE_TM_ZONE 1
708 #define HAVE_TIMEGM 1
709 #endif
710
711 #if OS(DARWIN)
712
713 #define HAVE_ERRNO_H 1
714 #define HAVE_LANGINFO_H 1
715 #define HAVE_MMAP 1
716 #define HAVE_MERGESORT 1
717 #define HAVE_SBRK 1
718 #define HAVE_STRINGS_H 1
719 #define HAVE_SYS_PARAM_H 1
720 #define HAVE_SYS_TIME_H 1
721 #define HAVE_SYS_TIMEB_H 1
722
723 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
724
725 #define HAVE_DISPATCH_H 1
726
727
728 #endif
729
730 #define HAVE_MADV_FREE 1
731 #define HAVE_PTHREAD_SETNAME_NP 1
732
733 #elif OS(WINDOWS)
734
735 #if OS(WINCE)
736 #define HAVE_ERRNO_H 0
737 #else
738 #define HAVE_SYS_TIMEB_H 1
739 #endif
740 #define HAVE_VIRTUALALLOC 1
741
742 #elif OS(SYMBIAN)
743
744 #define HAVE_ERRNO_H 1
745 #define HAVE_MMAP 0
746 #define HAVE_SBRK 1
747
748 #define HAVE_SYS_TIME_H 1
749 #define HAVE_STRINGS_H 1
750
751 #if !COMPILER(RVCT)
752 #define HAVE_SYS_PARAM_H 1
753 #endif
754
755 #elif PLATFORM(BREWMP)
756
757 #define HAVE_ERRNO_H 1
758
759 #elif OS(QNX)
760
761 #define HAVE_ERRNO_H 1
762 #define HAVE_MMAP 1
763 #define HAVE_SBRK 1
764 #define HAVE_STRINGS_H 1
765 #define HAVE_SYS_PARAM_H 1
766 #define HAVE_SYS_TIME_H 1
767
768 #elif OS(ANDROID)
769
770 #define HAVE_ERRNO_H 1
771 #define HAVE_LANGINFO_H 0
772 #define HAVE_MMAP 1
773 #define HAVE_SBRK 1
774 #define HAVE_STRINGS_H 1
775 #define HAVE_SYS_PARAM_H 1
776 #define HAVE_SYS_TIME_H 1
777
778 #else
779
780 /* FIXME: is this actually used or do other platforms generate their own config.h? */
781
782 #define HAVE_ERRNO_H 1
783 /* As long as Haiku doesn't have a complete support of locale this will be disabled. */
784 #if !OS(HAIKU)
785 #define HAVE_LANGINFO_H 1
786 #endif
787 #define HAVE_MMAP 1
788 #define HAVE_SBRK 1
789 #define HAVE_STRINGS_H 1
790 #define HAVE_SYS_PARAM_H 1
791 #define HAVE_SYS_TIME_H 1
792
793 #endif
794
795 /* ENABLE macro defaults */
796
797 #if PLATFORM(QT)
798 // We musn't customize the global operator new and delete for the Qt port.
799 #define ENABLE_GLOBAL_FASTMALLOC_NEW 0
800 #endif
801
802 /* fastMalloc match validation allows for runtime verification that
803 new is matched by delete, fastMalloc is matched by fastFree, etc. */
804 #if !defined(ENABLE_FAST_MALLOC_MATCH_VALIDATION)
805 #define ENABLE_FAST_MALLOC_MATCH_VALIDATION 0
806 #endif
807
808 #if !defined(ENABLE_ICONDATABASE)
809 #define ENABLE_ICONDATABASE 1
810 #endif
811
812 #if !defined(ENABLE_DATABASE)
813 #define ENABLE_DATABASE 1
814 #endif
815
816 #if !defined(ENABLE_JAVASCRIPT_DEBUGGER)
817 #define ENABLE_JAVASCRIPT_DEBUGGER 1
818 #endif
819
820 #if !defined(ENABLE_FTPDIR)
821 #define ENABLE_FTPDIR 1
822 #endif
823
824 #if !defined(ENABLE_CONTEXT_MENUS)
825 #define ENABLE_CONTEXT_MENUS 1
826 #endif
827
828 #if !defined(ENABLE_DRAG_SUPPORT)
829 #define ENABLE_DRAG_SUPPORT 1
830 #endif
831
832 #if !defined(ENABLE_DASHBOARD_SUPPORT)
833 #define ENABLE_DASHBOARD_SUPPORT 0
834 #endif
835
836 #if !defined(ENABLE_WIDGETS_10_SUPPORT)
837 #define ENABLE_WIDGETS_10_SUPPORT 0
838 #endif
839
840 #if !defined(ENABLE_GEOLOCATION_PERMISSION_CACHE)
841 #define ENABLE_GEOLOCATION_PERMISSION_CACHE 0
842 #endif
843
844 #if !defined(ENABLE_INSPECTOR)
845 #define ENABLE_INSPECTOR 1
846 #endif
847
848 #if !defined(ENABLE_JAVA_BRIDGE)
849 #define ENABLE_JAVA_BRIDGE 0
850 #endif
851
852 #if !defined(ENABLE_NETSCAPE_PLUGIN_API)
853 #define ENABLE_NETSCAPE_PLUGIN_API 1
854 #endif
855
856 #if !defined(ENABLE_PURGEABLE_MEMORY)
857 #define ENABLE_PURGEABLE_MEMORY 0
858 #endif
859
860 #if !defined(WTF_USE_PLUGIN_HOST_PROCESS)
861 #define WTF_USE_PLUGIN_HOST_PROCESS 0
862 #endif
863
864 #if !defined(ENABLE_ORIENTATION_EVENTS)
865 #define ENABLE_ORIENTATION_EVENTS 0
866 #endif
867
868 #if !defined(ENABLE_RESPECT_EXIF_ORIENTATION)
869 #define ENABLE_RESPECT_EXIF_ORIENTATION 0
870 #endif
871
872 #if !defined(WTF_USE_PTHREAD_GETSPECIFIC_DIRECT)
873 #define WTF_USE_PTHREAD_GETSPECIFIC_DIRECT 0
874 #endif
875
876 #if !defined(ENABLE_OPCODE_STATS)
877 #define ENABLE_OPCODE_STATS 0
878 #endif
879
880 #if !defined(ENABLE_GLOBAL_FASTMALLOC_NEW)
881 #define ENABLE_GLOBAL_FASTMALLOC_NEW 1
882 #endif
883
884 #define ENABLE_DEBUG_WITH_BREAKPOINT 0
885 #define ENABLE_SAMPLING_COUNTERS 0
886 #define ENABLE_SAMPLING_FLAGS 0
887 #define ENABLE_OPCODE_SAMPLING 0
888 #define ENABLE_CODEBLOCK_SAMPLING 0
889 #if ENABLE(CODEBLOCK_SAMPLING) && !ENABLE(OPCODE_SAMPLING)
890 #error "CODEBLOCK_SAMPLING requires OPCODE_SAMPLING"
891 #endif
892 #if ENABLE(OPCODE_SAMPLING) || ENABLE(SAMPLING_FLAGS)
893 #define ENABLE_SAMPLING_THREAD 1
894 #endif
895
896 #if !defined(ENABLE_GEOLOCATION)
897 #define ENABLE_GEOLOCATION 0
898 #endif
899
900 #if !defined(ENABLE_NOTIFICATIONS)
901 #define ENABLE_NOTIFICATIONS 0
902 #endif
903
904 #define ENABLE_TEXT_CARET 0
905
906 #if !defined(ENABLE_TEXT_CARET)
907 #define ENABLE_TEXT_CARET 1
908 #endif
909
910 #if !defined(ENABLE_ON_FIRST_TEXTAREA_FOCUS_SELECT_ALL)
911 #define ENABLE_ON_FIRST_TEXTAREA_FOCUS_SELECT_ALL 0
912 #endif
913
914 #if !defined(ENABLE_CONTENTEDITABLE)
915 #define ENABLE_CONTENTEDITABLE 0
916 #endif
917
918 #if !defined(WTF_USE_JSVALUE64) && !defined(WTF_USE_JSVALUE32) && !defined(WTF_USE_JSVALUE32_64)
919 #if (CPU(X86_64) && (OS(UNIX) || OS(WINDOWS))) \
920 || (CPU(IA64) && !CPU(IA64_32)) \
921 || CPU(ALPHA) \
922 || CPU(SPARC64)
923 #define WTF_USE_JSVALUE64 1
924 #elif CPU(ARM_TRADITIONAL) && !PLATFORM(IPHONE) || CPU(PPC64) || CPU(MIPS) || (PLATFORM(IPHONE) && defined(WTF_ARM_ARCH_VERSION) && WTF_ARM_ARCH_VERSION == 6 && !defined(__llvm__))
925 /* FIXME: <rdar://problem/7478149> gcc-4.2 compiler bug with USE(JSVALUE32_64) and armv6 target */
926 #define WTF_USE_JSVALUE32 1
927 #elif OS(WINDOWS) && COMPILER(MINGW)
928 /* Using JSVALUE32_64 causes padding/alignement issues for JITStubArg
929 on MinGW. See https://bugs.webkit.org/show_bug.cgi?id=29268 */
930 #define WTF_USE_JSVALUE32 1
931 #else
932 #define WTF_USE_JSVALUE32_64 1
933 #endif
934 #endif /* !defined(WTF_USE_JSVALUE64) && !defined(WTF_USE_JSVALUE32) && !defined(WTF_USE_JSVALUE32_64) */
935
936 #if !defined(ENABLE_REPAINT_THROTTLING)
937 #define ENABLE_REPAINT_THROTTLING 0
938 #endif
939
940 #if !defined(ENABLE_JIT)
941
942 /* The JIT is tested & working on x86_64 Mac */
943 #if CPU(X86_64) && PLATFORM(MAC)
944 #define ENABLE_JIT 1
945 /* The JIT is tested & working on x86 Mac */
946 #elif CPU(X86) && PLATFORM(MAC)
947 #define ENABLE_JIT 1
948 #define WTF_USE_JIT_STUB_ARGUMENT_VA_LIST 1
949 #elif CPU(ARM_THUMB2) && PLATFORM(IPHONE)
950 #define ENABLE_JIT 1
951 /* The JIT is tested & working on Android */
952 #elif CPU(ARM_THUMB2) && PLATFORM(ANDROID) && ENABLE(ANDROID_JSC_JIT)
953 #define ENABLE_JIT 1
954 /* The JIT is tested & working on x86 Windows */
955 #elif CPU(X86) && PLATFORM(WIN)
956 #define ENABLE_JIT 1
957 #endif
958
959 #if PLATFORM(QT) || PLATFORM(WX)
960 #if CPU(X86_64) && OS(DARWIN)
961 #define ENABLE_JIT 1
962 #elif CPU(X86) && OS(DARWIN)
963 #define ENABLE_JIT 1
964 #define WTF_USE_JIT_STUB_ARGUMENT_VA_LIST 1
965 #elif CPU(X86) && OS(WINDOWS) && COMPILER(MINGW) && GCC_VERSION >= 40100
966 #define ENABLE_JIT 1
967 #define WTF_USE_JIT_STUB_ARGUMENT_VA_LIST 1
968 #elif CPU(X86_64) && OS(WINDOWS) && COMPILER(MINGW64) && GCC_VERSION >= 40100
969 #define ENABLE_JIT 1
970 #elif CPU(X86) && OS(WINDOWS) && COMPILER(MSVC)
971 #define ENABLE_JIT 1
972 #define WTF_USE_JIT_STUB_ARGUMENT_REGISTER 1
973 #elif CPU(X86) && OS(LINUX) && GCC_VERSION >= 40100
974 #define ENABLE_JIT 1
975 #define WTF_USE_JIT_STUB_ARGUMENT_VA_LIST 1
976 #elif CPU(X86_64) && OS(LINUX) && GCC_VERSION >= 40100
977 #define ENABLE_JIT 1
978 #elif CPU(ARM_TRADITIONAL) && OS(LINUX)
979 #define ENABLE_JIT 1
980 #elif CPU(ARM_TRADITIONAL) && OS(SYMBIAN) && COMPILER(RVCT)
981 #define ENABLE_JIT 1
982 #elif CPU(MIPS) && OS(LINUX)
983 #define ENABLE_JIT 1
984 #define WTF_USE_JIT_STUB_ARGUMENT_VA_LIST 0
985 #endif
986 #endif /* PLATFORM(QT) */
987
988 #endif /* !defined(ENABLE_JIT) */
989
990 #if 1 || !ENABLE(JIT)
991 #define ENABLE_INTERPRETER 1
992 #endif
993
994 #if !(ENABLE(JIT) || ENABLE(INTERPRETER))
995 #error You have to have at least one execution model enabled to build JSC
996 #endif
997
998 /* CPU architecture specific optimizations */
999 #if CPU(ARM_TRADITIONAL)
1000 #if ENABLE(JIT) && !defined(ENABLE_JIT_OPTIMIZE_MOD) && WTF_ARM_ARCH_AT_LEAST(5)
1001 #define ENABLE_JIT_OPTIMIZE_MOD 1
1002 #endif
1003 #endif
1004
1005 #if ENABLE(JIT)
1006 #ifndef ENABLE_JIT_OPTIMIZE_CALL
1007 #define ENABLE_JIT_OPTIMIZE_CALL 1
1008 #endif
1009 #ifndef ENABLE_JIT_OPTIMIZE_NATIVE_CALL
1010 #define ENABLE_JIT_OPTIMIZE_NATIVE_CALL 0
1011 #endif
1012 #ifndef ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS
1013 #define ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS 1
1014 #endif
1015 #ifndef ENABLE_JIT_OPTIMIZE_METHOD_CALLS
1016 #define ENABLE_JIT_OPTIMIZE_METHOD_CALLS 1
1017 #endif
1018 #ifndef ENABLE_JIT_OPTIMIZE_MOD
1019 #define ENABLE_JIT_OPTIMIZE_MOD 0
1020 #endif
1021 #endif
1022
1023 #if CPU(X86) && COMPILER(MSVC)
1024 #define JSC_HOST_CALL __fastcall
1025 #elif CPU(X86) && COMPILER(GCC)
1026 #define JSC_HOST_CALL __attribute__ ((fastcall))
1027 #else
1028 #define JSC_HOST_CALL
1029 #endif
1030
1031 #if COMPILER(GCC)
1032 #define HAVE_COMPUTED_GOTO 1
1033 #endif
1034
1035 #if HAVE(COMPUTED_GOTO) && ENABLE(INTERPRETER)
1036 #define ENABLE_COMPUTED_GOTO_INTERPRETER 1
1037 #endif
1038
1039 /* Yet Another Regex Runtime. */
1040 #if !defined(ENABLE_YARR_JIT)
1041
1042 /* YARR supports x86 & x86-64, and has been tested on Mac and Windows. */
1043 #if (CPU(X86) && PLATFORM(MAC)) \
1044 || (CPU(X86_64) && PLATFORM(MAC)) \
1045 || (CPU(ARM_THUMB2) && PLATFORM(IPHONE)) \
1046 || (CPU(ARM_THUMB2) && PLATFORM(ANDROID) && ENABLE(ANDROID_JSC_JIT)) \
1047 || (CPU(X86) && PLATFORM(WIN)) \
1048 || (CPU(X86) && PLATFORM(WX))
1049 #define ENABLE_YARR 1
1050 #define ENABLE_YARR_JIT 1
1051 #endif
1052
1053 #if PLATFORM(QT)
1054 #if (CPU(X86) && OS(WINDOWS) && COMPILER(MINGW) && GCC_VERSION >= 40100) \
1055 || (CPU(X86_64) && OS(WINDOWS) && COMPILER(MINGW64) && GCC_VERSION >= 40100) \
1056 || (CPU(X86) && OS(WINDOWS) && COMPILER(MSVC)) \
1057 || (CPU(X86) && OS(LINUX) && GCC_VERSION >= 40100) \
1058 || (CPU(X86_64) && OS(LINUX) && GCC_VERSION >= 40100) \
1059 || (CPU(ARM_TRADITIONAL) && OS(LINUX)) \
1060 || (CPU(ARM_TRADITIONAL) && OS(SYMBIAN) && COMPILER(RVCT)) \
1061 || (CPU(MIPS) && OS(LINUX))
1062 #define ENABLE_YARR 1
1063 #define ENABLE_YARR_JIT 1
1064 #endif
1065 #endif
1066
1067 #endif /* !defined(ENABLE_YARR_JIT) */
1068
1069 /* Sanity Check */
1070 #if ENABLE(YARR_JIT) && !ENABLE(YARR)
1071 #error "YARR_JIT requires YARR"
1072 #endif
1073
1074 #if ENABLE(JIT) || ENABLE(YARR_JIT)
1075 #define ENABLE_ASSEMBLER 1
1076 #endif
1077
1078 /* Pick which allocator to use; we only need an executable allocator if the assembler is compiled in.
1079 On x86-64 we use a single fixed mmap, on other platforms we mmap on demand. */
1080 #if ENABLE(ASSEMBLER)
1081 #define ENABLE_EXECUTABLE_ALLOCATOR_FIXED 1
1082 #endif
1083
1084 #if !defined(ENABLE_PAN_SCROLLING) && OS(WINDOWS)
1085 #define ENABLE_PAN_SCROLLING 1
1086 #endif
1087
1088 /* Use the QXmlStreamReader implementation for XMLTokenizer */
1089 /* Use the QXmlQuery implementation for XSLTProcessor */
1090 #if PLATFORM(QT)
1091 #define WTF_USE_QXMLSTREAM 1
1092 #define WTF_USE_QXMLQUERY 1
1093 #endif
1094
1095 #if !PLATFORM(QT)
1096 #define WTF_USE_FONT_FAST_PATH 1
1097 #endif
1098
1099 #if PLATFORM(MAC)
1100 /* Complex text framework */
1101 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
1102 #define WTF_USE_ATSUI 0
1103 #define WTF_USE_CORE_TEXT 1
1104 #else
1105 #define WTF_USE_ATSUI 1
1106 #define WTF_USE_CORE_TEXT 0
1107 #endif
1108
1109 /* Accelerated compositing */
1110 #if !defined(BUILDING_ON_TIGER)
1111 #define WTF_USE_ACCELERATED_COMPOSITING 1
1112 #endif
1113 #endif
1114
1115 #define WTF_USE_ACCELERATED_COMPOSITING 1
1116
1117 /* FIXME: Defining ENABLE_3D_RENDERING here isn't really right, but it's always used with
1118 with WTF_USE_ACCELERATED_COMPOSITING, and it allows the feature to be turned on and
1119 off in one place. */
1120 #if PLATFORM(WIN)
1121 #include "QuartzCorePresent.h"
1122 #if QUARTZCORE_PRESENT
1123 #define WTF_USE_ACCELERATED_COMPOSITING 1
1124 #define ENABLE_3D_RENDERING 1
1125 #endif
1126 #endif
1127
1128 #if (PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)) || PLATFORM(IPHONE)
1129 #define WTF_USE_PROTECTION_SPACE_AUTH_CALLBACK 1
1130 #endif
1131
1132 #if COMPILER(GCC)
1133 #define WARN_UNUSED_RETURN __attribute__ ((warn_unused_result))
1134 #else
1135 #define WARN_UNUSED_RETURN
1136 #endif
1137
1138 #if !ENABLE(NETSCAPE_PLUGIN_API) || (ENABLE(NETSCAPE_PLUGIN_API) && ((OS(UNIX) && (PLATFORM(QT) || PLATFORM(WX))) || PLATFORM(GTK)))
1139 #define ENABLE_PLUGIN_PACKAGE_SIMPLE_HASH 1
1140 #endif
1141
1142 /* Set up a define for a common error that is intended to cause a build error -- thus the space after Error. */
1143 #define WTF_PLATFORM_CFNETWORK Error USE_macro_should_be_used_with_CFNETWORK
1144
1145 #define ENABLE_JSC_ZOMBIES 0
1146
1147 #endif /* WTF_Platform_h */