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