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)
297 /* Operating systems - low-level dependencies */
299 /* PLATFORM(DARWIN) */
300 /* Operating system level dependencies for Mac OS X / Darwin that should */
301 /* be used regardless of operating environment */
303 #define WTF_PLATFORM_DARWIN 1
304 #include <AvailabilityMacros.h>
305 #if !defined(MAC_OS_X_VERSION_10_5) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5
306 #define BUILDING_ON_TIGER 1
307 #elif !defined(MAC_OS_X_VERSION_10_6) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6
308 #define BUILDING_ON_LEOPARD 1
309 #elif !defined(MAC_OS_X_VERSION_10_7) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
310 #define BUILDING_ON_SNOW_LEOPARD 1
312 #if !defined(MAC_OS_X_VERSION_10_5) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5
313 #define TARGETING_TIGER 1
314 #elif !defined(MAC_OS_X_VERSION_10_6) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6
315 #define TARGETING_LEOPARD 1
316 #elif !defined(MAC_OS_X_VERSION_10_7) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_7
317 #define TARGETING_SNOW_LEOPARD 1
319 #include <TargetConditionals.h>
322 /* PLATFORM(WIN_OS) */
323 /* Operating system level dependencies for Windows that should be used */
324 /* regardless of operating environment */
325 #if defined(WIN32) || defined(_WIN32)
326 #define WTF_PLATFORM_WIN_OS 1
329 /* PLATFORM(WINCE) */
330 /* Operating system level dependencies for Windows CE that should be used */
331 /* regardless of operating environment */
332 /* Note that for this platform PLATFORM(WIN_OS) is also defined. */
333 #if defined(_WIN32_WCE)
334 #define WTF_PLATFORM_WINCE 1
337 /* PLATFORM(LINUX) */
338 /* Operating system level dependencies for Linux-like systems that */
339 /* should be used regardless of operating environment */
341 #define WTF_PLATFORM_LINUX 1
344 /* PLATFORM(FREEBSD) */
345 /* Operating system level dependencies for FreeBSD-like systems that */
346 /* should be used regardless of operating environment */
348 #define WTF_PLATFORM_FREEBSD 1
351 /* PLATFORM(OPENBSD) */
352 /* Operating system level dependencies for OpenBSD systems that */
353 /* should be used regardless of operating environment */
355 #define WTF_PLATFORM_OPENBSD 1
358 /* PLATFORM(SOLARIS) */
359 /* Operating system level dependencies for Solaris that should be used */
360 /* regardless of operating environment */
361 #if defined(sun) || defined(__sun)
362 #define WTF_PLATFORM_SOLARIS 1
366 /* Operating system level dependencies for OS/2 that should be used */
367 /* regardless of operating environment */
368 #if defined(OS2) || defined(__OS2__)
369 #define WTF_PLATFORM_OS2 1
372 #if defined (__SYMBIAN32__)
373 /* we are cross-compiling, it is not really windows */
374 #undef WTF_PLATFORM_WIN_OS
375 #undef WTF_PLATFORM_WIN
376 #define WTF_PLATFORM_SYMBIAN 1
380 /* PLATFORM(NETBSD) */
381 /* Operating system level dependencies for NetBSD that should be used */
382 /* regardless of operating environment */
383 #if defined(__NetBSD__)
384 #define WTF_PLATFORM_NETBSD 1
388 /* Operating system level dependencies for QNX that should be used */
389 /* regardless of operating environment */
390 #if defined(__QNXNTO__)
391 #define WTF_PLATFORM_QNX 1
395 /* Operating system level dependencies for Unix-like systems that */
396 /* should be used regardless of operating environment */
397 #if WTF_PLATFORM_DARWIN \
398 || WTF_PLATFORM_FREEBSD \
399 || WTF_PLATFORM_SYMBIAN \
400 || WTF_PLATFORM_NETBSD \
403 || defined(__unix__) \
405 || defined(__HAIKU__) \
406 || defined(__QNXNTO__) \
408 #define WTF_PLATFORM_UNIX 1
411 /* Operating environments */
413 /* PLATFORM(CHROMIUM) */
417 /* PLATFORM(HAIKU) */
420 #if defined(BUILDING_CHROMIUM__)
421 #define WTF_PLATFORM_CHROMIUM 1
422 #elif defined(BUILDING_QT__)
423 #define WTF_PLATFORM_QT 1
424 #elif defined(BUILDING_WX__)
425 #define WTF_PLATFORM_WX 1
426 #elif defined(BUILDING_GTK__)
427 #define WTF_PLATFORM_GTK 1
428 #elif defined(BUILDING_HAIKU__)
429 #define WTF_PLATFORM_HAIKU 1
430 #elif WTF_PLATFORM_DARWIN
431 #define WTF_PLATFORM_MAC 1
432 #elif WTF_PLATFORM_WIN_OS
433 #define WTF_PLATFORM_WIN 1
436 /* PLATFORM(IPHONE) */
437 #if (defined(TARGET_OS_EMBEDDED) && TARGET_OS_EMBEDDED) || (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE)
438 #define WTF_PLATFORM_IPHONE 1
441 /* PLATFORM(IPHONE_SIMULATOR) */
442 #if defined(TARGET_IPHONE_SIMULATOR) && TARGET_IPHONE_SIMULATOR
443 #define WTF_PLATFORM_IPHONE 1
444 #define WTF_PLATFORM_IPHONE_SIMULATOR 1
446 #define WTF_PLATFORM_IPHONE_SIMULATOR 0
449 #if !defined(WTF_PLATFORM_IPHONE)
450 #define WTF_PLATFORM_IPHONE 0
453 /* PLATFORM(ANDROID) */
455 #define WTF_PLATFORM_ANDROID 1
458 /* Graphics engines */
460 /* PLATFORM(CG) and PLATFORM(CI) */
461 #if WTF_PLATFORM_MAC || WTF_PLATFORM_IPHONE
462 #define WTF_PLATFORM_CG 1
464 #if WTF_PLATFORM_MAC && !WTF_PLATFORM_IPHONE
465 #define WTF_PLATFORM_CI 1
468 /* PLATFORM(SKIA) for Win/Linux, CG/CI for Mac */
469 #if WTF_PLATFORM_CHROMIUM
470 #if WTF_PLATFORM_DARWIN
471 #define WTF_PLATFORM_CG 1
472 #define WTF_PLATFORM_CI 1
473 #define WTF_USE_ATSUI 1
474 #define WTF_USE_CORE_TEXT 1
476 #define WTF_PLATFORM_SKIA 1
481 #define WTF_PLATFORM_CAIRO 1
485 /* PLATFORM(WINCE) && PLATFORM(QT)
486 We can not determine the endianess at compile time. For
487 Qt for Windows CE the endianess is specified in the
488 device specific makespec
490 #if WTF_PLATFORM_WINCE && WTF_PLATFORM_QT
492 # undef WTF_PLATFORM_BIG_ENDIAN
493 # undef WTF_PLATFORM_MIDDLE_ENDIAN
494 # if Q_BYTE_ORDER == Q_BIG_EDIAN
495 # define WTF_PLATFORM_BIG_ENDIAN 1
498 # include <ce_time.h>
501 #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)
502 #define ENABLE_JSC_MULTIPLE_THREADS 1
505 /* On Windows, use QueryPerformanceCounter by default */
506 #if WTF_PLATFORM_WIN_OS
507 #define WTF_USE_QUERY_PERFORMANCE_COUNTER 1
510 #if WTF_PLATFORM_WINCE && !WTF_PLATFORM_QT
511 #undef ENABLE_JSC_MULTIPLE_THREADS
512 #define ENABLE_JSC_MULTIPLE_THREADS 0
513 #define USE_SYSTEM_MALLOC 0
514 #define ENABLE_ICONDATABASE 0
515 #define ENABLE_JAVASCRIPT_DEBUGGER 0
516 #define ENABLE_FTPDIR 0
517 #define ENABLE_PAN_SCROLLING 0
519 #define HAVE_ACCESSIBILITY 0
521 #define NOMINMAX // Windows min and max conflict with standard macros
522 #define NOSHLWAPI // shlwapi.h not available on WinCe
524 // MSDN documentation says these functions are provided with uspce.lib. But we cannot find this file.
525 #define __usp10__ // disable "usp10.h"
527 #define _INC_ASSERT // disable "assert.h"
530 // _countof is only included in CE6; for CE5 we need to define it ourself
532 #define _countof(x) (sizeof(x) / sizeof((x)[0]))
535 #endif /* PLATFORM(WINCE) && !PLATFORM(QT) */
538 #define WTF_USE_QT4_UNICODE 1
539 #elif WTF_PLATFORM_WINCE
540 #define WTF_USE_WINCE_UNICODE 1
541 #elif WTF_PLATFORM_GTK
542 /* The GTK+ Unicode backend is configurable */
544 #define WTF_USE_ICU_UNICODE 1
547 #if WTF_PLATFORM_MAC && !WTF_PLATFORM_IPHONE
548 #define WTF_PLATFORM_CF 1
549 #define WTF_USE_PTHREADS 1
550 #define HAVE_PTHREAD_RWLOCK 1
551 #if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_TIGER) && WTF_CPU_X86_64
552 #define WTF_USE_PLUGIN_HOST_PROCESS 1
554 #if !defined(ENABLE_MAC_JAVA_BRIDGE)
555 #define ENABLE_MAC_JAVA_BRIDGE 1
557 #if !defined(ENABLE_DASHBOARD_SUPPORT)
558 #define ENABLE_DASHBOARD_SUPPORT 1
560 #define HAVE_READLINE 1
561 #define HAVE_RUNLOOP_TIMER 1
562 #endif /* PLATFORM(MAC) && !PLATFORM(IPHONE) */
564 #if WTF_PLATFORM_CHROMIUM && WTF_PLATFORM_DARWIN
565 #define WTF_PLATFORM_CF 1
566 #define WTF_USE_PTHREADS 1
567 #define HAVE_PTHREAD_RWLOCK 1
570 #if WTF_PLATFORM_QT && WTF_PLATFORM_DARWIN
571 #define WTF_PLATFORM_CF 1
574 #if WTF_PLATFORM_IPHONE
575 #define ENABLE_CONTEXT_MENUS 0
576 #define ENABLE_DRAG_SUPPORT 0
577 #define ENABLE_FTPDIR 1
578 #define ENABLE_GEOLOCATION 1
579 #define ENABLE_ICONDATABASE 0
580 #define ENABLE_INSPECTOR 0
581 #define ENABLE_MAC_JAVA_BRIDGE 0
582 #define ENABLE_NETSCAPE_PLUGIN_API 0
583 #define ENABLE_ORIENTATION_EVENTS 1
584 #define ENABLE_REPAINT_THROTTLING 1
585 #define HAVE_READLINE 1
586 #define WTF_PLATFORM_CF 1
587 #define WTF_USE_PTHREADS 1
588 #define HAVE_PTHREAD_RWLOCK 1
591 #if WTF_PLATFORM_ANDROID
592 #define WTF_USE_PTHREADS 1
593 #define WTF_PLATFORM_SGL 1
594 #define USE_SYSTEM_MALLOC 1
595 #define ENABLE_MAC_JAVA_BRIDGE 1
596 #define LOG_DISABLED 1
597 // Prevents Webkit from drawing the caret in textfields and textareas
598 // This prevents unnecessary invals.
599 #define ENABLE_TEXT_CARET 1
600 #define ENABLE_JAVASCRIPT_DEBUGGER 0
604 #define WTF_USE_WININET 1
608 #define ENABLE_ASSEMBLER 1
609 #if WTF_PLATFORM_DARWIN
610 #define WTF_PLATFORM_CF 1
616 #define WTF_USE_PTHREADS 1
617 #define HAVE_PTHREAD_RWLOCK 1
621 #if WTF_PLATFORM_HAIKU
622 #define HAVE_POSIX_MEMALIGN 1
623 #define WTF_USE_CURL 1
624 #define WTF_USE_PTHREADS 1
625 #define HAVE_PTHREAD_RWLOCK 1
626 #define USE_SYSTEM_MALLOC 1
627 #define ENABLE_NETSCAPE_PLUGIN_API 0
630 #if !defined(HAVE_ACCESSIBILITY)
631 #if WTF_PLATFORM_IPHONE || WTF_PLATFORM_MAC || WTF_PLATFORM_WIN || WTF_PLATFORM_GTK || WTF_PLATFORM_CHROMIUM
632 #define HAVE_ACCESSIBILITY 1
634 #endif /* !defined(HAVE_ACCESSIBILITY) */
636 #if WTF_PLATFORM_UNIX && !WTF_PLATFORM_SYMBIAN
637 #define HAVE_SIGNAL_H 1
640 #if !WTF_PLATFORM_WIN_OS && !WTF_PLATFORM_SOLARIS && !WTF_PLATFORM_QNX \
641 && !WTF_PLATFORM_SYMBIAN && !WTF_PLATFORM_HAIKU && !WTF_COMPILER_RVCT \
642 && !WTF_PLATFORM_ANDROID && !WTF_PLATFORM_OS2
643 #define HAVE_TM_GMTOFF 1
644 #define HAVE_TM_ZONE 1
645 #define HAVE_TIMEGM 1
648 #if WTF_PLATFORM_DARWIN
650 #define HAVE_ERRNO_H 1
651 #define HAVE_LANGINFO_H 1
653 #define HAVE_MERGESORT 1
655 #define HAVE_STRINGS_H 1
656 #define HAVE_SYS_PARAM_H 1
657 #define HAVE_SYS_TIME_H 1
658 #define HAVE_SYS_TIMEB_H 1
660 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !WTF_PLATFORM_IPHONE && !WTF_PLATFORM_QT
661 #define HAVE_MADV_FREE_REUSE 1
662 #define HAVE_MADV_FREE 1
663 #define HAVE_PTHREAD_SETNAME_NP 1
666 #if WTF_PLATFORM_IPHONE
667 #define HAVE_MADV_FREE 1
670 #elif WTF_PLATFORM_WIN_OS
672 #if WTF_PLATFORM_WINCE
673 #define HAVE_ERRNO_H 0
675 #define HAVE_SYS_TIMEB_H 1
677 #define HAVE_VIRTUALALLOC 1
679 #elif WTF_PLATFORM_SYMBIAN
681 #define HAVE_ERRNO_H 1
685 #define HAVE_SYS_TIME_H 1
686 #define HAVE_STRINGS_H 1
688 #if !WTF_COMPILER_RVCT
689 #define HAVE_SYS_PARAM_H 1
692 #elif WTF_PLATFORM_QNX
694 #define HAVE_ERRNO_H 1
697 #define HAVE_STRINGS_H 1
698 #define HAVE_SYS_PARAM_H 1
699 #define HAVE_SYS_TIME_H 1
701 #elif WTF_PLATFORM_ANDROID
703 #define HAVE_ERRNO_H 1
704 #define HAVE_LANGINFO_H 0
707 #define HAVE_STRINGS_H 1
708 #define HAVE_SYS_PARAM_H 1
709 #define HAVE_SYS_TIME_H 1
711 #elif WTF_PLATFORM_OS2
714 #define ENABLE_ASSEMBLER 1
715 #define HAVE_ERRNO_H 1
716 #define HAVE_STRINGS_H 1
717 #define HAVE_SYS_PARAM_H 1
718 #define HAVE_SYS_TIME_H 1
719 #define HAVE_SYS_TIMEB_H 1
723 /* FIXME: is this actually used or do other platforms generate their own config.h? */
725 #define HAVE_ERRNO_H 1
726 /* As long as Haiku doesn't have a complete support of locale this will be disabled. */
727 #if !WTF_PLATFORM_HAIKU
728 #define HAVE_LANGINFO_H 1
732 #define HAVE_STRINGS_H 1
733 #define HAVE_SYS_PARAM_H 1
734 #define HAVE_SYS_TIME_H 1
738 /* ENABLE macro defaults */
740 /* fastMalloc match validation allows for runtime verification that
741 new is matched by delete, fastMalloc is matched by fastFree, etc. */
742 #if !defined(ENABLE_FAST_MALLOC_MATCH_VALIDATION)
743 #define ENABLE_FAST_MALLOC_MATCH_VALIDATION 0
746 #if !defined(ENABLE_ICONDATABASE)
747 #define ENABLE_ICONDATABASE 1
750 #if !defined(ENABLE_DATABASE)
751 #define ENABLE_DATABASE 1
754 #if !defined(ENABLE_JAVASCRIPT_DEBUGGER)
755 #define ENABLE_JAVASCRIPT_DEBUGGER 1
758 #if !defined(ENABLE_FTPDIR)
759 #define ENABLE_FTPDIR 1
762 #if !defined(ENABLE_CONTEXT_MENUS)
763 #define ENABLE_CONTEXT_MENUS 1
766 #if !defined(ENABLE_DRAG_SUPPORT)
767 #define ENABLE_DRAG_SUPPORT 1
770 #if !defined(ENABLE_DASHBOARD_SUPPORT)
771 #define ENABLE_DASHBOARD_SUPPORT 0
774 #if !defined(ENABLE_INSPECTOR)
775 #define ENABLE_INSPECTOR 1
778 #if !defined(ENABLE_MAC_JAVA_BRIDGE)
779 #define ENABLE_MAC_JAVA_BRIDGE 0
782 #if !defined(ENABLE_NETSCAPE_PLUGIN_API)
783 #define ENABLE_NETSCAPE_PLUGIN_API 1
786 #if !defined(WTF_USE_PLUGIN_HOST_PROCESS)
787 #define WTF_USE_PLUGIN_HOST_PROCESS 0
790 #if !defined(ENABLE_ORIENTATION_EVENTS)
791 #define ENABLE_ORIENTATION_EVENTS 0
794 #if !defined(ENABLE_OPCODE_STATS)
795 #define ENABLE_OPCODE_STATS 0
798 #define ENABLE_SAMPLING_COUNTERS 0
799 #define ENABLE_SAMPLING_FLAGS 0
800 #define ENABLE_OPCODE_SAMPLING 0
801 #define ENABLE_CODEBLOCK_SAMPLING 0
802 #if ENABLE_CODEBLOCK_SAMPLING && !ENABLE_OPCODE_SAMPLING
803 #error "CODEBLOCK_SAMPLING requires OPCODE_SAMPLING"
805 #if ENABLE_OPCODE_SAMPLING || ENABLE_SAMPLING_FLAGS
806 #define ENABLE_SAMPLING_THREAD 1
809 #if !defined(ENABLE_GEOLOCATION)
810 #define ENABLE_GEOLOCATION 0
813 #if !defined(ENABLE_NOTIFICATIONS)
814 #define ENABLE_NOTIFICATIONS 0
817 #if !defined(ENABLE_TEXT_CARET)
818 #define ENABLE_TEXT_CARET 1
821 #if !defined(ENABLE_ON_FIRST_TEXTAREA_FOCUS_SELECT_ALL)
822 #define ENABLE_ON_FIRST_TEXTAREA_FOCUS_SELECT_ALL 0
825 #if !defined(WTF_USE_JSVALUE64) && !defined(WTF_USE_JSVALUE32) && !defined(WTF_USE_JSVALUE32_64)
826 #if (WTF_CPU_X86_64 && (WTF_PLATFORM_UNIX || WTF_PLATFORM_WIN_OS)) || WTF_CPU_IA64 || WTF_CPU_ALPHA
827 #define WTF_USE_JSVALUE64 1
828 #elif WTF_CPU_ARM || WTF_CPU_PPC64
829 #define WTF_USE_JSVALUE32 1
830 #elif WTF_PLATFORM_WIN_OS && WTF_COMPILER_MINGW
831 /* Using JSVALUE32_64 causes padding/alignement issues for JITStubArg
832 on MinGW. See https://bugs.webkit.org/show_bug.cgi?id=29268 */
833 #define WTF_USE_JSVALUE32 1
835 #define WTF_USE_JSVALUE32_64 1
837 #endif /* !defined(WTF_USE_JSVALUE64) && !defined(WTF_USE_JSVALUE32) && !defined(WTF_USE_JSVALUE32_64) */
839 #if !defined(ENABLE_REPAINT_THROTTLING)
840 #define ENABLE_REPAINT_THROTTLING 0
843 #if !defined(ENABLE_JIT)
845 /* The JIT is tested & working on x86_64 Mac */
846 #if WTF_CPU_X86_64 && WTF_PLATFORM_MAC
848 /* The JIT is tested & working on x86 Mac */
849 #elif WTF_CPU_X86 && WTF_PLATFORM_MAC
851 #define WTF_USE_JIT_STUB_ARGUMENT_VA_LIST 1
852 #elif WTF_CPU_ARM_THUMB2 && WTF_PLATFORM_IPHONE
854 /* The JIT is tested & working on x86 OS/2 */
855 #elif WTF_CPU_X86 && WTF_PLATFORM_OS2
857 /* The JIT is tested & working on x86 Windows */
858 #elif WTF_CPU_X86 && WTF_PLATFORM_WIN
863 #if WTF_CPU_X86_64 && WTF_PLATFORM_DARWIN
865 #elif WTF_CPU_X86 && WTF_PLATFORM_DARWIN
867 #define WTF_USE_JIT_STUB_ARGUMENT_VA_LIST 1
868 #elif WTF_CPU_X86 && WTF_PLATFORM_WIN_OS && WTF_COMPILER_MINGW && GCC_VERSION >= 40100
870 #define WTF_USE_JIT_STUB_ARGUMENT_VA_LIST 1
871 #elif WTF_CPU_X86 && WTF_PLATFORM_WIN_OS && WTF_COMPILER_MSVC
873 #define WTF_USE_JIT_STUB_ARGUMENT_REGISTER 1
874 #elif WTF_CPU_X86 && WTF_PLATFORM_LINUX && GCC_VERSION >= 40100
876 #define WTF_USE_JIT_STUB_ARGUMENT_VA_LIST 1
877 #elif WTF_CPU_ARM_TRADITIONAL && WTF_PLATFORM_LINUX
880 #endif /* PLATFORM(QT) */
882 #endif /* !defined(ENABLE_JIT) */
885 #ifndef ENABLE_JIT_OPTIMIZE_CALL
886 #define ENABLE_JIT_OPTIMIZE_CALL 1
888 #ifndef ENABLE_JIT_OPTIMIZE_NATIVE_CALL
889 #define ENABLE_JIT_OPTIMIZE_NATIVE_CALL 1
891 #ifndef ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS
892 #define ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS 1
894 #ifndef ENABLE_JIT_OPTIMIZE_METHOD_CALLS
895 #define ENABLE_JIT_OPTIMIZE_METHOD_CALLS 1
899 #if WTF_CPU_X86 && WTF_COMPILER_MSVC
900 #define JSC_HOST_CALL __fastcall
901 #elif WTF_CPU_X86 && WTF_COMPILER_GCC
902 #define JSC_HOST_CALL __attribute__ ((fastcall))
904 #define JSC_HOST_CALL
907 #if WTF_COMPILER_GCC && !ENABLE_JIT
908 #define HAVE_COMPUTED_GOTO 1
911 #if ENABLE_JIT && defined(COVERAGE)
912 #define WTF_USE_INTERPRETER 0
914 #define WTF_USE_INTERPRETER 1
917 /* Yet Another Regex Runtime. */
918 #if !defined(ENABLE_YARR_JIT)
920 /* YARR supports x86 & x86-64, and has been tested on Mac and Windows. */
923 || WTF_CPU_ARM_TRADITIONAL \
924 || WTF_CPU_ARM_THUMB2 \
926 #define ENABLE_YARR_JIT 1
928 #define ENABLE_YARR_JIT 0
931 #endif /* !defined(ENABLE_YARR_JIT) */
933 #if (ENABLE_JIT || ENABLE_YARR_JIT)
934 #define ENABLE_ASSEMBLER 1
936 /* Setting this flag prevents the assembler from using RWX memory; this may improve
937 security but currectly comes at a significant performance cost. */
938 #if WTF_PLATFORM_IPHONE
939 #define ENABLE_ASSEMBLER_WX_EXCLUSIVE 1
941 #define ENABLE_ASSEMBLER_WX_EXCLUSIVE 0
944 #if !defined(ENABLE_PAN_SCROLLING) && WTF_PLATFORM_WIN_OS
945 #define ENABLE_PAN_SCROLLING 1
948 /* Use the QXmlStreamReader implementation for XMLTokenizer */
949 /* Use the QXmlQuery implementation for XSLTProcessor */
951 #define WTF_USE_QXMLSTREAM 1
952 #define WTF_USE_QXMLQUERY 1
956 #define WTF_USE_FONT_FAST_PATH 1
959 /* Accelerated compositing */
961 #if !defined(BUILDING_ON_TIGER)
962 #define WTF_USE_ACCELERATED_COMPOSITING 1
966 #if WTF_PLATFORM_IPHONE
967 #define WTF_USE_ACCELERATED_COMPOSITING 1
970 /* FIXME: Defining ENABLE_3D_RENDERING here isn't really right, but it's always used with
971 with WTF_USE_ACCELERATED_COMPOSITING, and it allows the feature to be turned on and
973 //#if WTF_PLATFORM_WIN
974 //#include "QuartzCorePresent.h"
975 //#if QUARTZCORE_PRESENT
976 //#define WTF_USE_ACCELERATED_COMPOSITING 1
977 //#define ENABLE_3D_RENDERING 1
982 #define WARN_UNUSED_RETURN __attribute__ ((warn_unused_result))
984 #define WARN_UNUSED_RETURN
987 #if !ENABLE_NETSCAPE_PLUGIN_API || (ENABLE_NETSCAPE_PLUGIN_API && ((WTF_PLATFORM_UNIX && (WTF_PLATFORM_QT || WTF_PLATFORM_WX)) || WTF_PLATFORM_GTK))
988 #define ENABLE_PLUGIN_PACKAGE_SIMPLE_HASH 1
991 /* Set up a define for a common error that is intended to cause a build error -- thus the space after Error. */
992 #define WTF_PLATFORM_CFNETWORK Error USE_macro_should_be_used_with_CFNETWORK
994 #define ENABLE_JSC_ZOMBIES 0
996 #endif /* WTF_Platform_h */