Debian Codegraph @

src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h

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