• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc.  All rights reserved.
3  * Copyright (C) 2007-2009 Torch Mobile, Inc.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  *
14  * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
15  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
18  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
21  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
22  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25  */
26 
27 #ifndef WTF_Platform_h
28 #define WTF_Platform_h
29 
30 /* PLATFORM handles OS, operating environment, graphics API, and CPU */
31 #define PLATFORM(WTF_FEATURE) (defined WTF_PLATFORM_##WTF_FEATURE  && WTF_PLATFORM_##WTF_FEATURE)
32 #define COMPILER(WTF_FEATURE) (defined WTF_COMPILER_##WTF_FEATURE  && WTF_COMPILER_##WTF_FEATURE)
33 #define HAVE(WTF_FEATURE) (defined HAVE_##WTF_FEATURE  && HAVE_##WTF_FEATURE)
34 #define USE(WTF_FEATURE) (defined WTF_USE_##WTF_FEATURE  && WTF_USE_##WTF_FEATURE)
35 #define ENABLE(WTF_FEATURE) (defined ENABLE_##WTF_FEATURE  && ENABLE_##WTF_FEATURE)
36 
37 /* Operating systems - low-level dependencies */
38 
39 /* PLATFORM(DARWIN) */
40 /* Operating system level dependencies for Mac OS X / Darwin that should */
41 /* be used regardless of operating environment */
42 #ifdef __APPLE__
43 #define WTF_PLATFORM_DARWIN 1
44 #include <AvailabilityMacros.h>
45 #if !defined(MAC_OS_X_VERSION_10_5) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5
46 #define BUILDING_ON_TIGER 1
47 #elif !defined(MAC_OS_X_VERSION_10_6) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6
48 #define BUILDING_ON_LEOPARD 1
49 #endif
50 #include <TargetConditionals.h>
51 #endif
52 
53 /* PLATFORM(WIN_OS) */
54 /* Operating system level dependencies for Windows that should be used */
55 /* regardless of operating environment */
56 #if defined(WIN32) || defined(_WIN32)
57 #define WTF_PLATFORM_WIN_OS 1
58 #endif
59 
60 /* PLATFORM(WINCE) */
61 /* Operating system level dependencies for Windows CE that should be used */
62 /* regardless of operating environment */
63 /* Note that for this platform PLATFORM(WIN_OS) is also defined. */
64 #if defined(_WIN32_WCE)
65 #define WTF_PLATFORM_WINCE 1
66 #endif
67 
68 /* PLATFORM(LINUX) */
69 /* Operating system level dependencies for Linux-like systems that */
70 /* should be used regardless of operating environment */
71 #ifdef __linux__
72 #define WTF_PLATFORM_LINUX 1
73 #endif
74 
75 /* PLATFORM(FREEBSD) */
76 /* Operating system level dependencies for FreeBSD-like systems that */
77 /* should be used regardless of operating environment */
78 #ifdef __FreeBSD__
79 #define WTF_PLATFORM_FREEBSD 1
80 #endif
81 
82 /* PLATFORM(OPENBSD) */
83 /* Operating system level dependencies for OpenBSD systems that */
84 /* should be used regardless of operating environment */
85 #ifdef __OpenBSD__
86 #define WTF_PLATFORM_OPENBSD 1
87 #endif
88 
89 /* PLATFORM(SOLARIS) */
90 /* Operating system level dependencies for Solaris that should be used */
91 /* regardless of operating environment */
92 #if defined(sun) || defined(__sun)
93 #define WTF_PLATFORM_SOLARIS 1
94 #endif
95 
96 #if defined (__SYMBIAN32__)
97 /* we are cross-compiling, it is not really windows */
98 #undef WTF_PLATFORM_WIN_OS
99 #undef WTF_PLATFORM_WIN
100 #define WTF_PLATFORM_SYMBIAN 1
101 #endif
102 
103 
104 /* PLATFORM(NETBSD) */
105 /* Operating system level dependencies for NetBSD that should be used */
106 /* regardless of operating environment */
107 #if defined(__NetBSD__)
108 #define WTF_PLATFORM_NETBSD 1
109 #endif
110 
111 /* PLATFORM(UNIX) */
112 /* Operating system level dependencies for Unix-like systems that */
113 /* should be used regardless of operating environment */
114 #if   PLATFORM(DARWIN)     \
115    || PLATFORM(FREEBSD)    \
116    || PLATFORM(SYMBIAN)    \
117    || PLATFORM(NETBSD)     \
118    || defined(unix)        \
119    || defined(__unix)      \
120    || defined(__unix__)    \
121    || defined(_AIX)
122 #define WTF_PLATFORM_UNIX 1
123 #endif
124 
125 /* Operating environments */
126 
127 /* PLATFORM(CHROMIUM) */
128 /* PLATFORM(QT) */
129 /* PLATFORM(GTK) */
130 /* PLATFORM(MAC) */
131 /* PLATFORM(WIN) */
132 #if defined(BUILDING_CHROMIUM__)
133 #define WTF_PLATFORM_CHROMIUM 1
134 #elif defined(BUILDING_QT__)
135 #define WTF_PLATFORM_QT 1
136 
137 /* PLATFORM(KDE) */
138 #if defined(BUILDING_KDE__)
139 #define WTF_PLATFORM_KDE 1
140 #endif
141 
142 #elif defined(BUILDING_WX__)
143 #define WTF_PLATFORM_WX 1
144 #elif defined(BUILDING_GTK__)
145 #define WTF_PLATFORM_GTK 1
146 #elif PLATFORM(DARWIN)
147 #define WTF_PLATFORM_MAC 1
148 #elif PLATFORM(WIN_OS)
149 #define WTF_PLATFORM_WIN 1
150 #endif
151 
152 /* PLATFORM(IPHONE) */
153 #if (defined(TARGET_OS_EMBEDDED) && TARGET_OS_EMBEDDED) || (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE)
154 #define WTF_PLATFORM_IPHONE 1
155 #endif
156 
157 /* PLATFORM(IPHONE_SIMULATOR) */
158 #if defined(TARGET_IPHONE_SIMULATOR) && TARGET_IPHONE_SIMULATOR
159 #define WTF_PLATFORM_IPHONE 1
160 #define WTF_PLATFORM_IPHONE_SIMULATOR 1
161 #else
162 #define WTF_PLATFORM_IPHONE_SIMULATOR 0
163 #endif
164 
165 #if !defined(WTF_PLATFORM_IPHONE)
166 #define WTF_PLATFORM_IPHONE 0
167 #endif
168 
169 /* Graphics engines */
170 
171 /* PLATFORM(CG) and PLATFORM(CI) */
172 #if PLATFORM(MAC) || PLATFORM(IPHONE)
173 #define WTF_PLATFORM_CG 1
174 #endif
175 #if PLATFORM(MAC) && !PLATFORM(IPHONE)
176 #define WTF_PLATFORM_CI 1
177 #endif
178 
179 /* PLATFORM(SKIA) for Win/Linux, CG/CI for Mac */
180 #if PLATFORM(CHROMIUM)
181 #if PLATFORM(DARWIN)
182 #define WTF_PLATFORM_CG 1
183 #define WTF_PLATFORM_CI 1
184 #define WTF_USE_ATSUI 1
185 #else
186 #define WTF_PLATFORM_SKIA 1
187 #endif
188 #endif
189 
190 /* Makes PLATFORM(WIN) default to PLATFORM(CAIRO) */
191 /* FIXME: This should be changed from a blacklist to a whitelist */
192 #if !PLATFORM(MAC) && !PLATFORM(QT) && !PLATFORM(WX) && !PLATFORM(CHROMIUM) && !PLATFORM(WINCE)
193 #define WTF_PLATFORM_CAIRO 1
194 #endif
195 
196 #ifdef ANDROID
197 #define WTF_PLATFORM_ANDROID 1
198 #define WTF_PLATFORM_LINUX 1
199 //due to pthread code in collector.cpp, we need PLATFORM(DARWIN)
200 //#undef WTF_PLATFORM_DARWIN
201 #undef WTF_PLATFORM_MAC
202 #undef WTF_PLATFORM_WIN_OS
203 #undef WTF_PLATFORM_WIN
204 #undef WTF_PLATFORM_CG
205 #undef WTF_PLATFORM_CI
206 #undef WTF_PLATFORM_CAIRO
207 #define WTF_USE_PTHREADS 1
208 
209 #define WTF_PLATFORM_SGL 1
210 #define WTF_PLATFORM_UNIX 1
211 
212 #define USE_SYSTEM_MALLOC 1
213 #define ENABLE_MAC_JAVA_BRIDGE 1
214 #define LOG_DISABLED 1
215 // Prevents Webkit from drawing the caret in textfields and textareas
216 // This prevents unnecessary invals.
217 #define ENABLE_TEXT_CARET 1
218 #define ENABLE_JAVASCRIPT_DEBUGGER 0
219 #endif // ANDROID
220 
221 /* CPU */
222 
223 /* PLATFORM(PPC) */
224 #if   defined(__ppc__)     \
225    || defined(__PPC__)     \
226    || defined(__powerpc__) \
227    || defined(__powerpc)   \
228    || defined(__POWERPC__) \
229    || defined(_M_PPC)      \
230    || defined(__PPC)
231 #define WTF_PLATFORM_PPC 1
232 #define WTF_PLATFORM_BIG_ENDIAN 1
233 #endif
234 
235 /* PLATFORM(PPC64) */
236 #if   defined(__ppc64__) \
237    || defined(__PPC64__)
238 #define WTF_PLATFORM_PPC64 1
239 #define WTF_PLATFORM_BIG_ENDIAN 1
240 #endif
241 
242 /* PLATFORM(ARM) */
243 #if   defined(arm) \
244    || defined(__arm__)
245 #define WTF_PLATFORM_ARM 1
246 #if defined(__ARMEB__)
247 #define WTF_PLATFORM_BIG_ENDIAN 1
248 #elif !defined(__ARM_EABI__) && !defined(__EABI__) && !defined(__VFP_FP__)
249 #if !defined(ANDROID)
250 #define WTF_PLATFORM_MIDDLE_ENDIAN 1
251 #endif
252 #endif
253 #if !defined(__ARM_EABI__) && !defined(__EABI__)
254 #define WTF_PLATFORM_FORCE_PACK 1
255 #endif
256 #define ARM_ARCH_VERSION 3
257 #if defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__)
258 #undef ARM_ARCH_VERSION
259 #define ARM_ARCH_VERSION 4
260 #endif
261 #if defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5T__) \
262         || defined(__ARM_ARCH_5E__) || defined(__ARM_ARCH_5TE__) \
263         || defined(__ARM_ARCH_5TEJ__)
264 #undef ARM_ARCH_VERSION
265 #define ARM_ARCH_VERSION 5
266 #endif
267 #if defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) \
268      || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) \
269      || defined(__ARM_ARCH_6ZK__)
270 #undef ARM_ARCH_VERSION
271 #define ARM_ARCH_VERSION 6
272 #endif
273 #if defined(__ARM_ARCH_7A__)
274 #undef ARM_ARCH_VERSION
275 #define ARM_ARCH_VERSION 7
276 #endif
277 #endif /* ARM */
278 #define PLATFORM_ARM_ARCH(N) (PLATFORM(ARM) && ARM_ARCH_VERSION >= N)
279 
280 /* PLATFORM(X86) */
281 #if   defined(__i386__) \
282    || defined(i386)     \
283    || defined(_M_IX86)  \
284    || defined(_X86_)    \
285    || defined(__THW_INTEL)
286 #define WTF_PLATFORM_X86 1
287 #endif
288 
289 /* PLATFORM(X86_64) */
290 #if   defined(__x86_64__) \
291    || defined(_M_X64)
292 #define WTF_PLATFORM_X86_64 1
293 #endif
294 
295 /* PLATFORM(SH4) */
296 #if defined(__SH4__)
297 #define WTF_PLATFORM_SH4 1
298 #endif
299 
300 /* PLATFORM(SPARC64) */
301 #if defined(__sparc64__)
302 #define WTF_PLATFORM_SPARC64 1
303 #define WTF_PLATFORM_BIG_ENDIAN 1
304 #endif
305 
306 /* PLATFORM(WINCE) && PLATFORM(QT)
307    We can not determine the endianess at compile time. For
308    Qt for Windows CE the endianess is specified in the
309    device specific makespec
310 */
311 #if PLATFORM(WINCE) && PLATFORM(QT)
312 #   include <QtGlobal>
313 #   undef WTF_PLATFORM_BIG_ENDIAN
314 #   undef WTF_PLATFORM_MIDDLE_ENDIAN
315 #   if Q_BYTE_ORDER == Q_BIG_EDIAN
316 #       define WTF_PLATFORM_BIG_ENDIAN 1
317 #   endif
318 #endif
319 
320 /* Compiler */
321 
322 /* COMPILER(MSVC) */
323 #if defined(_MSC_VER)
324 #define WTF_COMPILER_MSVC 1
325 #if _MSC_VER < 1400
326 #define WTF_COMPILER_MSVC7 1
327 #endif
328 #endif
329 
330 /* COMPILER(RVCT) */
331 #if defined(__CC_ARM) || defined(__ARMCC__)
332 #define WTF_COMPILER_RVCT 1
333 #endif
334 
335 /* COMPILER(GCC) */
336 /* --gnu option of the RVCT compiler also defines __GNUC__ */
337 #if defined(__GNUC__) && !COMPILER(RVCT)
338 #define WTF_COMPILER_GCC 1
339 #define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
340 #endif
341 
342 /* COMPILER(MINGW) */
343 #if defined(MINGW) || defined(__MINGW32__)
344 #define WTF_COMPILER_MINGW 1
345 #endif
346 
347 /* COMPILER(BORLAND) */
348 /* not really fully supported - is this relevant any more? */
349 #if defined(__BORLANDC__)
350 #define WTF_COMPILER_BORLAND 1
351 #endif
352 
353 /* COMPILER(CYGWIN) */
354 /* not really fully supported - is this relevant any more? */
355 #if defined(__CYGWIN__)
356 #define WTF_COMPILER_CYGWIN 1
357 #endif
358 
359 /* COMPILER(WINSCW) */
360 #if defined(__WINSCW__)
361 #define WTF_COMPILER_WINSCW 1
362 #endif
363 
364 #if (PLATFORM(IPHONE) || PLATFORM(MAC) || PLATFORM(WIN)) && !defined(ENABLE_JSC_MULTIPLE_THREADS)
365 #define ENABLE_JSC_MULTIPLE_THREADS 1
366 #endif
367 
368 /* On Windows, use QueryPerformanceCounter by default */
369 #if PLATFORM(WIN_OS)
370 #define WTF_USE_QUERY_PERFORMANCE_COUNTER  1
371 #endif
372 
373 #if PLATFORM(WINCE) && !PLATFORM(QT)
374 #undef ENABLE_JSC_MULTIPLE_THREADS
375 #define ENABLE_JSC_MULTIPLE_THREADS        0
376 #define USE_SYSTEM_MALLOC                  0
377 #define ENABLE_ICONDATABASE                0
378 #define ENABLE_JAVASCRIPT_DEBUGGER         0
379 #define ENABLE_FTPDIR                      0
380 #define ENABLE_PAN_SCROLLING               0
381 #define ENABLE_WML                         1
382 #define HAVE_ACCESSIBILITY                 0
383 
384 #define NOMINMAX       // Windows min and max conflict with standard macros
385 #define NOSHLWAPI      // shlwapi.h not available on WinCe
386 
387 // MSDN documentation says these functions are provided with uspce.lib.  But we cannot find this file.
388 #define __usp10__      // disable "usp10.h"
389 
390 #define _INC_ASSERT    // disable "assert.h"
391 #define assert(x)
392 
393 // _countof is only included in CE6; for CE5 we need to define it ourself
394 #ifndef _countof
395 #define _countof(x) (sizeof(x) / sizeof((x)[0]))
396 #endif
397 
398 #endif  /* PLATFORM(WINCE) && !PLATFORM(QT) */
399 
400 /* for Unicode, KDE uses Qt */
401 #if PLATFORM(KDE) || PLATFORM(QT)
402 #define WTF_USE_QT4_UNICODE 1
403 #elif PLATFORM(WINCE)
404 #define WTF_USE_WINCE_UNICODE 1
405 #elif PLATFORM(GTK)
406 /* The GTK+ Unicode backend is configurable */
407 #else
408 #define WTF_USE_ICU_UNICODE 1
409 #endif
410 
411 #if PLATFORM(MAC) && !PLATFORM(IPHONE)
412 #define WTF_PLATFORM_CF 1
413 #define WTF_USE_PTHREADS 1
414 #if !defined(ENABLE_MAC_JAVA_BRIDGE)
415 #define ENABLE_MAC_JAVA_BRIDGE 1
416 #endif
417 #if !defined(ENABLE_DASHBOARD_SUPPORT)
418 #define ENABLE_DASHBOARD_SUPPORT 1
419 #endif
420 #define HAVE_READLINE 1
421 #define HAVE_RUNLOOP_TIMER 1
422 #define HAVE_PTHREAD_RWLOCK 1
423 #endif
424 
425 #if PLATFORM(CHROMIUM) && PLATFORM(DARWIN)
426 #define WTF_PLATFORM_CF 1
427 #define WTF_USE_PTHREADS 1
428 #endif
429 
430 #if PLATFORM(IPHONE)
431 #define WTF_PLATFORM_CF 1
432 #define WTF_USE_PTHREADS 1
433 #define ENABLE_FTPDIR 1
434 #define ENABLE_MAC_JAVA_BRIDGE 0
435 #define ENABLE_ICONDATABASE 0
436 #define ENABLE_GEOLOCATION 1
437 #define ENABLE_NETSCAPE_PLUGIN_API 0
438 #define HAVE_READLINE 1
439 #define ENABLE_REPAINT_THROTTLING 1
440 #endif
441 
442 #if PLATFORM(WIN)
443 #define WTF_USE_WININET 1
444 #endif
445 
446 #if PLATFORM(WX)
447 #define ENABLE_ASSEMBLER 1
448 #define WTF_USE_CURL 1
449 #define WTF_USE_PTHREADS 1
450 #endif
451 
452 #if PLATFORM(GTK)
453 #if HAVE(PTHREAD_H)
454 #define WTF_USE_PTHREADS 1
455 #endif
456 #endif
457 
458 #if !defined(HAVE_ACCESSIBILITY)
459 #if PLATFORM(IPHONE) || PLATFORM(MAC) || PLATFORM(WIN) || PLATFORM(GTK) || PLATFORM(CHROMIUM)
460 #define HAVE_ACCESSIBILITY 1
461 #endif
462 #endif /* !defined(HAVE_ACCESSIBILITY) */
463 
464 #if PLATFORM(UNIX) && !PLATFORM(SYMBIAN)
465 #define HAVE_SIGNAL_H 1
466 #endif
467 
468 #if !PLATFORM(WIN_OS) && !PLATFORM(SOLARIS) && !PLATFORM(SYMBIAN) && !COMPILER(RVCT) && !PLATFORM(ANDROID)
469 #define HAVE_TM_GMTOFF 1
470 #define HAVE_TM_ZONE 1
471 #define HAVE_TIMEGM 1
472 #endif
473 
474 #if PLATFORM(DARWIN)
475 
476 #define HAVE_ERRNO_H 1
477 #define HAVE_LANGINFO_H 1
478 #define HAVE_MMAP 1
479 #define HAVE_MERGESORT 1
480 #define HAVE_SBRK 1
481 #define HAVE_STRINGS_H 1
482 #define HAVE_SYS_PARAM_H 1
483 #define HAVE_SYS_TIME_H 1
484 #define HAVE_SYS_TIMEB_H 1
485 
486 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !PLATFORM(IPHONE)
487 #define HAVE_MADV_FREE_REUSE 1
488 #define HAVE_MADV_FREE 1
489 #endif
490 
491 #if PLATFORM(IPHONE)
492 #define HAVE_MADV_FREE 1
493 #endif
494 
495 #elif PLATFORM(WIN_OS)
496 
497 #define HAVE_FLOAT_H 1
498 #if PLATFORM(WINCE)
499 #define HAVE_ERRNO_H 0
500 #else
501 #define HAVE_SYS_TIMEB_H 1
502 #endif
503 #define HAVE_VIRTUALALLOC 1
504 
505 #elif PLATFORM(SYMBIAN)
506 
507 #define HAVE_ERRNO_H 1
508 #define HAVE_MMAP 0
509 #define HAVE_SBRK 1
510 
511 #define HAVE_SYS_TIME_H 1
512 #define HAVE_STRINGS_H 1
513 
514 #if !COMPILER(RVCT)
515 #define HAVE_SYS_PARAM_H 1
516 #endif
517 
518 #elif PLATFORM(ANDROID)
519 
520 #define HAVE_ERRNO_H 1
521 #define HAVE_LANGINFO_H 0
522 #define HAVE_MMAP 1
523 #define HAVE_SBRK 1
524 #define HAVE_STRINGS_H 1
525 #define HAVE_SYS_PARAM_H 1
526 #define HAVE_SYS_TIME_H 1
527 
528 #else
529 
530 /* FIXME: is this actually used or do other platforms generate their own config.h? */
531 
532 #define HAVE_ERRNO_H 1
533 #define HAVE_LANGINFO_H 1
534 #define HAVE_MMAP 1
535 #define HAVE_SBRK 1
536 #define HAVE_STRINGS_H 1
537 #define HAVE_SYS_PARAM_H 1
538 #define HAVE_SYS_TIME_H 1
539 
540 #endif
541 
542 /* ENABLE macro defaults */
543 
544 /* fastMalloc match validation allows for runtime verification that
545    new is matched by delete, fastMalloc is matched by fastFree, etc. */
546 #if !defined(ENABLE_FAST_MALLOC_MATCH_VALIDATION)
547 #define ENABLE_FAST_MALLOC_MATCH_VALIDATION 0
548 #endif
549 
550 #if !defined(ENABLE_ICONDATABASE)
551 #define ENABLE_ICONDATABASE 1
552 #endif
553 
554 #if !defined(ENABLE_DATABASE)
555 #define ENABLE_DATABASE 1
556 #endif
557 
558 #if !defined(ENABLE_JAVASCRIPT_DEBUGGER)
559 #define ENABLE_JAVASCRIPT_DEBUGGER 1
560 #endif
561 
562 #if !defined(ENABLE_FTPDIR)
563 #define ENABLE_FTPDIR 1
564 #endif
565 
566 #if !defined(ENABLE_DASHBOARD_SUPPORT)
567 #define ENABLE_DASHBOARD_SUPPORT 0
568 #endif
569 
570 #if !defined(ENABLE_MAC_JAVA_BRIDGE)
571 #define ENABLE_MAC_JAVA_BRIDGE 0
572 #endif
573 
574 #if !defined(ENABLE_NETSCAPE_PLUGIN_API)
575 #define ENABLE_NETSCAPE_PLUGIN_API 1
576 #endif
577 
578 #if !defined(ENABLE_OPCODE_STATS)
579 #define ENABLE_OPCODE_STATS 0
580 #endif
581 
582 #define ENABLE_SAMPLING_COUNTERS 0
583 #define ENABLE_SAMPLING_FLAGS 0
584 #define ENABLE_OPCODE_SAMPLING 0
585 #define ENABLE_CODEBLOCK_SAMPLING 0
586 #if ENABLE(CODEBLOCK_SAMPLING) && !ENABLE(OPCODE_SAMPLING)
587 #error "CODEBLOCK_SAMPLING requires OPCODE_SAMPLING"
588 #endif
589 #if ENABLE(OPCODE_SAMPLING) || ENABLE(SAMPLING_FLAGS)
590 #define ENABLE_SAMPLING_THREAD 1
591 #endif
592 
593 #if !defined(ENABLE_GEOLOCATION)
594 #define ENABLE_GEOLOCATION 0
595 #endif
596 
597 #if !defined(ENABLE_TEXT_CARET)
598 #define ENABLE_TEXT_CARET 1
599 #endif
600 
601 // ANDROID addition: allow web archive to be disabled
602 #if !defined(ENABLE_ARCHIVE)
603 #define ENABLE_ARCHIVE 1
604 #endif
605 
606 #if !defined(ENABLE_ON_FIRST_TEXTAREA_FOCUS_SELECT_ALL)
607 #define ENABLE_ON_FIRST_TEXTAREA_FOCUS_SELECT_ALL 0
608 #endif
609 
610 #if !defined(WTF_USE_JSVALUE64) && !defined(WTF_USE_JSVALUE32) && !defined(WTF_USE_JSVALUE32_64)
611 #if PLATFORM(X86_64) && (PLATFORM(MAC) || (PLATFORM(LINUX) && !PLATFORM(QT)))
612 #define WTF_USE_JSVALUE64 1
613 #elif PLATFORM(PPC64) || PLATFORM(QT) /* All Qt layout tests crash in JSVALUE32_64 mode. */
614 #define WTF_USE_JSVALUE32 1
615 #else
616 #define WTF_USE_JSVALUE32_64 1
617 #endif
618 #endif /* !defined(WTF_USE_JSVALUE64) && !defined(WTF_USE_JSVALUE32) && !defined(WTF_USE_JSVALUE32_64) */
619 
620 #if !defined(ENABLE_REPAINT_THROTTLING)
621 #define ENABLE_REPAINT_THROTTLING 0
622 #endif
623 
624 #if !defined(ENABLE_JIT)
625 
626 /* The JIT is tested & working on x86_64 Mac */
627 #if PLATFORM(X86_64) && PLATFORM(MAC)
628     #define ENABLE_JIT 1
629 /* The JIT is tested & working on x86 Mac */
630 #elif PLATFORM(X86) && PLATFORM(MAC)
631     #define ENABLE_JIT 1
632     #define WTF_USE_JIT_STUB_ARGUMENT_VA_LIST 1
633 #elif PLATFORM_ARM_ARCH(7) && PLATFORM(IPHONE)
634     /* Under development, temporarily disabled until 16Mb link range limit in assembler is fixed. */
635     #define ENABLE_JIT 0
636     #define ENABLE_JIT_OPTIMIZE_NATIVE_CALL 0
637 /* The JIT is tested & working on x86 Windows */
638 #elif PLATFORM(X86) && PLATFORM(WIN)
639     #define ENABLE_JIT 1
640 #endif
641 
642 #if PLATFORM(X86) && PLATFORM(QT)
643 #if PLATFORM(WIN_OS) && COMPILER(MINGW) && GCC_VERSION >= 40100
644     #define ENABLE_JIT 1
645     #define WTF_USE_JIT_STUB_ARGUMENT_VA_LIST 1
646 #elif PLATFORM(WIN_OS) && COMPILER(MSVC)
647     #define ENABLE_JIT 1
648     #define WTF_USE_JIT_STUB_ARGUMENT_REGISTER 1
649 #elif PLATFORM(LINUX) && GCC_VERSION >= 40100
650     #define ENABLE_JIT 1
651     #define WTF_USE_JIT_STUB_ARGUMENT_VA_LIST 1
652 #endif
653 #endif /* PLATFORM(QT) && PLATFORM(X86) */
654 
655 #endif /* !defined(ENABLE_JIT) */
656 
657 #if ENABLE(JIT)
658 #ifndef ENABLE_JIT_OPTIMIZE_CALL
659 #define ENABLE_JIT_OPTIMIZE_CALL 1
660 #endif
661 #ifndef ENABLE_JIT_OPTIMIZE_NATIVE_CALL
662 #define ENABLE_JIT_OPTIMIZE_NATIVE_CALL 1
663 #endif
664 #ifndef ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS
665 #define ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS 1
666 #endif
667 #ifndef ENABLE_JIT_OPTIMIZE_METHOD_CALLS
668 #define ENABLE_JIT_OPTIMIZE_METHOD_CALLS 1
669 #endif
670 #endif
671 
672 #if PLATFORM(X86) && COMPILER(MSVC)
673 #define JSC_HOST_CALL __fastcall
674 #elif PLATFORM(X86) && COMPILER(GCC)
675 #define JSC_HOST_CALL __attribute__ ((fastcall))
676 #else
677 #define JSC_HOST_CALL
678 #endif
679 
680 #if COMPILER(GCC) && !ENABLE(JIT)
681 #define HAVE_COMPUTED_GOTO 1
682 #endif
683 
684 #if ENABLE(JIT) && defined(COVERAGE)
685     #define WTF_USE_INTERPRETER 0
686 #else
687     #define WTF_USE_INTERPRETER 1
688 #endif
689 
690 /* Yet Another Regex Runtime. */
691 #if !defined(ENABLE_YARR_JIT)
692 
693 /* YARR supports x86 & x86-64, and has been tested on Mac and Windows. */
694 #if (PLATFORM(X86) && PLATFORM(MAC)) \
695  || (PLATFORM(X86_64) && PLATFORM(MAC)) \
696  /* Under development, temporarily disabled until 16Mb link range limit in assembler is fixed. */ \
697  || (PLATFORM_ARM_ARCH(7) && PLATFORM(IPHONE) && 0) \
698  || (PLATFORM(X86) && PLATFORM(WIN))
699 #define ENABLE_YARR 1
700 #define ENABLE_YARR_JIT 1
701 #endif
702 
703 #if PLATFORM(X86) && PLATFORM(QT)
704 #if (PLATFORM(WIN_OS) && COMPILER(MINGW) && GCC_VERSION >= 40100) \
705  || (PLATFORM(WIN_OS) && COMPILER(MSVC)) \
706  || (PLATFORM(LINUX) && GCC_VERSION >= 40100)
707 #define ENABLE_YARR 1
708 #define ENABLE_YARR_JIT 1
709 #endif
710 #endif
711 
712 #endif /* !defined(ENABLE_YARR_JIT) */
713 
714 /* Sanity Check */
715 #if ENABLE(YARR_JIT) && !ENABLE(YARR)
716 #error "YARR_JIT requires YARR"
717 #endif
718 
719 #if ENABLE(JIT) || ENABLE(YARR_JIT)
720 #define ENABLE_ASSEMBLER 1
721 #endif
722 /* Setting this flag prevents the assembler from using RWX memory; this may improve
723    security but currectly comes at a significant performance cost. */
724 #if PLATFORM(IPHONE)
725 #define ENABLE_ASSEMBLER_WX_EXCLUSIVE 1
726 #else
727 #define ENABLE_ASSEMBLER_WX_EXCLUSIVE 0
728 #endif
729 
730 #if !defined(ENABLE_PAN_SCROLLING) && PLATFORM(WIN_OS)
731 #define ENABLE_PAN_SCROLLING 1
732 #endif
733 
734 #if !defined(ENABLE_ACTIVEX_TYPE_CONVERSION_WMPLAYER)
735 #define ENABLE_ACTIVEX_TYPE_CONVERSION_WMPLAYER 1
736 #endif
737 
738 /* Use the QtXmlStreamReader implementation for XMLTokenizer */
739 #if PLATFORM(QT)
740 #if !ENABLE(XSLT)
741 #define WTF_USE_QXMLSTREAM 1
742 #endif
743 #endif
744 
745 #if !PLATFORM(QT)
746 #define WTF_USE_FONT_FAST_PATH 1
747 #endif
748 
749 /* Accelerated compositing */
750 #if PLATFORM(MAC)
751 #if !defined(BUILDING_ON_TIGER)
752 #define WTF_USE_ACCELERATED_COMPOSITING 1
753 #endif
754 #endif
755 
756 #if PLATFORM(IPHONE)
757 #define WTF_USE_ACCELERATED_COMPOSITING 1
758 #endif
759 
760 #endif /* WTF_Platform_h */
761