2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2007-2009 Torch Mobile, Inc.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
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.
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.
27 #ifndef WTF_Platform_h
28 #define WTF_Platform_h
30 /* Either XX(YY) --> WTF_XX_YY or XX(YY) --> XX_YY, depending on XX
32 PLATFORM(YY) --> WTF_PLATFORM_YY
33 COMPILER(YY) --> WTF_COMPILER_YY
34 CPU(YY) --> WTF_CPU_YY
36 USE(YY) --> WTF_USE_YY
39 ENABLE(YY) --> ENABLE_YY
42 /* ==== PLATFORM handles OS, operating environment, graphics API, and
43 CPU. This macro will be phased out in favor of platform adaptation
44 macros, policy decision macros, and top-level port definitions. ==== */
45 //#define PLATFORM(WTF_FEATURE) (defined(WTF_PLATFORM_##WTF_FEATURE) && WTF_PLATFORM_##WTF_FEATURE)
48 /* ==== Platform adaptation macros: these describe properties of the target environment. ==== */
50 /* COMPILER() - the compiler being used to build the project */
51 //#define COMPILER(WTF_FEATURE) (defined(WTF_COMPILER_##WTF_FEATURE) && WTF_COMPILER_##WTF_FEATURE)
52 /* CPU() - the target CPU architecture */
53 //#define CPU(WTF_FEATURE) (defined(WTF_CPU_##WTF_FEATURE) && WTF_CPU_##WTF_FEATURE)
54 /* HAVE() - specific system features (headers, functions or similar) that are present or not */
55 //#define HAVE(WTF_FEATURE) (defined(HAVE_##WTF_FEATURE) && HAVE_##WTF_FEATURE)
56 /* OS() - underlying operating system; only to be used for mandated low-level services like
57 virtual memory, not to choose a GUI toolkit */
58 //#define OS(WTF_FEATURE) (defined(WTF_OS_##WTF_FEATURE) && WTF_OS_##WTF_FEATURE)
61 /* ==== Policy decision macros: these define policy choices for a particular port. ==== */
63 /* USE() - use a particular third-party library or optional OS service */
64 //#define USE(WTF_FEATURE) (defined(WTF_USE_##WTF_FEATURE) && WTF_USE_##WTF_FEATURE)
65 /* ENABLE() - turn on a specific feature of WebKit */
66 //#define ENABLE(WTF_FEATURE) (defined(ENABLE_##WTF_FEATURE) && ENABLE_##WTF_FEATURE)
70 /* ==== COMPILER() - the compiler being used to build the project ==== */
72 /* COMPILER(MSVC) Microsoft Visual C++ */
73 /* COMPILER(MSVC7) Microsoft Visual C++ v7 or lower*/
75 #define WTF_COMPILER_MSVC 1
77 #define WTF_COMPILER_MSVC7 1
81 /* COMPILER(RVCT) - ARM RealView Compilation Tools */
82 #if defined(__CC_ARM) || defined(__ARMCC__)
83 #define WTF_COMPILER_RVCT 1
86 /* COMPILER(GCC) - GNU Compiler Collection */
87 /* --gnu option of the RVCT compiler also defines __GNUC__ */
88 #if defined(__GNUC__) && !WTF_COMPILER_RVCT
89 #define WTF_COMPILER_GCC 1
90 #define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
93 /* COMPILER(MINGW) - MinGW GCC */
94 #if defined(MINGW) || defined(__MINGW32__)
95 #define WTF_COMPILER_MINGW 1
98 /* COMPILER(WINSCW) - CodeWarrior for Symbian emulator */
99 #if defined(__WINSCW__)
100 #define WTF_COMPILER_WINSCW 1
103 /* COMPILER(SUNPRO) - Sun Studio for Solaris */
104 #if defined(__SUNPRO_C) || defined(__SUNPRO_CC)
105 #define WTF_COMPILER_SUNPRO 1
109 /* ==== CPU() - the target CPU architecture ==== */
111 /* This also defines CPU(BIG_ENDIAN) or CPU(MIDDLE_ENDIAN) or neither, as appropriate. */
114 /* CPU(ALPHA) - DEC Alpha */
115 #if defined(__alpha__)
116 #define WTF_CPU_ALPHA 1
119 /* CPU(IA64) - Itanium / IA-64 */
120 #if defined(__ia64__)
121 #define WTF_CPU_IA64 1
124 /* CPU(PPC) - PowerPC 32-bit */
125 #if defined(__ppc__) \
126 || defined(__PPC__) \
127 || defined(__powerpc__) \
128 || defined(__powerpc) \
129 || defined(__POWERPC__) \
132 #define WTF_CPU_PPC 1
133 #define WTF_CPU_BIG_ENDIAN 1
136 /* CPU(PPC64) - PowerPC 64-bit */
137 #if defined(__ppc64__) \
138 || defined(__PPC64__)
139 #define WTF_CPU_PPC64 1
140 #define WTF_CPU_BIG_ENDIAN 1
143 /* CPU(SH4) - SuperH SH-4 */
145 #define WTF_CPU_SH4 1
148 /* CPU(SPARC32) - SPARC 32-bit */
149 #if defined(__sparc) && !defined(__arch64__) || defined(__sparcv8)
150 #define WTF_CPU_SPARC32 1
151 #define WTF_CPU_BIG_ENDIAN 1
154 /* CPU(SPARC64) - SPARC 64-bit */
155 #if defined(__sparc__) && defined(__arch64__) || defined (__sparcv9)
156 #define WTF_CPU_SPARC64 1
157 #define WTF_CPU_BIG_ENDIAN 1
160 /* CPU(SPARC) - any SPARC, true for CPU(SPARC32) and CPU(SPARC64) */
161 #if WTF_CPU_SPARC32 || WTF_CPU_SPARC64
162 #define WTF_CPU_SPARC
165 /* CPU(X86) - i386 / x86 32-bit */
166 #if defined(__i386__) \
168 || defined(_M_IX86) \
170 || defined(__THW_INTEL)
171 #define WTF_CPU_X86 1
174 /* CPU(X86_64) - AMD64 / Intel64 / x86_64 64-bit */
175 #if defined(__x86_64__) \
177 #define WTF_CPU_X86_64 1
180 /* CPU(ARM) - ARM, any version*/
183 #define WTF_CPU_ARM 1
185 #if defined(__ARMEB__)
186 #define WTF_CPU_BIG_ENDIAN 1
188 #elif !defined(__ARM_EABI__) \
189 && !defined(__EABI__) \
190 && !defined(__VFP_FP__) \
192 #define WTF_CPU_MIDDLE_ENDIAN 1
196 #define WTF_ARM_ARCH_AT_LEAST(N) (WTF_CPU_ARM && WTF_ARM_ARCH_VERSION >= N)
198 /* Set WTF_ARM_ARCH_VERSION */
199 #if defined(__ARM_ARCH_4__) \
200 || defined(__ARM_ARCH_4T__) \
201 || defined(__MARM_ARMV4__) \
203 #define WTF_ARM_ARCH_VERSION 4
205 #elif defined(__ARM_ARCH_5__) \
206 || defined(__ARM_ARCH_5T__) \
207 || defined(__ARM_ARCH_5E__) \
208 || defined(__ARM_ARCH_5TE__) \
209 || defined(__ARM_ARCH_5TEJ__) \
210 || defined(__MARM_ARMV5__)
211 #define WTF_ARM_ARCH_VERSION 5
213 #elif defined(__ARM_ARCH_6__) \
214 || defined(__ARM_ARCH_6J__) \
215 || defined(__ARM_ARCH_6K__) \
216 || defined(__ARM_ARCH_6Z__) \
217 || defined(__ARM_ARCH_6ZK__) \
218 || defined(__ARM_ARCH_6T2__) \
219 || defined(__ARMV6__)
220 #define WTF_ARM_ARCH_VERSION 6
222 #elif defined(__ARM_ARCH_7A__) \
223 || defined(__ARM_ARCH_7R__)
224 #define WTF_ARM_ARCH_VERSION 7
226 /* RVCT sets _TARGET_ARCH_ARM */
227 #elif defined(__TARGET_ARCH_ARM)
228 #define WTF_ARM_ARCH_VERSION __TARGET_ARCH_ARM
231 #define WTF_ARM_ARCH_VERSION 0
235 /* Set WTF_THUMB_ARCH_VERSION */
236 #if defined(__ARM_ARCH_4T__)
237 #define WTF_THUMB_ARCH_VERSION 1
239 #elif defined(__ARM_ARCH_5T__) \
240 || defined(__ARM_ARCH_5TE__) \
241 || defined(__ARM_ARCH_5TEJ__)
242 #define WTF_THUMB_ARCH_VERSION 2
244 #elif defined(__ARM_ARCH_6J__) \
245 || defined(__ARM_ARCH_6K__) \
246 || defined(__ARM_ARCH_6Z__) \
247 || defined(__ARM_ARCH_6ZK__) \
248 || defined(__ARM_ARCH_6M__)
249 #define WTF_THUMB_ARCH_VERSION 3
251 #elif defined(__ARM_ARCH_6T2__) \
252 || defined(__ARM_ARCH_7__) \
253 || defined(__ARM_ARCH_7A__) \
254 || defined(__ARM_ARCH_7R__) \
255 || defined(__ARM_ARCH_7M__)
256 #define WTF_THUMB_ARCH_VERSION 4
258 /* RVCT sets __TARGET_ARCH_THUMB */
259 #elif defined(__TARGET_ARCH_THUMB)
260 #define WTF_THUMB_ARCH_VERSION __TARGET_ARCH_THUMB
263 #define WTF_THUMB_ARCH_VERSION 0
267 /* CPU(ARMV5_OR_LOWER) - ARM instruction set v5 or earlier */
268 /* On ARMv5 and below the natural alignment is required.
269 And there are some other differences for v5 or earlier. */
270 #if !defined(ARMV5_OR_LOWER) /* && !CPU_ARM_ARCH_AT_LEAST(6) */
271 #define WTF_CPU_ARMV5_OR_LOWER 1
275 /* CPU(ARM_TRADITIONAL) - Thumb2 is not available, only traditional ARM (v4 or greater) */
276 /* CPU(ARM_THUMB2) - Thumb2 instruction set is available */
277 /* Only one of these will be defined. */
278 #if !defined(WTF_CPU_ARM_TRADITIONAL) && !defined(WTF_CPU_ARM_THUMB2)
279 # if defined(thumb2) || defined(__thumb2__) \
280 || ((defined(__thumb) || defined(__thumb__)) && WTF_THUMB_ARCH_VERSION == 4)
281 # define WTF_CPU_ARM_TRADITIONAL 1
282 # define WTF_CPU_ARM_THUMB2 0
283 # elif WTF_ARM_ARCH_AT_LEAST(4)
284 # define WTF_CPU_ARM_TRADITIONAL 1
285 # define WTF_CPU_ARM_THUMB2 0
287 # error "Not supported ARM architecture"
289 #elif WTF_CPU_ARM_TRADITIONAL && WTF_CPU_ARM_THUMB2 /* Sanity Check */
290 # error "Cannot use both of WTF_CPU_ARM_TRADITIONAL and WTF_CPU_ARM_THUMB2 platforms"
291 #endif // !defined(WTF_CPU_ARM_TRADITIONAL) && !defined(WTF_CPU_ARM_THUMB2)
295 /* CPU(AArch64) - 64-bit ARM */
296 #if defined(__aarch64__)
297 #define WTF_CPU_AARCH64 1
301 /* Operating systems - low-level dependencies */
303 /* PLATFORM(DARWIN) */
304 /* Operating system level dependencies for Mac OS X / Darwin that should */
305 /* be used regardless of operating environment */
307 #define WTF_PLATFORM_DARWIN 1
308 #include <AvailabilityMacros.h>
309 #if !defined(MAC_OS_X_VERSION_10_5) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5
310 #define BUILDING_ON_TIGER 1
311 #elif !defined(MAC_OS_X_VERSION_10_6) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6
312 #define BUILDING_ON_LEOPARD 1
313 #elif !defined(MAC_OS_X_VERSION_10_7) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
314 #define BUILDING_ON_SNOW_LEOPARD 1
316 #if !defined(MAC_OS_X_VERSION_10_5) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5
317 #define TARGETING_TIGER 1
318 #elif !defined(MAC_OS_X_VERSION_10_6) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6
319 #define TARGETING_LEOPARD 1
320 #elif !defined(MAC_OS_X_VERSION_10_7) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_7
321 #define TARGETING_SNOW_LEOPARD 1
323 #include <TargetConditionals.h>
326 /* PLATFORM(WIN_OS) */
327 /* Operating system level dependencies for Windows that should be used */
328 /* regardless of operating environment */
329 #if defined(WIN32) || defined(_WIN32)
330 #define WTF_PLATFORM_WIN_OS 1
333 /* PLATFORM(WINCE) */
334 /* Operating system level dependencies for Windows CE that should be used */
335 /* regardless of operating environment */
336 /* Note that for this platform PLATFORM(WIN_OS) is also defined. */
337 #if defined(_WIN32_WCE)
338 #define WTF_PLATFORM_WINCE 1
341 /* PLATFORM(LINUX) */
342 /* Operating system level dependencies for Linux-like systems that */
343 /* should be used regardless of operating environment */
345 #define WTF_PLATFORM_LINUX 1
348 /* PLATFORM(FREEBSD) */
349 /* Operating system level dependencies for FreeBSD-like systems that */
350 /* should be used regardless of operating environment */
352 #define WTF_PLATFORM_FREEBSD 1
355 /* PLATFORM(OPENBSD) */
356 /* Operating system level dependencies for OpenBSD systems that */
357 /* should be used regardless of operating environment */
359 #define WTF_PLATFORM_OPENBSD 1
362 /* PLATFORM(SOLARIS) */
363 /* Operating system level dependencies for Solaris that should be used */
364 /* regardless of operating environment */
365 #if defined(sun) || defined(__sun)
366 #define WTF_PLATFORM_SOLARIS 1
370 /* Operating system level dependencies for OS/2 that should be used */
371 /* regardless of operating environment */
372 #if defined(OS2) || defined(__OS2__)
373 #define WTF_PLATFORM_OS2 1
376 #if defined (__SYMBIAN32__)
377 /* we are cross-compiling, it is not really windows */
378 #undef WTF_PLATFORM_WIN_OS
379 #undef WTF_PLATFORM_WIN
380 #define WTF_PLATFORM_SYMBIAN 1
384 /* PLATFORM(NETBSD) */
385 /* Operating system level dependencies for NetBSD that should be used */
386 /* regardless of operating environment */
387 #if defined(__NetBSD__)
388 #define WTF_PLATFORM_NETBSD 1
392 /* Operating system level dependencies for QNX that should be used */
393 /* regardless of operating environment */
394 #if defined(__QNXNTO__)
395 #define WTF_PLATFORM_QNX 1
399 /* Operating system level dependencies for Unix-like systems that */
400 /* should be used regardless of operating environment */
401 #if WTF_PLATFORM_DARWIN \
402 || WTF_PLATFORM_FREEBSD \
403 || WTF_PLATFORM_SYMBIAN \
404 || WTF_PLATFORM_NETBSD \
407 || defined(__unix__) \
409 || defined(__HAIKU__) \
410 || defined(__QNXNTO__) \
412 #define WTF_PLATFORM_UNIX 1
415 /* Operating environments */
417 /* PLATFORM(CHROMIUM) */
421 /* PLATFORM(HAIKU) */
424 #if defined(BUILDING_CHROMIUM__)
425 #define WTF_PLATFORM_CHROMIUM 1
426 #elif defined(BUILDING_QT__)
427 #define WTF_PLATFORM_QT 1
428 #elif defined(BUILDING_WX__)
429 #define WTF_PLATFORM_WX 1
430 #elif defined(BUILDING_GTK__)
431 #define WTF_PLATFORM_GTK 1
432 #elif defined(BUILDING_HAIKU__)
433 #define WTF_PLATFORM_HAIKU 1
434 #elif WTF_PLATFORM_DARWIN
435 #define WTF_PLATFORM_MAC 1
436 #elif WTF_PLATFORM_WIN_OS
437 #define WTF_PLATFORM_WIN 1
440 /* PLATFORM(IPHONE) */
441 #if (defined(TARGET_OS_EMBEDDED) && TARGET_OS_EMBEDDED) || (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE)
442 #define WTF_PLATFORM_IPHONE 1
445 /* PLATFORM(IPHONE_SIMULATOR) */
446 #if defined(TARGET_IPHONE_SIMULATOR) && TARGET_IPHONE_SIMULATOR
447 #define WTF_PLATFORM_IPHONE 1
448 #define WTF_PLATFORM_IPHONE_SIMULATOR 1
450 #define WTF_PLATFORM_IPHONE_SIMULATOR 0
453 #if !defined(WTF_PLATFORM_IPHONE)
454 #define WTF_PLATFORM_IPHONE 0
457 /* PLATFORM(ANDROID) */
459 #define WTF_PLATFORM_ANDROID 1
462 /* Graphics engines */
464 /* PLATFORM(CG) and PLATFORM(CI) */
465 #if WTF_PLATFORM_MAC || WTF_PLATFORM_IPHONE
466 #define WTF_PLATFORM_CG 1
468 #if WTF_PLATFORM_MAC && !WTF_PLATFORM_IPHONE
469 #define WTF_PLATFORM_CI 1
472 /* PLATFORM(SKIA) for Win/Linux, CG/CI for Mac */
473 #if WTF_PLATFORM_CHROMIUM
474 #if WTF_PLATFORM_DARWIN
475 #define WTF_PLATFORM_CG 1
476 #define WTF_PLATFORM_CI 1
477 #define WTF_USE_ATSUI 1
478 #define WTF_USE_CORE_TEXT 1
480 #define WTF_PLATFORM_SKIA 1
485 #define WTF_PLATFORM_CAIRO 1
489 /* PLATFORM(WINCE) && PLATFORM(QT)
490 We can not determine the endianess at compile time. For
491 Qt for Windows CE the endianess is specified in the
492 device specific makespec
494 #if WTF_PLATFORM_WINCE && WTF_PLATFORM_QT
496 # undef WTF_PLATFORM_BIG_ENDIAN
497 # undef WTF_PLATFORM_MIDDLE_ENDIAN
498 # if Q_BYTE_ORDER == Q_BIG_EDIAN
499 # define WTF_PLATFORM_BIG_ENDIAN 1
502 # include <ce_time.h>
505 #if (WTF_PLATFORM_IPHONE || WTF_PLATFORM_MAC || WTF_PLATFORM_WIN || WTF_PLATFORM_OS2 || (WTF_PLATFORM_QT && WTF_PLATFORM_DARWIN && !ENABLE_SINGLE_THREADED)) && !defined(ENABLE_JSC_MULTIPLE_THREADS)
506 #define ENABLE_JSC_MULTIPLE_THREADS 1
509 /* On Windows, use QueryPerformanceCounter by default */
510 #if WTF_PLATFORM_WIN_OS
511 #define WTF_USE_QUERY_PERFORMANCE_COUNTER 1
514 #if WTF_PLATFORM_WINCE && !WTF_PLATFORM_QT
515 #undef ENABLE_JSC_MULTIPLE_THREADS
516 #define ENABLE_JSC_MULTIPLE_THREADS 0
517 #define USE_SYSTEM_MALLOC 0
518 #define ENABLE_ICONDATABASE 0
519 #define ENABLE_JAVASCRIPT_DEBUGGER 0
520 #define ENABLE_FTPDIR 0
521 #define ENABLE_PAN_SCROLLING 0
523 #define HAVE_ACCESSIBILITY 0
525 #define NOMINMAX // Windows min and max conflict with standard macros
526 #define NOSHLWAPI // shlwapi.h not available on WinCe
528 // MSDN documentation says these functions are provided with uspce.lib. But we cannot find this file.
529 #define __usp10__ // disable "usp10.h"
531 #define _INC_ASSERT // disable "assert.h"
534 // _countof is only included in CE6; for CE5 we need to define it ourself
536 #define _countof(x) (sizeof(x) / sizeof((x)[0]))
539 #endif /* PLATFORM(WINCE) && !PLATFORM(QT) */
542 #define WTF_USE_QT4_UNICODE 1
543 #elif WTF_PLATFORM_WINCE
544 #define WTF_USE_WINCE_UNICODE 1
545 #elif WTF_PLATFORM_GTK
546 /* The GTK+ Unicode backend is configurable */
548 #define WTF_USE_ICU_UNICODE 1
551 #if WTF_PLATFORM_MAC && !WTF_PLATFORM_IPHONE
552 #define WTF_PLATFORM_CF 1
553 #define WTF_USE_PTHREADS 1
554 #define HAVE_PTHREAD_RWLOCK 1
555 #if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_TIGER) && WTF_CPU_X86_64
556 #define WTF_USE_PLUGIN_HOST_PROCESS 1
558 #if !defined(ENABLE_MAC_JAVA_BRIDGE)
559 #define ENABLE_MAC_JAVA_BRIDGE 1
561 #if !defined(ENABLE_DASHBOARD_SUPPORT)
562 #define ENABLE_DASHBOARD_SUPPORT 1
564 #define HAVE_READLINE 1
565 #define HAVE_RUNLOOP_TIMER 1
566 #endif /* PLATFORM(MAC) && !PLATFORM(IPHONE) */
568 #if WTF_PLATFORM_CHROMIUM && WTF_PLATFORM_DARWIN
569 #define WTF_PLATFORM_CF 1
570 #define WTF_USE_PTHREADS 1
571 #define HAVE_PTHREAD_RWLOCK 1
574 #if WTF_PLATFORM_QT && WTF_PLATFORM_DARWIN
575 #define WTF_PLATFORM_CF 1
578 #if WTF_PLATFORM_IPHONE
579 #define ENABLE_CONTEXT_MENUS 0
580 #define ENABLE_DRAG_SUPPORT 0
581 #define ENABLE_FTPDIR 1
582 #define ENABLE_GEOLOCATION 1
583 #define ENABLE_ICONDATABASE 0
584 #define ENABLE_INSPECTOR 0
585 #define ENABLE_MAC_JAVA_BRIDGE 0
586 #define ENABLE_NETSCAPE_PLUGIN_API 0
587 #define ENABLE_ORIENTATION_EVENTS 1
588 #define ENABLE_REPAINT_THROTTLING 1
589 #define HAVE_READLINE 1
590 #define WTF_PLATFORM_CF 1
591 #define WTF_USE_PTHREADS 1
592 #define HAVE_PTHREAD_RWLOCK 1
595 #if WTF_PLATFORM_ANDROID
596 #define WTF_USE_PTHREADS 1
597 #define WTF_PLATFORM_SGL 1
598 #define USE_SYSTEM_MALLOC 1
599 #define ENABLE_MAC_JAVA_BRIDGE 1
600 #define LOG_DISABLED 1
601 // Prevents Webkit from drawing the caret in textfields and textareas
602 // This prevents unnecessary invals.
603 #define ENABLE_TEXT_CARET 1
604 #define ENABLE_JAVASCRIPT_DEBUGGER 0
608 #define WTF_USE_WININET 1
612 #define ENABLE_ASSEMBLER 1
613 #if WTF_PLATFORM_DARWIN
614 #define WTF_PLATFORM_CF 1
620 #define WTF_USE_PTHREADS 1
621 #define HAVE_PTHREAD_RWLOCK 1
625 #if WTF_PLATFORM_HAIKU
626 #define HAVE_POSIX_MEMALIGN 1
627 #define WTF_USE_CURL 1
628 #define WTF_USE_PTHREADS 1
629 #define HAVE_PTHREAD_RWLOCK 1
630 #define USE_SYSTEM_MALLOC 1
631 #define ENABLE_NETSCAPE_PLUGIN_API 0
634 #if !defined(HAVE_ACCESSIBILITY)
635 #if WTF_PLATFORM_IPHONE || WTF_PLATFORM_MAC || WTF_PLATFORM_WIN || WTF_PLATFORM_GTK || WTF_PLATFORM_CHROMIUM
636 #define HAVE_ACCESSIBILITY 1
638 #endif /* !defined(HAVE_ACCESSIBILITY) */
640 #if WTF_PLATFORM_UNIX && !WTF_PLATFORM_SYMBIAN
641 #define HAVE_SIGNAL_H 1
644 #if !WTF_PLATFORM_WIN_OS && !WTF_PLATFORM_SOLARIS && !WTF_PLATFORM_QNX \
645 && !WTF_PLATFORM_SYMBIAN && !WTF_PLATFORM_HAIKU && !WTF_COMPILER_RVCT \
646 && !WTF_PLATFORM_ANDROID && !WTF_PLATFORM_OS2
647 #define HAVE_TM_GMTOFF 1
648 #define HAVE_TM_ZONE 1
649 #define HAVE_TIMEGM 1
652 #if WTF_PLATFORM_DARWIN
654 #define HAVE_ERRNO_H 1
655 #define HAVE_LANGINFO_H 1
657 #define HAVE_MERGESORT 1
659 #define HAVE_STRINGS_H 1
660 #define HAVE_SYS_PARAM_H 1
661 #define HAVE_SYS_TIME_H 1
662 #define HAVE_SYS_TIMEB_H 1
664 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !WTF_PLATFORM_IPHONE && !WTF_PLATFORM_QT
665 #define HAVE_MADV_FREE_REUSE 1
666 #define HAVE_MADV_FREE 1
667 #define HAVE_PTHREAD_SETNAME_NP 1
670 #if WTF_PLATFORM_IPHONE
671 #define HAVE_MADV_FREE 1
674 #elif WTF_PLATFORM_WIN_OS
676 #if WTF_PLATFORM_WINCE
677 #define HAVE_ERRNO_H 0
679 #define HAVE_SYS_TIMEB_H 1
681 #define HAVE_VIRTUALALLOC 1
683 #elif WTF_PLATFORM_SYMBIAN
685 #define HAVE_ERRNO_H 1
689 #define HAVE_SYS_TIME_H 1
690 #define HAVE_STRINGS_H 1
692 #if !WTF_COMPILER_RVCT
693 #define HAVE_SYS_PARAM_H 1
696 #elif WTF_PLATFORM_QNX
698 #define HAVE_ERRNO_H 1
701 #define HAVE_STRINGS_H 1
702 #define HAVE_SYS_PARAM_H 1
703 #define HAVE_SYS_TIME_H 1
705 #elif WTF_PLATFORM_ANDROID
707 #define HAVE_ERRNO_H 1
708 #define HAVE_LANGINFO_H 0
711 #define HAVE_STRINGS_H 1
712 #define HAVE_SYS_PARAM_H 1
713 #define HAVE_SYS_TIME_H 1
715 #elif WTF_PLATFORM_OS2
718 #define ENABLE_ASSEMBLER 1
719 #define HAVE_ERRNO_H 1
720 #define HAVE_STRINGS_H 1
721 #define HAVE_SYS_PARAM_H 1
722 #define HAVE_SYS_TIME_H 1
723 #define HAVE_SYS_TIMEB_H 1
727 /* FIXME: is this actually used or do other platforms generate their own config.h? */
729 #define HAVE_ERRNO_H 1
730 /* As long as Haiku doesn't have a complete support of locale this will be disabled. */
731 #if !WTF_PLATFORM_HAIKU
732 #define HAVE_LANGINFO_H 1
736 #define HAVE_STRINGS_H 1
737 #define HAVE_SYS_PARAM_H 1
738 #define HAVE_SYS_TIME_H 1
742 /* ENABLE macro defaults */
744 /* fastMalloc match validation allows for runtime verification that
745 new is matched by delete, fastMalloc is matched by fastFree, etc. */
746 #if !defined(ENABLE_FAST_MALLOC_MATCH_VALIDATION)
747 #define ENABLE_FAST_MALLOC_MATCH_VALIDATION 0
750 #if !defined(ENABLE_ICONDATABASE)
751 #define ENABLE_ICONDATABASE 1
754 #if !defined(ENABLE_DATABASE)
755 #define ENABLE_DATABASE 1
758 #if !defined(ENABLE_JAVASCRIPT_DEBUGGER)
759 #define ENABLE_JAVASCRIPT_DEBUGGER 1
762 #if !defined(ENABLE_FTPDIR)
763 #define ENABLE_FTPDIR 1
766 #if !defined(ENABLE_CONTEXT_MENUS)
767 #define ENABLE_CONTEXT_MENUS 1
770 #if !defined(ENABLE_DRAG_SUPPORT)
771 #define ENABLE_DRAG_SUPPORT 1
774 #if !defined(ENABLE_DASHBOARD_SUPPORT)
775 #define ENABLE_DASHBOARD_SUPPORT 0
778 #if !defined(ENABLE_INSPECTOR)
779 #define ENABLE_INSPECTOR 1
782 #if !defined(ENABLE_MAC_JAVA_BRIDGE)
783 #define ENABLE_MAC_JAVA_BRIDGE 0
786 #if !defined(ENABLE_NETSCAPE_PLUGIN_API)
787 #define ENABLE_NETSCAPE_PLUGIN_API 1
790 #if !defined(WTF_USE_PLUGIN_HOST_PROCESS)
791 #define WTF_USE_PLUGIN_HOST_PROCESS 0
794 #if !defined(ENABLE_ORIENTATION_EVENTS)
795 #define ENABLE_ORIENTATION_EVENTS 0
798 #if !defined(ENABLE_OPCODE_STATS)
799 #define ENABLE_OPCODE_STATS 0
802 #define ENABLE_SAMPLING_COUNTERS 0
803 #define ENABLE_SAMPLING_FLAGS 0
804 #define ENABLE_OPCODE_SAMPLING 0
805 #define ENABLE_CODEBLOCK_SAMPLING 0
806 #if ENABLE_CODEBLOCK_SAMPLING && !ENABLE_OPCODE_SAMPLING
807 #error "CODEBLOCK_SAMPLING requires OPCODE_SAMPLING"
809 #if ENABLE_OPCODE_SAMPLING || ENABLE_SAMPLING_FLAGS
810 #define ENABLE_SAMPLING_THREAD 1
813 #if !defined(ENABLE_GEOLOCATION)
814 #define ENABLE_GEOLOCATION 0
817 #if !defined(ENABLE_NOTIFICATIONS)
818 #define ENABLE_NOTIFICATIONS 0
821 #if !defined(ENABLE_TEXT_CARET)
822 #define ENABLE_TEXT_CARET 1
825 #if !defined(ENABLE_ON_FIRST_TEXTAREA_FOCUS_SELECT_ALL)
826 #define ENABLE_ON_FIRST_TEXTAREA_FOCUS_SELECT_ALL 0
829 #if !defined(WTF_USE_JSVALUE64) && !defined(WTF_USE_JSVALUE32) && !defined(WTF_USE_JSVALUE32_64)
830 #if (WTF_CPU_X86_64 && (WTF_PLATFORM_UNIX || WTF_PLATFORM_WIN_OS)) || WTF_CPU_IA64 || WTF_CPU_ALPHA
831 #define WTF_USE_JSVALUE64 1
832 #elif WTF_CPU_ARM || WTF_CPU_PPC64
833 #define WTF_USE_JSVALUE32 1
834 #elif WTF_PLATFORM_WIN_OS && WTF_COMPILER_MINGW
835 /* Using JSVALUE32_64 causes padding/alignement issues for JITStubArg
836 on MinGW. See https://bugs.webkit.org/show_bug.cgi?id=29268 */
837 #define WTF_USE_JSVALUE32 1
839 #define WTF_USE_JSVALUE32_64 1
841 #endif /* !defined(WTF_USE_JSVALUE64) && !defined(WTF_USE_JSVALUE32) && !defined(WTF_USE_JSVALUE32_64) */
843 #if !defined(ENABLE_REPAINT_THROTTLING)
844 #define ENABLE_REPAINT_THROTTLING 0
847 #if !defined(ENABLE_JIT)
849 /* The JIT is tested & working on x86_64 Mac */
850 #if WTF_CPU_X86_64 && WTF_PLATFORM_MAC
852 /* The JIT is tested & working on x86 Mac */
853 #elif WTF_CPU_X86 && WTF_PLATFORM_MAC
855 #define WTF_USE_JIT_STUB_ARGUMENT_VA_LIST 1
856 #elif WTF_CPU_ARM_THUMB2 && WTF_PLATFORM_IPHONE
858 /* The JIT is tested & working on x86 OS/2 */
859 #elif WTF_CPU_X86 && WTF_PLATFORM_OS2
861 /* The JIT is tested & working on x86 Windows */
862 #elif WTF_CPU_X86 && WTF_PLATFORM_WIN
867 #if WTF_CPU_X86_64 && WTF_PLATFORM_DARWIN
869 #elif WTF_CPU_X86 && WTF_PLATFORM_DARWIN
871 #define WTF_USE_JIT_STUB_ARGUMENT_VA_LIST 1
872 #elif WTF_CPU_X86 && WTF_PLATFORM_WIN_OS && WTF_COMPILER_MINGW && GCC_VERSION >= 40100
874 #define WTF_USE_JIT_STUB_ARGUMENT_VA_LIST 1
875 #elif WTF_CPU_X86 && WTF_PLATFORM_WIN_OS && WTF_COMPILER_MSVC
877 #define WTF_USE_JIT_STUB_ARGUMENT_REGISTER 1
878 #elif WTF_CPU_X86 && WTF_PLATFORM_LINUX && GCC_VERSION >= 40100
880 #define WTF_USE_JIT_STUB_ARGUMENT_VA_LIST 1
881 #elif WTF_CPU_ARM_TRADITIONAL && WTF_PLATFORM_LINUX
884 #endif /* PLATFORM(QT) */
886 #endif /* !defined(ENABLE_JIT) */
889 #ifndef ENABLE_JIT_OPTIMIZE_CALL
890 #define ENABLE_JIT_OPTIMIZE_CALL 1
892 #ifndef ENABLE_JIT_OPTIMIZE_NATIVE_CALL
893 #define ENABLE_JIT_OPTIMIZE_NATIVE_CALL 1
895 #ifndef ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS
896 #define ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS 1
898 #ifndef ENABLE_JIT_OPTIMIZE_METHOD_CALLS
899 #define ENABLE_JIT_OPTIMIZE_METHOD_CALLS 1
903 #if WTF_CPU_X86 && WTF_COMPILER_MSVC
904 #define JSC_HOST_CALL __fastcall
905 #elif WTF_CPU_X86 && WTF_COMPILER_GCC
906 #define JSC_HOST_CALL __attribute__ ((fastcall))
908 #define JSC_HOST_CALL
911 #if WTF_COMPILER_GCC && !ENABLE_JIT
912 #define HAVE_COMPUTED_GOTO 1
915 #if ENABLE_JIT && defined(COVERAGE)
916 #define WTF_USE_INTERPRETER 0
918 #define WTF_USE_INTERPRETER 1
921 /* Yet Another Regex Runtime. */
922 #if !defined(ENABLE_YARR_JIT)
924 /* YARR supports x86 & x86-64, and has been tested on Mac and Windows. */
927 || WTF_CPU_ARM_TRADITIONAL \
928 || WTF_CPU_ARM_THUMB2 \
930 #define ENABLE_YARR_JIT 1
932 #define ENABLE_YARR_JIT 0
935 #endif /* !defined(ENABLE_YARR_JIT) */
937 #if (ENABLE_JIT || ENABLE_YARR_JIT)
938 #define ENABLE_ASSEMBLER 1
940 /* Setting this flag prevents the assembler from using RWX memory; this may improve
941 security but currectly comes at a significant performance cost. */
942 #if WTF_PLATFORM_IPHONE
943 #define ENABLE_ASSEMBLER_WX_EXCLUSIVE 1
945 #define ENABLE_ASSEMBLER_WX_EXCLUSIVE 0
948 #if !defined(ENABLE_PAN_SCROLLING) && WTF_PLATFORM_WIN_OS
949 #define ENABLE_PAN_SCROLLING 1
952 /* Use the QXmlStreamReader implementation for XMLTokenizer */
953 /* Use the QXmlQuery implementation for XSLTProcessor */
955 #define WTF_USE_QXMLSTREAM 1
956 #define WTF_USE_QXMLQUERY 1
960 #define WTF_USE_FONT_FAST_PATH 1
963 /* Accelerated compositing */
965 #if !defined(BUILDING_ON_TIGER)
966 #define WTF_USE_ACCELERATED_COMPOSITING 1
970 #if WTF_PLATFORM_IPHONE
971 #define WTF_USE_ACCELERATED_COMPOSITING 1
974 /* FIXME: Defining ENABLE_3D_RENDERING here isn't really right, but it's always used with
975 with WTF_USE_ACCELERATED_COMPOSITING, and it allows the feature to be turned on and
977 //#if WTF_PLATFORM_WIN
978 //#include "QuartzCorePresent.h"
979 //#if QUARTZCORE_PRESENT
980 //#define WTF_USE_ACCELERATED_COMPOSITING 1
981 //#define ENABLE_3D_RENDERING 1
986 #define WARN_UNUSED_RETURN __attribute__ ((warn_unused_result))
988 #define WARN_UNUSED_RETURN
991 #if !ENABLE_NETSCAPE_PLUGIN_API || (ENABLE_NETSCAPE_PLUGIN_API && ((WTF_PLATFORM_UNIX && (WTF_PLATFORM_QT || WTF_PLATFORM_WX)) || WTF_PLATFORM_GTK))
992 #define ENABLE_PLUGIN_PACKAGE_SIMPLE_HASH 1
995 /* Set up a define for a common error that is intended to cause a build error -- thus the space after Error. */
996 #define WTF_PLATFORM_CFNETWORK Error USE_macro_should_be_used_with_CFNETWORK
998 #define ENABLE_JSC_ZOMBIES 0
1000 #endif /* WTF_Platform_h */