Wed, 31 Dec 2014 06:55:50 +0100
Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2
1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2007-2009 Torch Mobile, Inc.
4 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 *
15 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
16 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
18 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
19 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
22 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
23 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
28 #ifndef assembler_wtf_Platform_h
29 #define assembler_wtf_Platform_h
31 /* ==== PLATFORM handles OS, operating environment, graphics API, and
32 CPU. This macro will be phased out in favor of platform adaptation
33 macros, policy decision macros, and top-level port definitions. ==== */
34 #define PLATFORM(WTF_FEATURE) (defined WTF_PLATFORM_##WTF_FEATURE && WTF_PLATFORM_##WTF_FEATURE)
37 /* ==== Platform adaptation macros: these describe properties of the target environment. ==== */
39 /* COMPILER() - the compiler being used to build the project */
40 #define COMPILER(WTF_FEATURE) (defined WTF_COMPILER_##WTF_FEATURE && WTF_COMPILER_##WTF_FEATURE)
41 /* CPU() - the target CPU architecture */
42 #define CPU(WTF_FEATURE) (defined WTF_CPU_##WTF_FEATURE && WTF_CPU_##WTF_FEATURE)
43 /* HAVE() - specific system features (headers, functions or similar) that are present or not */
44 #define HAVE(WTF_FEATURE) (defined HAVE_##WTF_FEATURE && HAVE_##WTF_FEATURE)
45 /* OS() - underlying operating system; only to be used for mandated low-level services like
46 virtual memory, not to choose a GUI toolkit */
47 #define OS(WTF_FEATURE) (defined WTF_OS_##WTF_FEATURE && WTF_OS_##WTF_FEATURE)
50 /* ==== Policy decision macros: these define policy choices for a particular port. ==== */
52 /* USE() - use a particular third-party library or optional OS service */
53 #define USE(WTF_FEATURE) (defined WTF_USE_##WTF_FEATURE && WTF_USE_##WTF_FEATURE)
54 /* ENABLE() - turn on a specific feature of WebKit */
55 #define ENABLE(WTF_FEATURE) (defined ENABLE_##WTF_FEATURE && ENABLE_##WTF_FEATURE)
59 /* ==== COMPILER() - the compiler being used to build the project ==== */
61 /* WTF_COMPILER_MSVC Microsoft Visual C++ */
62 /* WTF_COMPILER_MSVC7_OR_LOWER Microsoft Visual C++ 2003 or lower*/
63 /* WTF_COMPILER_MSVC9_OR_LOWER Microsoft Visual C++ 2008 or lower*/
64 #if defined(_MSC_VER)
65 #define WTF_COMPILER_MSVC 1
66 #if _MSC_VER < 1400
67 #define WTF_COMPILER_MSVC7_OR_LOWER 1
68 #elif _MSC_VER < 1600
69 #define WTF_COMPILER_MSVC9_OR_LOWER 1
70 #endif
71 #endif
73 /* WTF_COMPILER_RVCT - ARM RealView Compilation Tools */
74 /* WTF_COMPILER_RVCT4_OR_GREATER - ARM RealView Compilation Tools 4.0 or greater */
75 #if defined(__CC_ARM) || defined(__ARMCC__)
76 #define WTF_COMPILER_RVCT 1
77 #define RVCT_VERSION_AT_LEAST(major, minor, patch, build) (__ARMCC_VERSION >= (major * 100000 + minor * 10000 + patch * 1000 + build))
78 #else
79 /* Define this for !RVCT compilers, just so we can write things like RVCT_VERSION_AT_LEAST(3, 0, 0, 0). */
80 #define RVCT_VERSION_AT_LEAST(major, minor, patch, build) 0
81 #endif
83 /* WTF_COMPILER_GCC - GNU Compiler Collection */
84 /* --gnu option of the RVCT compiler also defines __GNUC__ */
85 #if defined(__GNUC__) && !WTF_COMPILER_RVCT
86 #define WTF_COMPILER_GCC 1
87 #define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
88 #define GCC_VERSION_AT_LEAST(major, minor, patch) (GCC_VERSION >= (major * 10000 + minor * 100 + patch))
89 #else
90 /* Define this for !GCC compilers, just so we can write things like GCC_VERSION_AT_LEAST(4, 1, 0). */
91 #define GCC_VERSION_AT_LEAST(major, minor, patch) 0
92 #endif
94 /* WTF_COMPILER_MINGW - MinGW GCC */
95 /* WTF_COMPILER_MINGW64 - mingw-w64 GCC - only used as additional check to exclude mingw.org specific functions */
96 #if defined(__MINGW32__)
97 #define WTF_COMPILER_MINGW 1
98 #include <_mingw.h> /* private MinGW header */
99 #if defined(__MINGW64_VERSION_MAJOR) /* best way to check for mingw-w64 vs mingw.org */
100 #define WTF_COMPILER_MINGW64 1
101 #endif /* __MINGW64_VERSION_MAJOR */
102 #endif /* __MINGW32__ */
104 /* WTF_COMPILER_WINSCW - CodeWarrior for Symbian emulator */
105 #if defined(__WINSCW__)
106 #define WTF_COMPILER_WINSCW 1
107 /* cross-compiling, it is not really windows */
108 #undef WIN32
109 #undef _WIN32
110 #endif
112 /* WTF_COMPILER_INTEL - Intel C++ Compiler */
113 #if defined(__INTEL_COMPILER)
114 #define WTF_COMPILER_INTEL 1
115 #endif
117 /* WTF_COMPILER_SUNCC */
118 #if defined(__SUNPRO_CC) || defined(__SUNPRO_C)
119 #define WTF_COMPILER_SUNCC 1
120 #endif
122 /* ==== CPU() - the target CPU architecture ==== */
124 /* This also defines WTF_CPU_BIG_ENDIAN or WTF_CPU_MIDDLE_ENDIAN or neither, as appropriate. */
126 /* WTF_CPU_ALPHA - DEC Alpha */
127 #if defined(__alpha__)
128 #define WTF_CPU_ALPHA 1
129 #endif
131 /* WTF_CPU_IA64 - Itanium / IA-64 */
132 #if defined(__ia64__)
133 #define WTF_CPU_IA64 1
134 /* 32-bit mode on Itanium */
135 #if !defined(__LP64__)
136 #define WTF_CPU_IA64_32 1
137 #endif
138 #endif
140 /* WTF_CPU_MIPS - MIPS 32-bit */
141 /* Note: Only O32 ABI is tested, so we enable it for O32 ABI for now. */
142 #if (defined(mips) || defined(__mips__) || defined(MIPS) || defined(_MIPS_)) \
143 && defined(_ABIO32)
144 #define WTF_CPU_MIPS 1
145 #if defined(__MIPSEB__)
146 #define WTF_CPU_BIG_ENDIAN 1
147 #endif
148 #define WTF_MIPS_PIC (defined __PIC__)
149 #define WTF_MIPS_ARCH __mips
150 #define WTF_MIPS_ISA(v) (defined WTF_MIPS_ARCH && WTF_MIPS_ARCH == v)
151 #define WTF_MIPS_ISA_AT_LEAST(v) (defined WTF_MIPS_ARCH && WTF_MIPS_ARCH >= v)
152 #define WTF_MIPS_ARCH_REV __mips_isa_rev
153 #define WTF_MIPS_ISA_REV(v) (defined WTF_MIPS_ARCH_REV && WTF_MIPS_ARCH_REV == v)
154 #define WTF_MIPS_DOUBLE_FLOAT (defined __mips_hard_float && !defined __mips_single_float)
155 #define WTF_MIPS_FP64 (defined __mips_fpr && __mips_fpr == 64)
156 /* MIPS requires allocators to use aligned memory */
157 #define WTF_USE_ARENA_ALLOC_ALIGNMENT_INTEGER 1
158 #endif /* MIPS */
160 /* WTF_CPU_PPC - PowerPC 32-bit */
161 #if defined(__ppc__) \
162 || defined(__PPC__) \
163 || defined(__powerpc__) \
164 || defined(__powerpc) \
165 || defined(__POWERPC__) \
166 || defined(_M_PPC) \
167 || defined(__PPC)
168 #if !defined(__ppc64__) && !defined(__PPC64__)
169 #define WTF_CPU_PPC 1
170 #endif
171 #if !defined(__LITTLE_ENDIAN__)
172 #define WTF_CPU_BIG_ENDIAN 1
173 #endif
174 #endif
176 /* WTF_CPU_PPC64 - PowerPC 64-bit */
177 #if defined(__ppc64__) \
178 || defined(__PPC64__)
179 #define WTF_CPU_PPC64 1
180 #if !defined(__LITTLE_ENDIAN__)
181 #define WTF_CPU_BIG_ENDIAN 1
182 #endif
183 #endif
185 /* WTF_CPU_SH4 - SuperH SH-4 */
186 #if defined(__SH4__)
187 #define WTF_CPU_SH4 1
188 #endif
190 /* WTF_CPU_SPARC32 - SPARC 32-bit */
191 #if defined(__sparc) && !defined(__arch64__) || defined(__sparcv8)
192 #define WTF_CPU_SPARC32 1
193 #define WTF_CPU_BIG_ENDIAN 1
194 #endif
196 /* WTF_CPU_SPARC64 - SPARC 64-bit */
197 #if defined(__sparc__) && defined(__arch64__) || defined (__sparcv9)
198 #define WTF_CPU_SPARC64 1
199 #define WTF_CPU_BIG_ENDIAN 1
200 #endif
202 /* WTF_CPU_SPARC - any SPARC, true for WTF_CPU_SPARC32 and WTF_CPU_SPARC64 */
203 #if WTF_CPU_SPARC32 || WTF_CPU_SPARC64
204 #define WTF_CPU_SPARC 1
205 #endif
207 /* WTF_CPU_S390X - S390 64-bit */
208 #if defined(__s390x__)
209 #define WTF_CPU_S390X 1
210 #define WTF_CPU_BIG_ENDIAN 1
211 #endif
213 /* WTF_CPU_S390 - S390 32-bit */
214 #if defined(__s390__)
215 #define WTF_CPU_S390 1
216 #define WTF_CPU_BIG_ENDIAN 1
217 #endif
219 #if defined(__aarch64__)
220 #define WTF_CPU_AARCH64 1
221 #if defined(__AARCH64EB__)
222 #define WTF_CPU_BIG_ENDIAN 1
223 #endif
224 #endif
226 /* WTF_CPU_X86 - i386 / x86 32-bit */
227 #if defined(__i386__) \
228 || defined(i386) \
229 || defined(_M_IX86) \
230 || defined(_X86_) \
231 || defined(__THW_INTEL)
232 #define WTF_CPU_X86 1
233 #endif
235 /* WTF_CPU_X86_64 - AMD64 / Intel64 / x86_64 64-bit */
236 #if defined(__x86_64__) \
237 || defined(_M_X64)
238 #define WTF_CPU_X86_64 1
239 #endif
241 /* WTF_CPU_ARM - ARM, any version*/
242 #if defined(arm) \
243 || defined(__arm__) \
244 || defined(ARM) \
245 || defined(_ARM_)
246 #define WTF_CPU_ARM 1
248 #if defined(__ARMEB__) || (WTF_COMPILER_RVCT && defined(__BIG_ENDIAN))
249 #define WTF_CPU_BIG_ENDIAN 1
251 #elif !defined(__ARM_EABI__) \
252 && !defined(__EABI__) \
253 && !defined(__VFP_FP__) \
254 && !defined(_WIN32_WCE) \
255 && !defined(ANDROID)
256 #define WTF_CPU_MIDDLE_ENDIAN 1
258 #endif
260 #define WTF_ARM_ARCH_AT_LEAST(N) (CPU(ARM) && WTF_ARM_ARCH_VERSION >= N)
261 #define WTF_ARM_ARCH_AT_LEAST_5 (WTF_CPU_ARM && WTF_ARM_ARCH_VERSION >= 5)
263 /* Set WTF_ARM_ARCH_VERSION */
264 #if defined(__ARM_ARCH_4__) \
265 || defined(__ARM_ARCH_4T__) \
266 || defined(__MARM_ARMV4__) \
267 || defined(_ARMV4I_)
268 #define WTF_ARM_ARCH_VERSION 4
270 #elif defined(__ARM_ARCH_5__) \
271 || defined(__ARM_ARCH_5T__) \
272 || defined(__MARM_ARMV5__)
273 #define WTF_ARM_ARCH_VERSION 5
275 #elif defined(__ARM_ARCH_5E__) \
276 || defined(__ARM_ARCH_5TE__) \
277 || defined(__ARM_ARCH_5TEJ__)
278 #define WTF_ARM_ARCH_VERSION 5
279 /*ARMv5TE requires allocators to use aligned memory*/
280 #define WTF_USE_ARENA_ALLOC_ALIGNMENT_INTEGER 1
282 #elif defined(__ARM_ARCH_6__) \
283 || defined(__ARM_ARCH_6J__) \
284 || defined(__ARM_ARCH_6K__) \
285 || defined(__ARM_ARCH_6Z__) \
286 || defined(__ARM_ARCH_6ZK__) \
287 || defined(__ARM_ARCH_6T2__) \
288 || defined(__ARMV6__)
289 #define WTF_ARM_ARCH_VERSION 6
291 #elif defined(__ARM_ARCH_7A__) \
292 || defined(__ARM_ARCH_7R__)
293 #define WTF_ARM_ARCH_VERSION 7
295 /* RVCT sets _TARGET_ARCH_ARM */
296 #elif defined(__TARGET_ARCH_ARM)
297 #define WTF_ARM_ARCH_VERSION __TARGET_ARCH_ARM
299 #if defined(__TARGET_ARCH_5E) \
300 || defined(__TARGET_ARCH_5TE) \
301 || defined(__TARGET_ARCH_5TEJ)
302 /*ARMv5TE requires allocators to use aligned memory*/
303 #define WTF_USE_ARENA_ALLOC_ALIGNMENT_INTEGER 1
304 #endif
306 #else
307 #define WTF_ARM_ARCH_VERSION 0
309 #endif
311 /* Set WTF_THUMB_ARCH_VERSION */
312 #if defined(__ARM_ARCH_4T__)
313 #define WTF_THUMB_ARCH_VERSION 1
315 #elif defined(__ARM_ARCH_5T__) \
316 || defined(__ARM_ARCH_5TE__) \
317 || defined(__ARM_ARCH_5TEJ__)
318 #define WTF_THUMB_ARCH_VERSION 2
320 #elif defined(__ARM_ARCH_6J__) \
321 || defined(__ARM_ARCH_6K__) \
322 || defined(__ARM_ARCH_6Z__) \
323 || defined(__ARM_ARCH_6ZK__) \
324 || defined(__ARM_ARCH_6M__)
325 #define WTF_THUMB_ARCH_VERSION 3
327 #elif defined(__ARM_ARCH_6T2__) \
328 || defined(__ARM_ARCH_7__) \
329 || defined(__ARM_ARCH_7A__) \
330 || defined(__ARM_ARCH_7R__) \
331 || defined(__ARM_ARCH_7M__)
332 #define WTF_THUMB_ARCH_VERSION 4
334 /* RVCT sets __TARGET_ARCH_THUMB */
335 #elif defined(__TARGET_ARCH_THUMB)
336 #define WTF_THUMB_ARCH_VERSION __TARGET_ARCH_THUMB
338 #else
339 #define WTF_THUMB_ARCH_VERSION 0
340 #endif
343 /* WTF_CPU_ARMV5_OR_LOWER - ARM instruction set v5 or earlier */
344 /* On ARMv5 and below the natural alignment is required.
345 And there are some other differences for v5 or earlier. */
346 #if !defined(ARMV5_OR_LOWER) && WTF_CPU_ARM && !(WTF_ARM_ARCH_VERSION >= 6)
347 #define WTF_CPU_ARMV5_OR_LOWER 1
348 #endif
351 /* WTF_CPU_ARM_TRADITIONAL - Thumb2 is not available, only traditional ARM (v4 or greater) */
352 /* WTF_CPU_ARM_THUMB2 - Thumb2 instruction set is available */
353 /* Only one of these will be defined. */
354 #if !defined(WTF_CPU_ARM_TRADITIONAL) && !defined(WTF_CPU_ARM_THUMB2)
355 # if defined(thumb2) || defined(__thumb2__) \
356 || ((defined(__thumb) || defined(__thumb__)) && WTF_THUMB_ARCH_VERSION == 4)
357 # define WTF_CPU_ARM_TRADITIONAL 1
358 # define WTF_CPU_ARM_THUMB2 0
359 # elif WTF_CPU_ARM && WTF_ARM_ARCH_VERSION >= 4
360 # define WTF_CPU_ARM_TRADITIONAL 1
361 # define WTF_CPU_ARM_THUMB2 0
362 # else
363 # error "Not supported ARM architecture"
364 # endif
365 #elif WTF_CPU_ARM_TRADITIONAL && WTF_CPU_ARM_THUMB2 /* Sanity Check */
366 # error "Cannot use both of WTF_CPU_ARM_TRADITIONAL and WTF_CPU_ARM_THUMB2 platforms"
367 #endif /* !defined(WTF_CPU_ARM_TRADITIONAL) && !defined(WTF_CPU_ARM_THUMB2) */
369 #if defined(__ARM_NEON__) && !defined(WTF_CPU_ARM_NEON)
370 #define WTF_CPU_ARM_NEON 1
371 #endif
373 #endif /* ARM */
375 #if defined(JS_ARM_SIMULATOR)
376 # undef WTF_CPU_X86
377 # undef WTF_CPU_X64
378 # define WTF_CPU_ARM_TRADITIONAL 1
379 # define WTF_CPU_ARM 1
380 #endif
382 #if WTF_CPU_ARM || WTF_CPU_MIPS
383 #define WTF_CPU_NEEDS_ALIGNED_ACCESS 1
384 #endif
386 /* ==== OS() - underlying operating system; only to be used for mandated low-level services like
387 virtual memory, not to choose a GUI toolkit ==== */
389 /* WTF_OS_ANDROID - Android */
390 #ifdef ANDROID
391 #define WTF_OS_ANDROID 1
392 #endif
394 /* WTF_OS_AIX - AIX */
395 #ifdef _AIX
396 #define WTF_OS_AIX 1
397 #endif
399 /* WTF_OS_DARWIN - Any Darwin-based OS, including Mac OS X and iPhone OS */
400 #ifdef __APPLE__
401 #define WTF_OS_DARWIN 1
403 /* FIXME: BUILDING_ON_.., and TARGETING... macros should be folded into the OS() system */
404 #include <AvailabilityMacros.h>
405 #if !defined(MAC_OS_X_VERSION_10_5) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5
406 #define BUILDING_ON_TIGER 1
407 #elif !defined(MAC_OS_X_VERSION_10_6) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6
408 #define BUILDING_ON_LEOPARD 1
409 #elif !defined(MAC_OS_X_VERSION_10_7) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
410 #define BUILDING_ON_SNOW_LEOPARD 1
411 #endif
412 #if !defined(MAC_OS_X_VERSION_10_5) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5
413 #define TARGETING_TIGER 1
414 #elif !defined(MAC_OS_X_VERSION_10_6) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6
415 #define TARGETING_LEOPARD 1
416 #elif !defined(MAC_OS_X_VERSION_10_7) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_7
417 #define TARGETING_SNOW_LEOPARD 1
418 #endif
419 #include <TargetConditionals.h>
421 #endif
423 /* WTF_OS_IOS - iOS */
424 /* WTF_OS_MAC_OS_X - Mac OS X (not including iOS) */
425 #if WTF_OS_DARWIN && ((defined(TARGET_OS_EMBEDDED) && TARGET_OS_EMBEDDED) \
426 || (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE) \
427 || (defined(TARGET_IPHONE_SIMULATOR) && TARGET_IPHONE_SIMULATOR))
428 #define WTF_OS_IOS 1
429 #elif WTF_OS_DARWIN && defined(TARGET_OS_MAC) && TARGET_OS_MAC
430 #define WTF_OS_MAC_OS_X 1
431 #endif
434 /* WTF_OS_FREEBSD - FreeBSD */
435 #if defined(__FreeBSD__) || defined(__DragonFly__)
436 #define WTF_OS_FREEBSD 1
437 #endif
439 /* WTF_OS_HAIKU - Haiku */
440 #ifdef __HAIKU__
441 #define WTF_OS_HAIKU 1
442 #endif
444 /* WTF_OS_LINUX - Linux */
445 #if defined(__linux__) && !defined(ANDROID)
446 #define WTF_OS_LINUX 1
447 #endif
449 /* WTF_OS_NETBSD - NetBSD */
450 #if defined(__NetBSD__)
451 #define WTF_OS_NETBSD 1
452 #endif
454 /* WTF_OS_OPENBSD - OpenBSD */
455 #ifdef __OpenBSD__
456 #define WTF_OS_OPENBSD 1
457 #endif
459 /* WTF_OS_QNX - QNX */
460 #if defined(__QNXNTO__)
461 #define WTF_OS_QNX 1
462 #endif
464 /* WTF_OS_SOLARIS - Solaris */
465 #if defined(sun) || defined(__sun)
466 #define WTF_OS_SOLARIS 1
467 #endif
469 /* WTF_OS_WINCE - Windows CE; note that for this platform WTF_OS_WINDOWS is also defined */
470 #if defined(_WIN32_WCE)
471 #define WTF_OS_WINCE 1
472 #endif
474 /* WTF_OS_WINDOWS - Any version of Windows */
475 #if defined(WIN32) || defined(_WIN32)
476 #define WTF_OS_WINDOWS 1
477 #endif
479 /* WTF_OS_SYMBIAN - Symbian */
480 #if defined (__SYMBIAN32__)
481 #define WTF_OS_SYMBIAN 1
482 #endif
484 /* WTF_OS_UNIX - Any Unix-like system */
485 #if WTF_OS_AIX \
486 || WTF_OS_ANDROID \
487 || WTF_OS_DARWIN \
488 || WTF_OS_FREEBSD \
489 || WTF_OS_HAIKU \
490 || WTF_OS_LINUX \
491 || WTF_OS_NETBSD \
492 || WTF_OS_OPENBSD \
493 || WTF_OS_QNX \
494 || WTF_OS_SOLARIS \
495 || WTF_OS_SYMBIAN \
496 || defined(unix) \
497 || defined(__unix) \
498 || defined(__unix__)
499 #define WTF_OS_UNIX 1
500 #endif
502 /* WTF_OS_OS2 - OS/2 */
503 #if defined (__OS2__)
504 #define WTF_OS_OS2 1
505 #endif
507 /* Operating environments */
509 /* FIXME: these are all mixes of OS, operating environment and policy choices. */
510 /* WTF_PLATFORM_CHROMIUM */
511 /* WTF_PLATFORM_QT */
512 /* WTF_PLATFORM_WX */
513 /* WTF_PLATFORM_GTK */
514 /* WTF_PLATFORM_HAIKU */
515 /* WTF_PLATFORM_MAC */
516 /* WTF_PLATFORM_WIN */
517 #if defined(BUILDING_CHROMIUM__)
518 #define WTF_PLATFORM_CHROMIUM 1
519 #elif defined(BUILDING_QT__)
520 #define WTF_PLATFORM_QT 1
521 #elif defined(BUILDING_WX__)
522 #define WTF_PLATFORM_WX 1
523 #elif defined(BUILDING_GTK__)
524 #define WTF_PLATFORM_GTK 1
525 #elif defined(BUILDING_HAIKU__)
526 #define WTF_PLATFORM_HAIKU 1
527 #elif defined(BUILDING_BREWMP__)
528 #define WTF_PLATFORM_BREWMP 1
529 #if defined(AEE_SIMULATOR)
530 #define WTF_PLATFORM_BREWMP_SIMULATOR 1
531 #else
532 #define WTF_PLATFORM_BREWMP_SIMULATOR 0
533 #endif
534 #undef WTF_OS_WINDOWS
535 #undef WTF_PLATFORM_WIN
536 #elif WTF_OS_DARWIN
537 #define WTF_PLATFORM_MAC 1
538 #elif WTF_OS_WINDOWS
539 #define WTF_PLATFORM_WIN 1
540 #endif
542 /* WTF_PLATFORM_IOS */
543 /* FIXME: this is sometimes used as an OS switch and sometimes for higher-level things */
544 #if (defined(TARGET_OS_EMBEDDED) && TARGET_OS_EMBEDDED) || (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE)
545 #define WTF_PLATFORM_IOS 1
546 #endif
548 /* WTF_PLATFORM_IOS_SIMULATOR */
549 #if defined(TARGET_IPHONE_SIMULATOR) && TARGET_IPHONE_SIMULATOR
550 #define WTF_PLATFORM_IOS 1
551 #define WTF_PLATFORM_IOS_SIMULATOR 1
552 #else
553 #define WTF_PLATFORM_IOS_SIMULATOR 0
554 #endif
556 #if !defined(WTF_PLATFORM_IOS)
557 #define WTF_PLATFORM_IOS 0
558 #endif
560 /* WTF_PLATFORM_ANDROID */
561 /* FIXME: this is sometimes used as an OS() switch, and other times to drive
562 policy choices */
563 #if defined(ANDROID)
564 #define WTF_PLATFORM_ANDROID 1
565 #endif
567 /* Graphics engines */
569 /* WTF_USE_CG and WTF_PLATFORM_CI */
570 #if WTF_PLATFORM_MAC || WTF_PLATFORM_IOS
571 #define WTF_USE_CG 1
572 #endif
573 #if WTF_PLATFORM_MAC || WTF_PLATFORM_IOS || (WTF_PLATFORM_WIN && WTF_USE_CG)
574 #define WTF_USE_CA 1
575 #endif
577 /* WTF_USE_SKIA for Win/Linux, CG for Mac */
578 #if WTF_PLATFORM_CHROMIUM
579 #if WTF_OS_DARWIN
580 #define WTF_USE_CG 1
581 #define WTF_USE_ATSUI 1
582 #define WTF_USE_CORE_TEXT 1
583 #define WTF_USE_ICCJPEG 1
584 #else
585 #define WTF_USE_SKIA 1
586 #define WTF_USE_CHROMIUM_NET 1
587 #endif
588 #endif
590 #if WTF_PLATFORM_BREWMP
591 #define WTF_USE_SKIA 1
592 #endif
594 #if WTF_PLATFORM_GTK
595 #define WTF_USE_CAIRO 1
596 #endif
599 #if WTF_OS_WINCE
600 #include <ce_time.h>
601 #define WTF_USE_MERSENNE_TWISTER_19937 1
602 #endif
604 #if WTF_PLATFORM_QT && WTF_OS_UNIX && !WTF_OS_SYMBIAN && !WTF_OS_DARWIN
605 #define WTF_USE_PTHREAD_BASED_QT 1
606 #endif
608 #if (WTF_PLATFORM_GTK || WTF_PLATFORM_IOS || WTF_PLATFORM_MAC || WTF_PLATFORM_WIN || (WTF_PLATFORM_QT && (WTF_OS_DARWIN || WTF_USE_PTHREAD_BASED_QT) && !ENABLE_SINGLE_THREADED)) && !defined(ENABLE_JSC_MULTIPLE_THREADS)
609 #define ENABLE_JSC_MULTIPLE_THREADS 1
610 #endif
612 #if ENABLE_JSC_MULTIPLE_THREADS
613 #define ENABLE_WTF_MULTIPLE_THREADS 1
614 #endif
616 /* On Windows, use QueryPerformanceCounter by default */
617 #if WTF_OS_WINDOWS
618 #define WTF_USE_QUERY_PERFORMANCE_COUNTER 1
619 #endif
621 #if WTF_OS_WINCE && !WTF_PLATFORM_QT
622 #define NOMINMAX /* Windows min and max conflict with standard macros */
623 #define NOSHLWAPI /* shlwapi.h not available on WinCe */
625 /* MSDN documentation says these functions are provided with uspce.lib. But we cannot find this file. */
626 #define __usp10__ /* disable "usp10.h" */
628 #define _INC_ASSERT /* disable "assert.h" */
629 #define assert(x)
631 #endif /* WTF_OS_WINCE && !WTF_PLATFORM_QT */
633 #if WTF_PLATFORM_QT
634 #define WTF_USE_QT4_UNICODE 1
635 #elif WTF_OS_WINCE
636 #define WTF_USE_WINCE_UNICODE 1
637 #elif WTF_PLATFORM_BREWMP
638 #define WTF_USE_BREWMP_UNICODE 1
639 #elif WTF_PLATFORM_GTK
640 /* The GTK+ Unicode backend is configurable */
641 #else
642 #define WTF_USE_ICU_UNICODE 1
643 #endif
645 #if WTF_PLATFORM_MAC && !WTF_PLATFORM_IOS
646 #if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_TIGER) && WTF_CPU_X86_64
647 #define WTF_USE_PLUGIN_HOST_PROCESS 1
648 #endif
649 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
650 #define ENABLE_GESTURE_EVENTS 1
651 #define ENABLE_RUBBER_BANDING 1
652 #define WTF_USE_WK_SCROLLBAR_PAINTER 1
653 #endif
654 #if !defined(ENABLE_JAVA_BRIDGE)
655 #define ENABLE_JAVA_BRIDGE 1
656 #endif
657 #if !defined(ENABLE_DASHBOARD_SUPPORT)
658 #define ENABLE_DASHBOARD_SUPPORT 1
659 #endif
660 #define WTF_USE_CF 1
661 #define WTF_USE_PTHREADS 1
662 #define HAVE_PTHREAD_RWLOCK 1
663 #define HAVE_READLINE 1
664 #define HAVE_RUNLOOP_TIMER 1
665 #define ENABLE_FULLSCREEN_API 1
666 #define ENABLE_SMOOTH_SCROLLING 1
667 #define ENABLE_WEB_ARCHIVE 1
668 #endif /* WTF_PLATFORM_MAC && !WTF_PLATFORM_IOS */
670 #if WTF_PLATFORM_CHROMIUM && WTF_OS_DARWIN
671 #define WTF_USE_CF 1
672 #define WTF_USE_PTHREADS 1
673 #define HAVE_PTHREAD_RWLOCK 1
674 #endif
676 #if WTF_PLATFORM_BREWMP
677 #define ENABLE_SINGLE_THREADED 1
678 #endif
680 #if WTF_PLATFORM_QT && WTF_OS_DARWIN
681 #define WTF_USE_CF 1
682 #endif
684 #if WTF_OS_DARWIN && !defined(BUILDING_ON_TIGER) && !WTF_PLATFORM_GTK && !WTF_PLATFORM_QT
685 #define ENABLE_PURGEABLE_MEMORY 1
686 #endif
688 #if WTF_PLATFORM_IOS
689 #define ENABLE_CONTEXT_MENUS 0
690 #define ENABLE_DRAG_SUPPORT 0
691 #define ENABLE_DATA_TRANSFER_ITEMS 0
692 #define ENABLE_FTPDIR 1
693 #define ENABLE_GEOLOCATION 1
694 #define ENABLE_ICONDATABASE 0
695 #define ENABLE_INSPECTOR 0
696 #define ENABLE_JAVA_BRIDGE 0
697 #define ENABLE_NETSCAPE_PLUGIN_API 0
698 #define ENABLE_ORIENTATION_EVENTS 1
699 #define ENABLE_REPAINT_THROTTLING 1
700 #define HAVE_READLINE 1
701 #define WTF_USE_CF 1
702 #define WTF_USE_PTHREADS 1
703 #define HAVE_PTHREAD_RWLOCK 1
704 #define ENABLE_WEB_ARCHIVE 1
705 #endif
707 #if WTF_PLATFORM_ANDROID
708 #define WTF_USE_PTHREADS 1
709 #define USE_SYSTEM_MALLOC 1
710 #define ENABLE_JAVA_BRIDGE 1
711 #define LOG_DISABLED 1
712 /* Prevents Webkit from drawing the caret in textfields and textareas
713 This prevents unnecessary invals. */
714 #define ENABLE_TEXT_CARET 1
715 #define ENABLE_JAVASCRIPT_DEBUGGER 0
716 #endif
718 #if WTF_PLATFORM_WIN && !WTF_OS_WINCE
719 #define WTF_USE_CF 1
720 #define WTF_USE_PTHREADS 0
721 #endif
723 #if WTF_PLATFORM_WIN && !WTF_OS_WINCE && !WTF_PLATFORM_CHROMIUM && !defined(WIN_CAIRO)
724 #define WTF_USE_CFNETWORK 1
725 #endif
727 #if WTF_USE_CFNETWORK || WTF_PLATFORM_MAC
728 #define WTF_USE_CFURLCACHE 1
729 #define WTF_USE_CFURLSTORAGESESSIONS 1
730 #endif
732 #if WTF_PLATFORM_WIN && !WTF_OS_WINCE && !WTF_PLATFORM_CHROMIUM && !WTF_PLATFORM_QT
733 #define ENABLE_WEB_ARCHIVE 1
734 #endif
736 #if WTF_PLATFORM_WX
737 #define ENABLE_ASSEMBLER 1
738 #define ENABLE_GLOBAL_FASTMALLOC_NEW 0
739 #if WTF_OS_DARWIN
740 #define WTF_USE_CF 1
741 #ifndef BUILDING_ON_TIGER
742 #define WTF_USE_CORE_TEXT 1
743 #define ENABLE_WEB_ARCHIVE 1
744 #else
745 #define WTF_USE_ATSUI 1
746 #endif
747 #endif
748 #endif
750 #if WTF_PLATFORM_GTK
751 #if HAVE_PTHREAD_H
752 #define WTF_USE_PTHREADS 1
753 #define HAVE_PTHREAD_RWLOCK 1
754 #endif
755 #endif
757 #if WTF_PLATFORM_HAIKU
758 #define HAVE_POSIX_MEMALIGN 1
759 #define WTF_USE_CURL 1
760 #define WTF_USE_PTHREADS 1
761 #define HAVE_PTHREAD_RWLOCK 1
762 #define USE_SYSTEM_MALLOC 1
763 #define ENABLE_NETSCAPE_PLUGIN_API 0
764 #endif
766 #if WTF_PLATFORM_BREWMP
767 #define USE_SYSTEM_MALLOC 1
768 #endif
770 #if WTF_PLATFORM_BREWMP_SIMULATOR
771 #define ENABLE_JIT 0
772 #endif
774 #if !defined(HAVE_ACCESSIBILITY)
775 #if WTF_PLATFORM_IOS || WTF_PLATFORM_MAC || WTF_PLATFORM_WIN || WTF_PLATFORM_GTK || WTF_PLATFORM_CHROMIUM
776 #define HAVE_ACCESSIBILITY 1
777 #endif
778 #endif /* !defined(HAVE_ACCESSIBILITY) */
780 #if WTF_OS_UNIX && !WTF_OS_SYMBIAN
781 #define HAVE_SIGNAL_H 1
782 #endif
784 #if !defined(HAVE_STRNSTR)
785 #if WTF_OS_DARWIN || WTF_OS_FREEBSD
786 #define HAVE_STRNSTR 1
787 #endif
788 #endif
790 #if !WTF_OS_WINDOWS && !WTF_OS_SOLARIS && !WTF_OS_QNX \
791 && !WTF_OS_SYMBIAN && !WTF_OS_HAIKU && !WTF_OS_RVCT \
792 && !WTF_OS_ANDROID && !WTF_PLATFORM_BREWMP
793 #define HAVE_TM_GMTOFF 1
794 #define HAVE_TM_ZONE 1
795 #define HAVE_TIMEGM 1
796 #endif
798 #if WTF_OS_DARWIN
800 #define HAVE_ERRNO_H 1
801 #define HAVE_LANGINFO_H 1
802 #define HAVE_MMAP 1
803 #define HAVE_MERGESORT 1
804 #define HAVE_SBRK 1
805 #define HAVE_STRINGS_H 1
806 #define HAVE_SYS_PARAM_H 1
807 #define HAVE_SYS_TIME_H 1
808 #define HAVE_SYS_TIMEB_H 1
809 #define WTF_USE_ACCELERATE 1
811 #if !defined(TARGETING_TIGER) && !defined(TARGETING_LEOPARD)
813 #define HAVE_DISPATCH_H 1
814 #define HAVE_HOSTED_CORE_ANIMATION 1
816 #if !WTF_PLATFORM_IOS
817 #define HAVE_MADV_FREE_REUSE 1
818 #define HAVE_MADV_FREE 1
819 #define HAVE_PTHREAD_SETNAME_NP 1
820 #endif
822 #endif
824 #if WTF_PLATFORM_IOS
825 #define HAVE_MADV_FREE 1
826 #endif
828 #elif WTF_OS_WINDOWS
830 #if WTF_OS_WINCE
831 #define HAVE_ERRNO_H 0
832 #else
833 #define HAVE_SYS_TIMEB_H 1
834 #define HAVE_ALIGNED_MALLOC 1
835 #define HAVE_ISDEBUGGERPRESENT 1
836 #endif
837 #define HAVE_VIRTUALALLOC 1
839 #elif WTF_OS_SYMBIAN
841 #define HAVE_ERRNO_H 1
842 #define HAVE_MMAP 0
843 #define HAVE_SBRK 1
845 #define HAVE_SYS_TIME_H 1
846 #define HAVE_STRINGS_H 1
848 #if !WTF_COMPILER_RVCT
849 #define HAVE_SYS_PARAM_H 1
850 #endif
852 #elif WTF_PLATFORM_BREWMP
854 #define HAVE_ERRNO_H 1
856 #elif WTF_OS_QNX
858 #define HAVE_ERRNO_H 1
859 #define HAVE_MMAP 1
860 #define HAVE_SBRK 1
861 #define HAVE_STRINGS_H 1
862 #define HAVE_SYS_PARAM_H 1
863 #define HAVE_SYS_TIME_H 1
865 #elif WTF_OS_ANDROID
867 #define HAVE_ERRNO_H 1
868 #define HAVE_LANGINFO_H 0
869 #define HAVE_MMAP 1
870 #define HAVE_SBRK 1
871 #define HAVE_STRINGS_H 1
872 #define HAVE_SYS_PARAM_H 1
873 #define HAVE_SYS_TIME_H 1
875 #elif WTF_OS_OS2
877 #define USE_SYSTEM_MALLOC 1
878 #define HAVE_ERRNO_H 1
879 #define HAVE_LANGINFO_H 1
880 #define HAVE_MMAP 0
881 #define HAVE_POSIX_MEMALIGN 1
882 #define HAVE_SBRK 1
883 #define HAVE_SYS_PARAM_H 1
884 #define HAVE_SYS_TIME_H 1
885 #define HAVE_STRINGS_H 1
887 #else
889 /* FIXME: is this actually used or do other platforms generate their own config.h? */
891 #define HAVE_ERRNO_H 1
892 /* As long as Haiku doesn't have a complete support of locale this will be disabled. */
893 #if !WTF_OS_HAIKU
894 #define HAVE_LANGINFO_H 1
895 #endif
896 #define HAVE_MMAP 1
897 #define HAVE_SBRK 1
898 #define HAVE_STRINGS_H 1
899 #define HAVE_SYS_PARAM_H 1
900 #define HAVE_SYS_TIME_H 1
902 #endif
904 /* ENABLE macro defaults */
906 #if WTF_PLATFORM_QT
907 /* We must not customize the global operator new and delete for the Qt port. */
908 #define ENABLE_GLOBAL_FASTMALLOC_NEW 0
909 #if !WTF_OS_UNIX || WTF_OS_SYMBIAN
910 #define USE_SYSTEM_MALLOC 1
911 #endif
912 #endif
914 /* fastMalloc match validation allows for runtime verification that
915 new is matched by delete, fastMalloc is matched by fastFree, etc. */
916 #if !defined(ENABLE_FAST_MALLOC_MATCH_VALIDATION)
917 #define ENABLE_FAST_MALLOC_MATCH_VALIDATION 0
918 #endif
920 #if !defined(ENABLE_ICONDATABASE)
921 #define ENABLE_ICONDATABASE 1
922 #endif
924 #if !defined(ENABLE_DATABASE)
925 #define ENABLE_DATABASE 1
926 #endif
928 #if !defined(ENABLE_JAVASCRIPT_DEBUGGER)
929 #define ENABLE_JAVASCRIPT_DEBUGGER 1
930 #endif
932 #if !defined(ENABLE_FTPDIR)
933 #define ENABLE_FTPDIR 1
934 #endif
936 #if !defined(ENABLE_CONTEXT_MENUS)
937 #define ENABLE_CONTEXT_MENUS 1
938 #endif
940 #if !defined(ENABLE_DRAG_SUPPORT)
941 #define ENABLE_DRAG_SUPPORT 1
942 #endif
944 #if !defined(ENABLE_DATA_TRANSFER_ITEMS)
945 #define ENABLE_DATA_TRANSFER_ITEMS 0
946 #endif
948 #if !defined(ENABLE_DASHBOARD_SUPPORT)
949 #define ENABLE_DASHBOARD_SUPPORT 0
950 #endif
952 #if !defined(ENABLE_INSPECTOR)
953 #define ENABLE_INSPECTOR 1
954 #endif
956 #if !defined(ENABLE_JAVA_BRIDGE)
957 #define ENABLE_JAVA_BRIDGE 0
958 #endif
960 #if !defined(ENABLE_NETSCAPE_PLUGIN_API)
961 #define ENABLE_NETSCAPE_PLUGIN_API 1
962 #endif
964 #if !defined(ENABLE_NETSCAPE_PLUGIN_METADATA_CACHE)
965 #define ENABLE_NETSCAPE_PLUGIN_METADATA_CACHE 0
966 #endif
968 #if !defined(ENABLE_PURGEABLE_MEMORY)
969 #define ENABLE_PURGEABLE_MEMORY 0
970 #endif
972 #if !defined(WTF_USE_PLUGIN_HOST_PROCESS)
973 #define WTF_USE_PLUGIN_HOST_PROCESS 0
974 #endif
976 #if !defined(ENABLE_ORIENTATION_EVENTS)
977 #define ENABLE_ORIENTATION_EVENTS 0
978 #endif
980 #if !defined(ENABLE_OPCODE_STATS)
981 #define ENABLE_OPCODE_STATS 0
982 #endif
984 #if !defined(ENABLE_GLOBAL_FASTMALLOC_NEW)
985 #define ENABLE_GLOBAL_FASTMALLOC_NEW 1
986 #endif
988 #define ENABLE_DEBUG_WITH_BREAKPOINT 0
989 #define ENABLE_SAMPLING_COUNTERS 0
990 #define ENABLE_SAMPLING_FLAGS 0
991 #define ENABLE_OPCODE_SAMPLING 0
992 #define ENABLE_CODEBLOCK_SAMPLING 0
993 #if ENABLE_CODEBLOCK_SAMPLING && !ENABLE_OPCODE_SAMPLING
994 #error "CODEBLOCK_SAMPLING requires OPCODE_SAMPLING"
995 #endif
996 #if ENABLE_OPCODE_SAMPLING || ENABLE_SAMPLING_FLAGS
997 #define ENABLE_SAMPLING_THREAD 1
998 #endif
1000 #if !defined(ENABLE_GEOLOCATION)
1001 #define ENABLE_GEOLOCATION 0
1002 #endif
1004 #if !defined(ENABLE_GESTURE_RECOGNIZER)
1005 #define ENABLE_GESTURE_RECOGNIZER 0
1006 #endif
1008 #if !defined(ENABLE_NOTIFICATIONS)
1009 #define ENABLE_NOTIFICATIONS 0
1010 #endif
1012 #if WTF_PLATFORM_IOS
1013 #define ENABLE_TEXT_CARET 0
1014 #endif
1016 #if !defined(ENABLE_TEXT_CARET)
1017 #define ENABLE_TEXT_CARET 1
1018 #endif
1020 #if !defined(ENABLE_ON_FIRST_TEXTAREA_FOCUS_SELECT_ALL)
1021 #define ENABLE_ON_FIRST_TEXTAREA_FOCUS_SELECT_ALL 0
1022 #endif
1024 #if !defined(ENABLE_FULLSCREEN_API)
1025 #define ENABLE_FULLSCREEN_API 0
1026 #endif
1028 #if !defined(WTF_USE_JSVALUE64) && !defined(WTF_USE_JSVALUE32_64)
1029 #if (WTF_CPU_X86_64 && (WTF_OS_UNIX || WTF_OS_WINDOWS)) \
1030 || (WTF_CPU_IA64 && !WTF_CPU_IA64_32) \
1031 || WTF_CPU_ALPHA \
1032 || WTF_CPU_SPARC64 \
1033 || WTF_CPU_S390X \
1034 || WTF_CPU_PPC64
1035 #define WTF_USE_JSVALUE64 1
1036 #else
1037 #define WTF_USE_JSVALUE32_64 1
1038 #endif
1039 #endif /* !defined(WTF_USE_JSVALUE64) && !defined(WTF_USE_JSVALUE32_64) */
1041 #if !defined(ENABLE_REPAINT_THROTTLING)
1042 #define ENABLE_REPAINT_THROTTLING 0
1043 #endif
1045 /* Disable the JIT on versions of GCC prior to 4.1 */
1046 #if !defined(ENABLE_JIT) && WTF_COMPILER_GCC && !GCC_VERSION_AT_LEAST(4, 1, 0)
1047 #define ENABLE_JIT 0
1048 #endif
1050 /* The JIT is enabled by default on all x86, x64-64, ARM platforms. */
1051 #if !defined(ENABLE_JIT) \
1052 && (WTF_CPU_X86 || WTF_CPU_X86_64 || WTF_CPU_ARM || WTF_CPU_SPARC32 || WTF_CPU_MIPS) \
1053 && (WTF_OS_DARWIN || !WTF_COMPILER_GCC || GCC_VERSION_AT_LEAST(4, 1, 0)) \
1054 && !WTF_OS_WINCE
1055 #define ENABLE_JIT 1
1056 #endif
1058 /* Currently only implemented for JSVALUE64, only tested on WTF_PLATFORM_MAC */
1059 #if ENABLE_JIT && WTF_USE_JSVALUE64 && WTF_PLATFORM_MAC
1060 #define ENABLE_DFG_JIT 1
1061 /* Enabled with restrictions to circumvent known performance regressions. */
1062 #define ENABLE_DFG_JIT_RESTRICTIONS 1
1063 #endif
1065 /* Ensure that either the JIT or the interpreter has been enabled. */
1066 #if !defined(ENABLE_INTERPRETER) && !ENABLE_JIT
1067 #define ENABLE_INTERPRETER 1
1068 #endif
1069 #if !(ENABLE_JIT || ENABLE_INTERPRETER)
1070 #error You have to have at least one execution model enabled to build JSC
1071 #endif
1073 #if WTF_CPU_SH4 && WTF_PLATFORM_QT
1074 #define ENABLE_JIT 1
1075 #define ENABLE_YARR 1
1076 #define ENABLE_YARR_JIT 1
1077 #define WTF_USE_JIT_STUB_ARGUMENT_REGISTER 1
1078 #define ENABLE_ASSEMBLER 1
1079 #endif
1081 /* Configure the JIT */
1082 #if ENABLE_JIT
1083 #if WTF_CPU_ARM
1084 #if !defined(ENABLE_JIT_USE_SOFT_MODULO) && WTF_CPU_ARM && WTF_ARM_ARCH_VERSION >= 5
1085 #define ENABLE_JIT_USE_SOFT_MODULO 1
1086 #endif
1087 #endif
1089 #ifndef ENABLE_JIT_OPTIMIZE_CALL
1090 #define ENABLE_JIT_OPTIMIZE_CALL 1
1091 #endif
1092 #ifndef ENABLE_JIT_OPTIMIZE_NATIVE_CALL
1093 #define ENABLE_JIT_OPTIMIZE_NATIVE_CALL 1
1094 #endif
1095 #ifndef ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS
1096 #define ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS 1
1097 #endif
1098 #ifndef ENABLE_JIT_OPTIMIZE_METHOD_CALLS
1099 #define ENABLE_JIT_OPTIMIZE_METHOD_CALLS 1
1100 #endif
1101 #endif
1103 #if WTF_CPU_X86 && WTF_COMPILER_MSVC
1104 #define JSC_HOST_CALL __fastcall
1105 #elif WTF_CPU_X86 && WTF_COMPILER_GCC
1106 #define JSC_HOST_CALL __attribute__ ((fastcall))
1107 #else
1108 #define JSC_HOST_CALL
1109 #endif
1111 /* Configure the interpreter */
1112 #if WTF_COMPILER_GCC || (RVCT_VERSION_AT_LEAST(4, 0, 0, 0) && defined(__GNUC__))
1113 #define HAVE_COMPUTED_GOTO 1
1114 #endif
1115 #if HAVE_COMPUTED_GOTO && ENABLE_INTERPRETER
1116 #define ENABLE_COMPUTED_GOTO_INTERPRETER 1
1117 #endif
1119 /* Regular Expression Tracing - Set to 1 to trace RegExp's in jsc. Results dumped at exit */
1120 #define ENABLE_REGEXP_TRACING 0
1122 /* Yet Another Regex Runtime - turned on by default for JIT enabled ports. */
1123 #if WTF_PLATFORM_CHROMIUM
1124 #define ENABLE_YARR_JIT 0
1126 #elif ENABLE_YARR_JIT
1127 /* Setting this flag compares JIT results with interpreter results. */
1128 #define ENABLE_YARR_JIT_DEBUG 0
1129 #endif
1131 #if ENABLE_JIT || ENABLE_YARR_JIT
1132 #define ENABLE_ASSEMBLER 1
1133 #endif
1134 /* Setting this flag prevents the assembler from using RWX memory; this may improve
1135 security but currectly comes at a significant performance cost. */
1136 #if WTF_PLATFORM_IOS
1137 //XXX: this doesn't currently compile in the spidermonkey build
1138 #define ENABLE_ASSEMBLER_WX_EXCLUSIVE 0
1139 #endif
1141 /* Pick which allocator to use; we only need an executable allocator if the assembler is compiled in.
1142 On x86-64 we use a single fixed mmap, on other platforms we mmap on demand. */
1143 #if ENABLE_ASSEMBLER
1144 #if WTF_CPU_X86_64
1145 #define ENABLE_EXECUTABLE_ALLOCATOR_FIXED 1
1146 #else
1147 #define ENABLE_EXECUTABLE_ALLOCATOR_DEMAND 1
1148 #endif
1149 #endif
1151 #if !defined(ENABLE_PAN_SCROLLING) && WTF_OS_WINDOWS
1152 #define ENABLE_PAN_SCROLLING 1
1153 #endif
1155 #if !defined(ENABLE_SMOOTH_SCROLLING)
1156 #define ENABLE_SMOOTH_SCROLLING 0
1157 #endif
1159 #if !defined(ENABLE_WEB_ARCHIVE)
1160 #define ENABLE_WEB_ARCHIVE 0
1161 #endif
1163 /* Use the QXmlStreamReader implementation for XMLDocumentParser */
1164 /* Use the QXmlQuery implementation for XSLTProcessor */
1165 #if WTF_PLATFORM_QT
1166 #define WTF_USE_QXMLSTREAM 1
1167 #define WTF_USE_QXMLQUERY 1
1168 #endif
1170 #if WTF_PLATFORM_MAC
1171 /* Complex text framework */
1172 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
1173 #define WTF_USE_ATSUI 0
1174 #define WTF_USE_CORE_TEXT 1
1175 #else
1176 #define WTF_USE_ATSUI 1
1177 #define WTF_USE_CORE_TEXT 0
1178 #endif
1179 #endif
1181 /* Accelerated compositing */
1182 #if (WTF_PLATFORM_MAC && !defined(BUILDING_ON_TIGER)) || WTF_PLATFORM_IOS || WTF_PLATFORM_QT || (WTF_PLATFORM_WIN && !WTF_OS_WINCE &&!defined(WIN_CAIRO))
1183 #define WTF_USE_ACCELERATED_COMPOSITING 1
1184 #endif
1186 #if (WTF_PLATFORM_MAC && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)) || WTF_PLATFORM_IOS
1187 #define WTF_USE_PROTECTION_SPACE_AUTH_CALLBACK 1
1188 #endif
1190 #if WTF_PLATFORM_MAC && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
1191 #define WTF_USE_AVFOUNDATION 1
1192 #endif
1194 #if WTF_COMPILER_GCC
1195 #define WARN_UNUSED_RETURN __attribute__ ((warn_unused_result))
1196 #else
1197 #define WARN_UNUSED_RETURN
1198 #endif
1200 /* COMPILER(CLANG) - Clang */
1201 #if defined(__clang__)
1202 #define WTF_COMPILER_CLANG 1
1203 #endif
1205 #if !ENABLE_NETSCAPE_PLUGIN_API || (ENABLE_NETSCAPE_PLUGIN_API && ((WTF_OS_UNIX && (WTF_PLATFORM_QT || WTF_PLATFORM_WX)) || WTF_PLATFORM_GTK))
1206 #define ENABLE_PLUGIN_PACKAGE_SIMPLE_HASH 1
1207 #endif
1209 /* Set up a define for a common error that is intended to cause a build error -- thus the space after Error. */
1210 #define WTF_PLATFORM_CFNETWORK Error USE_macro_should_be_used_with_CFNETWORK
1212 #define ENABLE_JSC_ZOMBIES 0
1214 /* FIXME: Eventually we should enable this for all platforms and get rid of the define. */
1215 #if WTF_PLATFORM_MAC || WTF_PLATFORM_WIN || WTF_PLATFORM_QT
1216 #define WTF_USE_PLATFORM_STRATEGIES 1
1217 #endif
1219 #if WTF_PLATFORM_WIN
1220 #define WTF_USE_CROSS_PLATFORM_CONTEXT_MENUS 1
1221 #endif
1223 /* Geolocation request policy. pre-emptive policy is to acquire user permission before acquiring location.
1224 Client based implementations will have option to choose between pre-emptive and nonpre-emptive permission policy.
1225 pre-emptive permission policy is enabled by default for all client-based implementations. */
1226 #if ENABLE_CLIENT_BASED_GEOLOCATION
1227 #define WTF_USE_PREEMPT_GEOLOCATION_PERMISSION 1
1228 #endif
1230 #if WTF_CPU_ARM_THUMB2
1231 #define ENABLE_BRANCH_COMPACTION 1
1232 #endif
1234 #if !defined(ENABLE_THREADING_OPENMP) && defined(_OPENMP)
1235 #define ENABLE_THREADING_OPENMP 1
1236 #endif
1238 #if !defined(ENABLE_PARALLEL_JOBS) && !ENABLE_SINGLE_THREADED && (ENABLE_THREADING_GENERIC || ENABLE_THREADING_LIBDISPATCH || ENABLE_THREADING_OPENMP)
1239 #define ENABLE_PARALLEL_JOBS 1
1240 #endif
1242 #if ENABLE_GLIB_SUPPORT
1243 //#include "GTypedefs.h"
1244 #endif
1246 /* FIXME: This define won't be needed once #27551 is fully landed. However,
1247 since most ports try to support sub-project independence, adding new headers
1248 to WTF causes many ports to break, and so this way we can address the build
1249 breakages one port at a time. */
1250 #define WTF_USE_EXPORT_MACROS 0
1252 #if WTF_PLATFORM_QT || WTF_PLATFORM_GTK
1253 #define WTF_USE_UNIX_DOMAIN_SOCKETS 1
1254 #endif
1256 #endif /* assembler_wtf_Platform_h */