1 | /* |
2 | * Copyright (C) 2006, 2007, 2008, 2009, 2013 Apple Inc. All rights reserved. |
3 | * Copyright (C) 2007-2009 Torch Mobile, Inc. |
4 | * Copyright (C) 2010, 2011 Research In Motion Limited. All rights reserved. |
5 | * Copyright (C) 2018 The Qt Company Ltd. |
6 | * |
7 | * Redistribution and use in source and binary forms, with or without |
8 | * modification, are permitted provided that the following conditions |
9 | * are met: |
10 | * 1. Redistributions of source code must retain the above copyright |
11 | * notice, this list of conditions and the following disclaimer. |
12 | * 2. Redistributions in binary form must reproduce the above copyright |
13 | * notice, this list of conditions and the following disclaimer in the |
14 | * documentation and/or other materials provided with the distribution. |
15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR |
20 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
24 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | */ |
28 | |
29 | #ifndef WTF_Platform_h |
30 | #define WTF_Platform_h |
31 | |
32 | #if defined(__cplusplus) |
33 | #include <private/qv4global_p.h> |
34 | #endif |
35 | |
36 | /* Include compiler specific macros */ |
37 | #include <wtf/Compiler.h> |
38 | |
39 | /* ==== PLATFORM handles OS, operating environment, graphics API, and |
40 | CPU. This macro will be phased out in favor of platform adaptation |
41 | macros, policy decision macros, and top-level port definitions. ==== */ |
42 | #define PLATFORM(WTF_FEATURE) WTF_PLATFORM_##WTF_FEATURE |
43 | |
44 | |
45 | /* ==== Platform adaptation macros: these describe properties of the target environment. ==== */ |
46 | |
47 | /* CPU() - the target CPU architecture */ |
48 | #define CPU(WTF_FEATURE) WTF_CPU_##WTF_FEATURE |
49 | /* HAVE() - specific system features (headers, functions or similar) that are present or not */ |
50 | #define HAVE(WTF_FEATURE) HAVE_##WTF_FEATURE |
51 | /* OS() - underlying operating system; only to be used for mandated low-level services like |
52 | virtual memory, not to choose a GUI toolkit */ |
53 | #define OS(WTF_FEATURE) WTF_OS_##WTF_FEATURE |
54 | |
55 | |
56 | /* ==== Policy decision macros: these define policy choices for a particular port. ==== */ |
57 | |
58 | /* USE() - use a particular third-party library or optional OS service */ |
59 | #define USE(WTF_FEATURE) WTF_USE_##WTF_FEATURE |
60 | /* ENABLE() - turn on a specific feature of WebKit */ |
61 | #define ENABLE(WTF_FEATURE) ENABLE_##WTF_FEATURE |
62 | |
63 | |
64 | /* ==== CPU() - the target CPU architecture ==== */ |
65 | |
66 | /* This also defines CPU(BIG_ENDIAN) or CPU(MIDDLE_ENDIAN) or neither, as appropriate. */ |
67 | |
68 | /* CPU(ALPHA) - DEC Alpha */ |
69 | #if defined(__alpha__) |
70 | #define WTF_CPU_ALPHA 1 |
71 | #endif |
72 | |
73 | /* CPU(IA64) - Itanium / IA-64 */ |
74 | #if defined(__ia64__) |
75 | #define WTF_CPU_IA64 1 |
76 | /* 32-bit mode on Itanium */ |
77 | #if !defined(__LP64__) |
78 | #define WTF_CPU_IA64_32 1 |
79 | #endif |
80 | #endif |
81 | |
82 | /* CPU(MIPS) - MIPS 32-bit */ |
83 | /* Note: Only O32 ABI is tested, so we enable it for O32 ABI for now. */ |
84 | #if (defined(mips) || defined(__mips__) || defined(MIPS) || defined(_MIPS_)) \ |
85 | && defined(_ABIO32) |
86 | #define WTF_CPU_MIPS 1 |
87 | #if defined(__MIPSEB__) |
88 | #define WTF_CPU_BIG_ENDIAN 1 |
89 | #endif |
90 | #define WTF_MIPS_PIC (defined __PIC__) |
91 | #define WTF_MIPS_ARCH __mips |
92 | #define WTF_MIPS_ISA(v) (defined WTF_MIPS_ARCH && WTF_MIPS_ARCH == v) |
93 | #define WTF_MIPS_ISA_AT_LEAST(v) (defined WTF_MIPS_ARCH && WTF_MIPS_ARCH >= v) |
94 | #define WTF_MIPS_ARCH_REV __mips_isa_rev |
95 | #define WTF_MIPS_ISA_REV(v) (defined WTF_MIPS_ARCH_REV && WTF_MIPS_ARCH_REV == v) |
96 | #define WTF_MIPS_DOUBLE_FLOAT (defined __mips_hard_float && !defined __mips_single_float) |
97 | #define WTF_MIPS_FP64 (defined __mips_fpr && __mips_fpr == 64) |
98 | /* MIPS requires allocators to use aligned memory */ |
99 | #define WTF_USE_ARENA_ALLOC_ALIGNMENT_INTEGER 1 |
100 | #endif /* MIPS */ |
101 | |
102 | /* CPU(PPC) - PowerPC 32-bit */ |
103 | #if defined(__ppc__) \ |
104 | || defined(__PPC__) \ |
105 | || defined(__powerpc__) \ |
106 | || defined(__powerpc) \ |
107 | || defined(__POWERPC__) \ |
108 | || defined(_M_PPC) \ |
109 | || defined(__PPC) |
110 | #define WTF_CPU_PPC 1 |
111 | #define WTF_CPU_BIG_ENDIAN 1 |
112 | #endif |
113 | |
114 | /* CPU(PPC64) - PowerPC 64-bit */ |
115 | #if defined(__ppc64__) \ |
116 | || defined(__PPC64__) |
117 | #define WTF_CPU_PPC64 1 |
118 | #define WTF_CPU_BIG_ENDIAN 1 |
119 | #endif |
120 | |
121 | /* CPU(SH4) - SuperH SH-4 */ |
122 | #if defined(__SH4__) |
123 | #define WTF_CPU_SH4 1 |
124 | #endif |
125 | |
126 | /* CPU(SPARC32) - SPARC 32-bit */ |
127 | #if defined(__sparc) && !defined(__arch64__) || defined(__sparcv8) |
128 | #define WTF_CPU_SPARC32 1 |
129 | #define WTF_CPU_BIG_ENDIAN 1 |
130 | #endif |
131 | |
132 | /* CPU(SPARC64) - SPARC 64-bit */ |
133 | #if defined(__sparc__) && defined(__arch64__) || defined (__sparcv9) |
134 | #define WTF_CPU_SPARC64 1 |
135 | #define WTF_CPU_BIG_ENDIAN 1 |
136 | #endif |
137 | |
138 | /* CPU(SPARC) - any SPARC, true for CPU(SPARC32) and CPU(SPARC64) */ |
139 | #if CPU(SPARC32) || CPU(SPARC64) |
140 | #define WTF_CPU_SPARC 1 |
141 | #endif |
142 | |
143 | /* CPU(S390X) - S390 64-bit */ |
144 | #if defined(__s390x__) |
145 | #define WTF_CPU_S390X 1 |
146 | #define WTF_CPU_BIG_ENDIAN 1 |
147 | #endif |
148 | |
149 | /* CPU(S390) - S390 32-bit */ |
150 | #if defined(__s390__) |
151 | #define WTF_CPU_S390 1 |
152 | #define WTF_CPU_BIG_ENDIAN 1 |
153 | #endif |
154 | |
155 | /* CPU(X86) - i386 / x86 32-bit */ |
156 | #if defined(__i386__) \ |
157 | || defined(i386) \ |
158 | || defined(_M_IX86) \ |
159 | || defined(_X86_) \ |
160 | || defined(__THW_INTEL) |
161 | #define WTF_CPU_X86 1 |
162 | #endif |
163 | |
164 | /* CPU(X86_64) - AMD64 / Intel64 / x86_64 64-bit */ |
165 | #if defined(__x86_64__) \ |
166 | || defined(_M_X64) |
167 | #define WTF_CPU_X86_64 1 |
168 | #endif |
169 | |
170 | /* CPU(ARM64) - Apple */ |
171 | #if (defined(__arm64__) && defined(__APPLE__)) || defined(__aarch64__) |
172 | #define WTF_CPU_ARM64 1 |
173 | #endif |
174 | |
175 | /* CPU(ARM64) - INTEGRITY */ |
176 | #if (defined(__ARM64__)) |
177 | #define WTF_CPU_ARM64 1 |
178 | #endif |
179 | |
180 | /* CPU(ARM) - ARM, any version*/ |
181 | #define WTF_ARM_ARCH_AT_LEAST(N) (CPU(ARM) && WTF_ARM_ARCH_VERSION >= N) |
182 | |
183 | #if defined(arm) \ |
184 | || defined(__arm__) \ |
185 | || defined(ARM) \ |
186 | || defined(_ARM_) |
187 | #define WTF_CPU_ARM 1 |
188 | |
189 | #if defined(__ARM_PCS_VFP) |
190 | #define WTF_CPU_ARM_HARDFP 1 |
191 | #endif |
192 | |
193 | #if defined(__ARMEB__) || (COMPILER(RVCT) && defined(__BIG_ENDIAN)) |
194 | #define WTF_CPU_BIG_ENDIAN 1 |
195 | |
196 | #elif !defined(__ARM_EABI__) \ |
197 | && !defined(__EABI__) \ |
198 | && !defined(__VFP_FP__) \ |
199 | && !defined(_WIN32_WCE) |
200 | #define WTF_CPU_MIDDLE_ENDIAN 1 |
201 | |
202 | #endif |
203 | |
204 | /* Set WTF_ARM_ARCH_VERSION */ |
205 | #if defined(__ARM_ARCH_4__) \ |
206 | || defined(__ARM_ARCH_4T__) \ |
207 | || defined(__MARM_ARMV4__) |
208 | #define WTF_ARM_ARCH_VERSION 4 |
209 | |
210 | #elif defined(__ARM_ARCH_5__) \ |
211 | || defined(__ARM_ARCH_5T__) \ |
212 | || defined(__MARM_ARMV5__) |
213 | #define WTF_ARM_ARCH_VERSION 5 |
214 | |
215 | #elif defined(__ARM_ARCH_5E__) \ |
216 | || defined(__ARM_ARCH_5TE__) \ |
217 | || defined(__ARM_ARCH_5TEJ__) |
218 | #define WTF_ARM_ARCH_VERSION 5 |
219 | /*ARMv5TE requires allocators to use aligned memory*/ |
220 | #define WTF_USE_ARENA_ALLOC_ALIGNMENT_INTEGER 1 |
221 | |
222 | #elif defined(__ARM_ARCH_6__) \ |
223 | || defined(__ARM_ARCH_6J__) \ |
224 | || defined(__ARM_ARCH_6K__) \ |
225 | || defined(__ARM_ARCH_6Z__) \ |
226 | || defined(__ARM_ARCH_6ZK__) \ |
227 | || defined(__ARM_ARCH_6T2__) \ |
228 | || defined(__ARMV6__) |
229 | #define WTF_ARM_ARCH_VERSION 6 |
230 | |
231 | #elif defined(__ARM_ARCH_7A__) \ |
232 | || defined(__ARM_ARCH_7R__) \ |
233 | || defined(__ARM_ARCH_7S__) \ |
234 | || defined(__CORE_CORTEXA__) // GHS-specific |
235 | #define WTF_ARM_ARCH_VERSION 7 |
236 | |
237 | /* MSVC sets _M_ARM */ |
238 | #elif defined(_M_ARM) |
239 | #define WTF_ARM_ARCH_VERSION _M_ARM |
240 | |
241 | /* RVCT sets _TARGET_ARCH_ARM */ |
242 | #elif defined(__TARGET_ARCH_ARM) |
243 | #define WTF_ARM_ARCH_VERSION __TARGET_ARCH_ARM |
244 | |
245 | #if defined(__TARGET_ARCH_5E) \ |
246 | || defined(__TARGET_ARCH_5TE) \ |
247 | || defined(__TARGET_ARCH_5TEJ) |
248 | /*ARMv5TE requires allocators to use aligned memory*/ |
249 | #define WTF_USE_ARENA_ALLOC_ALIGNMENT_INTEGER 1 |
250 | #endif |
251 | |
252 | #else |
253 | #define WTF_ARM_ARCH_VERSION 0 |
254 | |
255 | #endif |
256 | |
257 | /* Set WTF_THUMB_ARCH_VERSION */ |
258 | #if defined(__ARM_ARCH_4T__) |
259 | #define WTF_THUMB_ARCH_VERSION 1 |
260 | |
261 | #elif defined(__ARM_ARCH_5T__) \ |
262 | || defined(__ARM_ARCH_5TE__) \ |
263 | || defined(__ARM_ARCH_5TEJ__) |
264 | #define WTF_THUMB_ARCH_VERSION 2 |
265 | |
266 | #elif defined(__ARM_ARCH_6J__) \ |
267 | || defined(__ARM_ARCH_6K__) \ |
268 | || defined(__ARM_ARCH_6Z__) \ |
269 | || defined(__ARM_ARCH_6ZK__) \ |
270 | || defined(__ARM_ARCH_6M__) |
271 | #define WTF_THUMB_ARCH_VERSION 3 |
272 | |
273 | #elif defined(__ARM_ARCH_6T2__) \ |
274 | || defined(__ARM_ARCH_7__) \ |
275 | || defined(__ARM_ARCH_7A__) \ |
276 | || defined(__ARM_ARCH_7M__) \ |
277 | || defined(__ARM_ARCH_7R__) \ |
278 | || defined(__ARM_ARCH_7S__) \ |
279 | || defined(__CORE_CORTEXA__) // GHS-specific |
280 | #define WTF_THUMB_ARCH_VERSION 4 |
281 | |
282 | /* RVCT sets __TARGET_ARCH_THUMB */ |
283 | #elif defined(__TARGET_ARCH_THUMB) |
284 | #define WTF_THUMB_ARCH_VERSION __TARGET_ARCH_THUMB |
285 | |
286 | #else |
287 | #define WTF_THUMB_ARCH_VERSION 0 |
288 | #endif |
289 | |
290 | |
291 | /* CPU(ARMV5_OR_LOWER) - ARM instruction set v5 or earlier */ |
292 | /* On ARMv5 and below the natural alignment is required. |
293 | And there are some other differences for v5 or earlier. */ |
294 | #if !defined(ARMV5_OR_LOWER) && !WTF_ARM_ARCH_AT_LEAST(6) |
295 | #define WTF_CPU_ARMV5_OR_LOWER 1 |
296 | #endif |
297 | |
298 | |
299 | /* CPU(ARM_TRADITIONAL) - Thumb2 is not available, only traditional ARM (v4 or greater) */ |
300 | /* CPU(ARM_THUMB2) - Thumb2 instruction set is available */ |
301 | /* Only one of these will be defined. */ |
302 | #if !defined(WTF_CPU_ARM_TRADITIONAL) && !defined(WTF_CPU_ARM_THUMB2) |
303 | # if defined(thumb2) || defined(__thumb2__) \ |
304 | || ((defined(__thumb) || defined(__thumb__)) && WTF_THUMB_ARCH_VERSION == 4) \ |
305 | || (defined(__ARM_ARCH_ISA_THUMB) && __ARM_ARCH_ISA_THUMB == 2) |
306 | # define WTF_CPU_ARM_TRADITIONAL 0 |
307 | # define WTF_CPU_ARM_THUMB2 1 |
308 | # elif WTF_ARM_ARCH_AT_LEAST(4) |
309 | # define WTF_CPU_ARM_TRADITIONAL 1 |
310 | # define WTF_CPU_ARM_THUMB2 0 |
311 | # else |
312 | # error "Not supported ARM architecture" |
313 | # endif |
314 | #elif CPU(ARM_TRADITIONAL) && CPU(ARM_THUMB2) /* Sanity Check */ |
315 | # error "Cannot use both of WTF_CPU_ARM_TRADITIONAL and WTF_CPU_ARM_THUMB2 platforms" |
316 | #endif /* !defined(WTF_CPU_ARM_TRADITIONAL) && !defined(WTF_CPU_ARM_THUMB2) */ |
317 | |
318 | #if defined(__ARM_NEON__) && !defined(WTF_CPU_ARM_NEON) |
319 | #define WTF_CPU_ARM_NEON 1 |
320 | #endif |
321 | |
322 | #if CPU(ARM_NEON) && (!COMPILER(GCC) || GCC_VERSION_AT_LEAST(4, 7, 0)) |
323 | // All NEON intrinsics usage can be disabled by this macro. |
324 | #define HAVE_ARM_NEON_INTRINSICS 1 |
325 | #endif |
326 | |
327 | #if (defined(__VFP_FP__) && !defined(__SOFTFP__)) |
328 | #define WTF_CPU_ARM_VFP 1 |
329 | #endif |
330 | |
331 | #if defined(__ARM_ARCH_7S__) |
332 | #define WTF_CPU_APPLE_ARMV7S 1 |
333 | #endif |
334 | |
335 | #endif /* ARM */ |
336 | |
337 | #if CPU(ARM) || CPU(MIPS) || CPU(SH4) || CPU(SPARC) |
338 | #define WTF_CPU_NEEDS_ALIGNED_ACCESS 1 |
339 | #endif |
340 | |
341 | /* ==== OS() - underlying operating system; only to be used for mandated low-level services like |
342 | virtual memory, not to choose a GUI toolkit ==== */ |
343 | |
344 | /* OS(AIX) - AIX */ |
345 | #ifdef _AIX |
346 | #define WTF_OS_AIX 1 |
347 | #endif |
348 | |
349 | /* OS(DARWIN) - Any Darwin-based OS, including Mac OS X and iPhone OS */ |
350 | #ifdef __APPLE__ |
351 | #define WTF_OS_DARWIN 1 |
352 | |
353 | #include <Availability.h> |
354 | #include <AvailabilityMacros.h> |
355 | #include <TargetConditionals.h> |
356 | #endif |
357 | |
358 | /* OS(IOS) - iOS */ |
359 | /* OS(MAC_OS_X) - Mac OS X (not including iOS) */ |
360 | #if OS(DARWIN) && ((defined(TARGET_OS_EMBEDDED) && TARGET_OS_EMBEDDED) \ |
361 | || (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE) \ |
362 | || (defined(TARGET_IPHONE_SIMULATOR) && TARGET_IPHONE_SIMULATOR)) |
363 | #define WTF_OS_IOS 1 |
364 | #elif OS(DARWIN) && ((defined(TARGET_OS_EMBEDDED) && TARGET_OS_EMBEDDED) \ |
365 | || (defined(TARGET_OS_APPLETV) && TARGET_OS_APPLETV) \ |
366 | || (defined(TARGET_APPLETV_SIMULATOR) && TARGET_APPLETV_SIMULATOR)) |
367 | #define WTF_OS_IOS 1 |
368 | #define WTF_OS_TVOS 1 |
369 | #elif OS(DARWIN) && defined(TARGET_OS_MAC) && TARGET_OS_MAC |
370 | #define WTF_OS_MAC_OS_X 1 |
371 | |
372 | /* FIXME: These can be removed after sufficient time has passed since the removal of BUILDING_ON / TARGETING macros. */ |
373 | |
374 | #define ERROR_PLEASE_COMPARE_WITH_MAC_OS_X_VERSION_MIN_REQUIRED 0 / 0 |
375 | #define ERROR_PLEASE_COMPARE_WITH_MAC_OS_X_VERSION_MAX_ALLOWED 0 / 0 |
376 | |
377 | #define BUILDING_ON_LEOPARD ERROR_PLEASE_COMPARE_WITH_MAC_OS_X_VERSION_MIN_REQUIRED |
378 | #define BUILDING_ON_SNOW_LEOPARD ERROR_PLEASE_COMPARE_WITH_MAC_OS_X_VERSION_MIN_REQUIRED |
379 | #define BUILDING_ON_LION ERROR_PLEASE_COMPARE_WITH_MAC_OS_X_VERSION_MIN_REQUIRED |
380 | |
381 | #define TARGETING_LEOPARD ERROR_PLEASE_COMPARE_WITH_MAC_OS_X_VERSION_MAX_ALLOWED |
382 | #define TARGETING_SNOW_LEOPARD ERROR_PLEASE_COMPARE_WITH_MAC_OS_X_VERSION_MAX_ALLOWED |
383 | #define TARGETING_LION ERROR_PLEASE_COMPARE_WITH_MAC_OS_X_VERSION_MAX_ALLOWED |
384 | #endif |
385 | |
386 | /* OS(FREEBSD) - FreeBSD */ |
387 | #if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__) |
388 | #define WTF_OS_FREEBSD 1 |
389 | #endif |
390 | |
391 | /* OS(HURD) - GNU/Hurd */ |
392 | #ifdef __GNU__ |
393 | #define WTF_OS_HURD 1 |
394 | #endif |
395 | |
396 | /* OS(INTEGRITY) - INTEGRITY */ |
397 | #ifdef __INTEGRITY |
398 | #define WTF_OS_INTEGRITY 1 |
399 | #endif |
400 | |
401 | /* OS(LINUX) - Linux */ |
402 | #ifdef __linux__ |
403 | #define WTF_OS_LINUX 1 |
404 | #endif |
405 | |
406 | /* OS(NETBSD) - NetBSD */ |
407 | #if defined(__NetBSD__) |
408 | #define WTF_OS_NETBSD 1 |
409 | #endif |
410 | |
411 | /* OS(OPENBSD) - OpenBSD */ |
412 | #ifdef __OpenBSD__ |
413 | #define WTF_OS_OPENBSD 1 |
414 | #endif |
415 | |
416 | /* OS(QNX) - QNX */ |
417 | #if defined(__QNXNTO__) |
418 | #define WTF_OS_QNX 1 |
419 | #endif |
420 | |
421 | /* OS(SOLARIS) - Solaris */ |
422 | #if defined(sun) || defined(__sun) |
423 | #define WTF_OS_SOLARIS 1 |
424 | #endif |
425 | |
426 | /* OS(WINCE) - Windows CE; note that for this platform OS(WINDOWS) is also defined */ |
427 | #if defined(_WIN32_WCE) |
428 | #define WTF_OS_WINCE 1 |
429 | #endif |
430 | |
431 | /* OS(WINCE) - Windows Runtime; note that for this platform OS(WINDOWS) is also defined */ |
432 | #if defined(WINAPI_FAMILY) && (WINAPI_FAMILY==WINAPI_FAMILY_APP || WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP) |
433 | #define WTF_OS_WINRT 1 |
434 | #endif |
435 | |
436 | /* OS(WINDOWS) - Any version of Windows */ |
437 | #if defined(WIN32) || defined(_WIN32) |
438 | #define WTF_OS_WINDOWS 1 |
439 | #endif |
440 | |
441 | #ifdef __rtems__ |
442 | #define WTF_OS_RTEMS 1 |
443 | #endif |
444 | |
445 | #define WTF_OS_WIN ERROR "USE WINDOWS WITH OS NOT WIN" |
446 | #define WTF_OS_MAC ERROR "USE MAC_OS_X WITH OS NOT MAC" |
447 | |
448 | /* OS(UNIX) - Any Unix-like system */ |
449 | #if OS(AIX) \ |
450 | || OS(DARWIN) \ |
451 | || OS(FREEBSD) \ |
452 | || OS(HURD) \ |
453 | || OS(INTEGRITY) \ |
454 | || OS(LINUX) \ |
455 | || OS(NETBSD) \ |
456 | || OS(OPENBSD) \ |
457 | || OS(QNX) \ |
458 | || OS(RTEMS) \ |
459 | || OS(SOLARIS) \ |
460 | || defined(unix) \ |
461 | || defined(__unix) \ |
462 | || defined(__unix__) |
463 | #define WTF_OS_UNIX 1 |
464 | #endif |
465 | |
466 | /* Operating environments */ |
467 | |
468 | /* FIXME: these are all mixes of OS, operating environment and policy choices. */ |
469 | /* PLATFORM(QT) */ |
470 | /* PLATFORM(WX) */ |
471 | /* PLATFORM(EFL) */ |
472 | /* PLATFORM(GTK) */ |
473 | /* PLATFORM(BLACKBERRY) */ |
474 | /* PLATFORM(MAC) */ |
475 | /* PLATFORM(WIN) */ |
476 | #if defined(BUILDING_QT__) |
477 | #define WTF_PLATFORM_QT 1 |
478 | #elif defined(BUILDING_WX__) |
479 | #define WTF_PLATFORM_WX 1 |
480 | #elif defined(BUILDING_EFL__) |
481 | #define WTF_PLATFORM_EFL 1 |
482 | #elif defined(BUILDING_GTK__) |
483 | #define WTF_PLATFORM_GTK 1 |
484 | #elif defined(BUILDING_BLACKBERRY__) |
485 | #define WTF_PLATFORM_BLACKBERRY 1 |
486 | #elif OS(DARWIN) |
487 | #define WTF_PLATFORM_MAC 1 |
488 | #elif OS(WINDOWS) |
489 | #define WTF_PLATFORM_WIN 1 |
490 | #else |
491 | |
492 | /* PLATFORM(IOS) */ |
493 | /* FIXME: this is sometimes used as an OS switch and sometimes for higher-level things */ |
494 | #if (defined(TARGET_OS_EMBEDDED) && TARGET_OS_EMBEDDED) || (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE) |
495 | #define WTF_PLATFORM_IOS 1 |
496 | #endif |
497 | |
498 | /* PLATFORM(IOS_SIMULATOR) */ |
499 | #if defined(TARGET_IPHONE_SIMULATOR) && TARGET_IPHONE_SIMULATOR |
500 | #define WTF_PLATFORM_IOS 1 |
501 | #define WTF_PLATFORM_IOS_SIMULATOR 1 |
502 | #endif |
503 | #endif |
504 | |
505 | /* Graphics engines */ |
506 | |
507 | /* USE(CG) and PLATFORM(CI) */ |
508 | #if PLATFORM(MAC) || PLATFORM(IOS) |
509 | #define WTF_USE_CG 1 |
510 | #endif |
511 | #if PLATFORM(MAC) || PLATFORM(IOS) || (PLATFORM(WIN) && USE(CG)) |
512 | #define WTF_USE_CA 1 |
513 | #endif |
514 | |
515 | #if PLATFORM(BLACKBERRY) |
516 | #define WTF_USE_SKIA 1 |
517 | #define WTF_USE_LOW_QUALITY_IMAGE_INTERPOLATION 1 |
518 | #define WTF_USE_LOW_QUALITY_IMAGE_NO_JPEG_DITHERING 1 |
519 | #define WTF_USE_LOW_QUALITY_IMAGE_NO_JPEG_FANCY_UPSAMPLING 1 |
520 | #endif |
521 | |
522 | #if PLATFORM(GTK) |
523 | #define WTF_USE_CAIRO 1 |
524 | #define ENABLE_GLOBAL_FASTMALLOC_NEW 0 |
525 | #endif |
526 | |
527 | /* On Windows, use QueryPerformanceCounter by default */ |
528 | #if OS(WINDOWS) |
529 | #define WTF_USE_QUERY_PERFORMANCE_COUNTER 1 |
530 | #endif |
531 | |
532 | #if OS(WINCE) |
533 | #define NOSHLWAPI /* shlwapi.h not available on WinCe */ |
534 | |
535 | /* MSDN documentation says these functions are provided with uspce.lib. But we cannot find this file. */ |
536 | #define __usp10__ /* disable "usp10.h" */ |
537 | |
538 | #define _INC_ASSERT /* disable "assert.h" */ |
539 | #define assert(x) |
540 | |
541 | #endif /* OS(WINCE) */ |
542 | |
543 | #if OS(WINCE) && !PLATFORM(QT) |
544 | #define WTF_USE_WCHAR_UNICODE 1 |
545 | #elif PLATFORM(GTK) |
546 | /* The GTK+ Unicode backend is configurable */ |
547 | #else |
548 | #define WTF_USE_ICU_UNICODE 1 |
549 | #endif |
550 | |
551 | #if PLATFORM(MAC) && !PLATFORM(IOS) |
552 | #if CPU(X86_64) |
553 | #define WTF_USE_PLUGIN_HOST_PROCESS 1 |
554 | #endif |
555 | #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 |
556 | #define WTF_USE_SCROLLBAR_PAINTER 1 |
557 | #define HAVE_XPC 1 |
558 | #endif |
559 | #define WTF_USE_CF 1 |
560 | #define HAVE_READLINE 1 |
561 | #define HAVE_RUNLOOP_TIMER 1 |
562 | #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 |
563 | #define HAVE_LAYER_HOSTING_IN_WINDOW_SERVER 1 |
564 | #endif |
565 | #define WTF_USE_APPKIT 1 |
566 | #define WTF_USE_SECURITY_FRAMEWORK 1 |
567 | #endif /* PLATFORM(MAC) && !PLATFORM(IOS) */ |
568 | |
569 | #if PLATFORM(IOS) |
570 | #define DONT_FINALIZE_ON_MAIN_THREAD 1 |
571 | #endif |
572 | |
573 | #if PLATFORM(QT) && OS(DARWIN) |
574 | #define WTF_USE_CF 1 |
575 | #endif |
576 | |
577 | #if OS(DARWIN) && !PLATFORM(GTK) && !PLATFORM(QT) |
578 | #define ENABLE_PURGEABLE_MEMORY 1 |
579 | #endif |
580 | |
581 | #if PLATFORM(IOS) |
582 | #define HAVE_READLINE 1 |
583 | #define WTF_USE_APPKIT 0 |
584 | #define WTF_USE_CF 1 |
585 | #define WTF_USE_CFNETWORK 1 |
586 | #define WTF_USE_NETWORK_CFDATA_ARRAY_CALLBACK 1 |
587 | #define WTF_USE_SECURITY_FRAMEWORK 0 |
588 | #define WTF_USE_WEB_THREAD 1 |
589 | #endif /* PLATFORM(IOS) */ |
590 | |
591 | #if PLATFORM(WIN) && !OS(WINCE) |
592 | #define WTF_USE_CF 1 |
593 | #endif |
594 | |
595 | #if PLATFORM(WIN) && !OS(WINCE) && !PLATFORM(WIN_CAIRO) |
596 | #define WTF_USE_CFNETWORK 1 |
597 | #endif |
598 | |
599 | #if USE(CFNETWORK) || PLATFORM(MAC) || PLATFORM(IOS) |
600 | #define WTF_USE_CFURLCACHE 1 |
601 | #endif |
602 | |
603 | #if PLATFORM(WX) |
604 | #if !CPU(PPC) |
605 | #if !defined(ENABLE_ASSEMBLER) |
606 | #define ENABLE_ASSEMBLER 1 |
607 | #endif |
608 | #define ENABLE_JIT 1 |
609 | #endif |
610 | #define ENABLE_GLOBAL_FASTMALLOC_NEW 0 |
611 | #define ENABLE_LLINT 0 |
612 | #if OS(DARWIN) |
613 | #define WTF_USE_CF 1 |
614 | #endif |
615 | #endif |
616 | |
617 | #if !defined(HAVE_ACCESSIBILITY) |
618 | #if PLATFORM(IOS) || PLATFORM(MAC) || PLATFORM(WIN) || PLATFORM(GTK) || PLATFORM(EFL) |
619 | #define HAVE_ACCESSIBILITY 1 |
620 | #endif |
621 | #endif /* !defined(HAVE_ACCESSIBILITY) */ |
622 | |
623 | #if OS(UNIX) |
624 | #define HAVE_ERRNO_H 1 |
625 | #if !OS(INTEGRITY) |
626 | #define HAVE_MMAP 1 |
627 | #endif |
628 | #define HAVE_SIGNAL_H 1 |
629 | #define HAVE_STRINGS_H 1 |
630 | #define HAVE_SYS_PARAM_H 1 |
631 | #define HAVE_SYS_TIME_H 1 |
632 | #define WTF_USE_OS_RANDOMNESS 1 |
633 | #define WTF_USE_PTHREADS 1 |
634 | #endif /* OS(UNIX) */ |
635 | |
636 | #if OS(UNIX) && !OS(QNX) |
637 | #define HAVE_LANGINFO_H 1 |
638 | #endif |
639 | |
640 | #if (OS(FREEBSD) || OS(OPENBSD)) && !defined(__GLIBC__) |
641 | #define HAVE_PTHREAD_NP_H 1 |
642 | #endif |
643 | |
644 | #if !defined(HAVE_VASPRINTF) |
645 | #if !COMPILER(MSVC) && !COMPILER(RVCT) && !COMPILER(MINGW) && !(COMPILER(GCC) && OS(QNX)) |
646 | #define HAVE_VASPRINTF 1 |
647 | #endif |
648 | #endif |
649 | |
650 | #if !defined(HAVE_STRNSTR) |
651 | #if OS(DARWIN) || (OS(FREEBSD) && !defined(__GLIBC__)) |
652 | #define HAVE_STRNSTR 1 |
653 | #endif |
654 | #endif |
655 | |
656 | #if !OS(WINDOWS) && !OS(SOLARIS) |
657 | #define HAVE_TM_GMTOFF 1 |
658 | #define HAVE_TM_ZONE 1 |
659 | #define HAVE_TIMEGM 1 |
660 | #endif |
661 | |
662 | #if OS(DARWIN) |
663 | |
664 | #define HAVE_DISPATCH_H 1 |
665 | #define HAVE_MADV_FREE 1 |
666 | #define HAVE_MADV_FREE_REUSE 1 |
667 | #define HAVE_MERGESORT 1 |
668 | #define HAVE_PTHREAD_SETNAME_NP 1 |
669 | #define HAVE_SYS_TIMEB_H 1 |
670 | #define WTF_USE_ACCELERATE 1 |
671 | |
672 | #if !PLATFORM(IOS) |
673 | #define HAVE_HOSTED_CORE_ANIMATION 1 |
674 | #endif /* !PLATFORM(IOS) */ |
675 | |
676 | #endif /* OS(DARWIN) */ |
677 | |
678 | #if OS(WINDOWS) && !OS(WINCE) |
679 | #define HAVE_SYS_TIMEB_H 1 |
680 | #define HAVE_ALIGNED_MALLOC 1 |
681 | #define HAVE_ISDEBUGGERPRESENT 1 |
682 | #endif |
683 | |
684 | #if OS(WINDOWS) |
685 | #define HAVE_VIRTUALALLOC 1 |
686 | #define WTF_USE_OS_RANDOMNESS 1 |
687 | #endif |
688 | |
689 | #if OS(QNX) |
690 | #define HAVE_MADV_FREE_REUSE 1 |
691 | #define HAVE_MADV_FREE 1 |
692 | #endif |
693 | |
694 | /* ENABLE macro defaults */ |
695 | |
696 | /* FIXME: move out all ENABLE() defines from here to FeatureDefines.h */ |
697 | |
698 | /* Include feature macros */ |
699 | #include <wtf/FeatureDefines.h> |
700 | |
701 | #if PLATFORM(QT) |
702 | /* We must not customize the global operator new and delete for the Qt port. */ |
703 | #define ENABLE_GLOBAL_FASTMALLOC_NEW 0 |
704 | #if !OS(UNIX) |
705 | #define USE_SYSTEM_MALLOC 1 |
706 | #endif |
707 | #endif |
708 | |
709 | #if PLATFORM(EFL) |
710 | #define ENABLE_GLOBAL_FASTMALLOC_NEW 0 |
711 | #endif |
712 | |
713 | #if !defined(ENABLE_GLOBAL_FASTMALLOC_NEW) |
714 | #define ENABLE_GLOBAL_FASTMALLOC_NEW 1 |
715 | #endif |
716 | |
717 | #define ENABLE_DEBUG_WITH_BREAKPOINT 0 |
718 | #define ENABLE_SAMPLING_COUNTERS 0 |
719 | #define ENABLE_SAMPLING_FLAGS 0 |
720 | #define ENABLE_SAMPLING_REGIONS 0 |
721 | #define ENABLE_OPCODE_SAMPLING 0 |
722 | #define ENABLE_CODEBLOCK_SAMPLING 0 |
723 | #if ENABLE(CODEBLOCK_SAMPLING) && !ENABLE(OPCODE_SAMPLING) |
724 | #error "CODEBLOCK_SAMPLING requires OPCODE_SAMPLING" |
725 | #endif |
726 | #if ENABLE(OPCODE_SAMPLING) || ENABLE(SAMPLING_FLAGS) || ENABLE(SAMPLING_REGIONS) |
727 | #define ENABLE_SAMPLING_THREAD 1 |
728 | #endif |
729 | |
730 | #if !defined(WTF_USE_JSVALUE64) && !defined(WTF_USE_JSVALUE32_64) |
731 | #if (CPU(X86_64) && (OS(UNIX) || OS(WINDOWS))) \ |
732 | || (CPU(IA64) && !CPU(IA64_32)) \ |
733 | || CPU(ALPHA) \ |
734 | || CPU(ARM64) \ |
735 | || CPU(SPARC64) \ |
736 | || CPU(S390X) \ |
737 | || CPU(PPC64) |
738 | #define WTF_USE_JSVALUE64 1 |
739 | #else |
740 | #define WTF_USE_JSVALUE32_64 1 |
741 | #endif |
742 | #endif /* !defined(WTF_USE_JSVALUE64) && !defined(WTF_USE_JSVALUE32_64) */ |
743 | |
744 | /* Disable the JIT on versions of GCC prior to 4.1 */ |
745 | #if !defined(ENABLE_JIT) && COMPILER(GCC) && !GCC_VERSION_AT_LEAST(4, 1, 0) |
746 | #define ENABLE_JIT 0 |
747 | #endif |
748 | |
749 | /* The JIT is enabled by default on all x86, x86-64, ARM & MIPS platforms. */ |
750 | #if !defined(ENABLE_JIT) \ |
751 | && (CPU(X86) || CPU(X86_64) || CPU(ARM) || CPU(MIPS) || CPU(ARM64)) \ |
752 | && (OS(DARWIN) || !COMPILER(GCC) || GCC_VERSION_AT_LEAST(4, 1, 0)) \ |
753 | && !OS(WINCE) \ |
754 | && !(OS(QNX) && !PLATFORM(QT)) /* We use JIT in QNX Qt */ |
755 | #define ENABLE_JIT 1 |
756 | #endif |
757 | |
758 | /* If possible, try to enable a disassembler. This is optional. We proceed in two |
759 | steps: first we try to find some disassembler that we can use, and then we |
760 | decide if the high-level disassembler API can be enabled. */ |
761 | #if !defined(WTF_USE_UDIS86) && ENABLE(JIT) && (PLATFORM(MAC) || (PLATFORM(QT) && OS(LINUX))) \ |
762 | && (CPU(X86) || CPU(X86_64)) |
763 | #define WTF_USE_UDIS86 1 |
764 | #endif |
765 | |
766 | #if !defined(ENABLE_DISASSEMBLER) && (USE(UDIS86) || USE(ARMV7_DISASSEMBLER) || USE(ARM64_DISASSEMBLER) || USE(MIPS32_DISASSEMBLER)) |
767 | #define ENABLE_DISASSEMBLER 1 |
768 | #endif |
769 | |
770 | /* On the GTK+ port we take an extra precaution for LLINT support: |
771 | * We disable it on x86 builds if the build target doesn't support SSE2 |
772 | * instructions (LLINT requires SSE2 on this platform). */ |
773 | #if !defined(ENABLE_LLINT) && PLATFORM(GTK) && CPU(X86) && COMPILER(GCC) \ |
774 | && !defined(__SSE2__) |
775 | #define ENABLE_LLINT 0 |
776 | #endif |
777 | |
778 | /* On some of the platforms where we have a JIT, we want to also have the |
779 | low-level interpreter. */ |
780 | #if !defined(ENABLE_LLINT) \ |
781 | && ENABLE(JIT) \ |
782 | && (OS(DARWIN) || OS(LINUX)) \ |
783 | && (PLATFORM(MAC) || PLATFORM(IOS) || PLATFORM(GTK) || PLATFORM(QT)) \ |
784 | && (CPU(X86) || CPU(X86_64) || CPU(ARM_THUMB2) || CPU(ARM_TRADITIONAL) || CPU(MIPS)) |
785 | #define ENABLE_LLINT 1 |
786 | #endif |
787 | |
788 | #if !defined(ENABLE_DFG_JIT) && ENABLE(JIT) && !COMPILER(MSVC) |
789 | /* Enable the DFG JIT on X86 and X86_64. Only tested on Mac and GNU/Linux. */ |
790 | #if (CPU(X86) || CPU(X86_64)) && (OS(DARWIN) || OS(LINUX)) |
791 | #define ENABLE_DFG_JIT 1 |
792 | #endif |
793 | /* Enable the DFG JIT on ARMv7. Only tested on iOS and Qt Linux. */ |
794 | #if CPU(ARM_THUMB2) && (PLATFORM(IOS) || PLATFORM(BLACKBERRY) || PLATFORM(QT)) |
795 | #define ENABLE_DFG_JIT 1 |
796 | #endif |
797 | /* Enable the DFG JIT on ARM. */ |
798 | #if CPU(ARM_TRADITIONAL) |
799 | #define ENABLE_DFG_JIT 1 |
800 | #endif |
801 | /* Enable the DFG JIT on MIPS. */ |
802 | #if CPU(MIPS) |
803 | #define ENABLE_DFG_JIT 1 |
804 | #endif |
805 | #endif |
806 | |
807 | /* If the jit is not available, enable the LLInt C Loop: */ |
808 | /* Not for Qml. We have our own interpreter. */ |
809 | #if 0 /* !ENABLE(JIT) */ |
810 | #undef ENABLE_LLINT /* Undef so that we can redefine it. */ |
811 | #undef ENABLE_LLINT_C_LOOP /* Undef so that we can redefine it. */ |
812 | #undef ENABLE_DFG_JIT /* Undef so that we can redefine it. */ |
813 | #define ENABLE_LLINT 1 |
814 | #define ENABLE_LLINT_C_LOOP 1 |
815 | #define ENABLE_DFG_JIT 0 |
816 | #endif |
817 | |
818 | /* Do a sanity check to make sure that we at least have one execution engine in |
819 | use: */ |
820 | #if 0 /* !(ENABLE(JIT) || ENABLE(LLINT)) */ |
821 | #error You have to have at least one execution model enabled to build JSC |
822 | #endif |
823 | |
824 | /* Profiling of types and values used by JIT code. DFG_JIT depends on it, but you |
825 | can enable it manually with DFG turned off if you want to use it as a standalone |
826 | profiler. In that case, you probably want to also enable VERBOSE_VALUE_PROFILE |
827 | below. */ |
828 | #if !defined(ENABLE_VALUE_PROFILER) && ENABLE(DFG_JIT) |
829 | #define ENABLE_VALUE_PROFILER 1 |
830 | #endif |
831 | |
832 | #if !defined(ENABLE_VERBOSE_VALUE_PROFILE) && ENABLE(VALUE_PROFILER) |
833 | #define ENABLE_VERBOSE_VALUE_PROFILE 0 |
834 | #endif |
835 | |
836 | #if !defined(ENABLE_SIMPLE_HEAP_PROFILING) |
837 | #define ENABLE_SIMPLE_HEAP_PROFILING 0 |
838 | #endif |
839 | |
840 | /* Counts uses of write barriers using sampling counters. Be sure to also |
841 | set ENABLE_SAMPLING_COUNTERS to 1. */ |
842 | #if !defined(ENABLE_WRITE_BARRIER_PROFILING) |
843 | #define ENABLE_WRITE_BARRIER_PROFILING 0 |
844 | #endif |
845 | |
846 | /* Enable verification that that register allocations are not made within generated control flow. |
847 | Turned on for debug builds. */ |
848 | #if !defined(ENABLE_DFG_REGISTER_ALLOCATION_VALIDATION) && ENABLE(DFG_JIT) |
849 | #if !defined(NDEBUG) |
850 | #define ENABLE_DFG_REGISTER_ALLOCATION_VALIDATION 1 |
851 | #else |
852 | #define ENABLE_DFG_REGISTER_ALLOCATION_VALIDATION 0 |
853 | #endif |
854 | #endif |
855 | |
856 | /* Configure the JIT */ |
857 | #if CPU(X86) && COMPILER(MSVC) |
858 | #define JSC_HOST_CALL __fastcall |
859 | #elif CPU(X86) && COMPILER(GCC) |
860 | #define JSC_HOST_CALL __attribute__ ((fastcall)) |
861 | #else |
862 | #define JSC_HOST_CALL |
863 | #endif |
864 | |
865 | /* Configure the interpreter */ |
866 | #if COMPILER(GCC) || (COMPILER(RVCT) && defined(__GNUC__)) |
867 | #define HAVE_COMPUTED_GOTO 1 |
868 | #endif |
869 | |
870 | /* Determine if we need to enable Computed Goto Opcodes or not: */ |
871 | #if HAVE(COMPUTED_GOTO) && ENABLE(LLINT) |
872 | #define ENABLE_COMPUTED_GOTO_OPCODES 1 |
873 | #endif |
874 | |
875 | /* Regular Expression Tracing - Set to 1 to trace RegExp's in jsc. Results dumped at exit */ |
876 | #define ENABLE_REGEXP_TRACING 0 |
877 | |
878 | /* Yet Another Regex Runtime - turned on by default for JIT enabled ports. */ |
879 | #if !defined(ENABLE_YARR_JIT) && (ENABLE(JIT) || ENABLE(LLINT_C_LOOP)) && !(OS(QNX) && PLATFORM(QT)) |
880 | #define ENABLE_YARR_JIT 1 |
881 | |
882 | /* Setting this flag compares JIT results with interpreter results. */ |
883 | #define ENABLE_YARR_JIT_DEBUG 0 |
884 | #endif |
885 | |
886 | /* If either the JIT or the RegExp JIT is enabled, then the Assembler must be |
887 | enabled as well: */ |
888 | #if ENABLE(JIT) || ENABLE(YARR_JIT) |
889 | #if defined(ENABLE_ASSEMBLER) && !ENABLE_ASSEMBLER |
890 | #error "Cannot enable the JIT or RegExp JIT without enabling the Assembler" |
891 | #else |
892 | #undef ENABLE_ASSEMBLER |
893 | #define ENABLE_ASSEMBLER 1 |
894 | #endif |
895 | #endif |
896 | |
897 | /* Pick which allocator to use; we only need an executable allocator if the assembler is compiled in. |
898 | On x86-64 we use a single fixed mmap, on other platforms we mmap on demand. */ |
899 | #if ENABLE(ASSEMBLER) |
900 | #if CPU(X86_64) && !OS(WINDOWS) || PLATFORM(IOS) || CPU(ARM64) |
901 | #define ENABLE_EXECUTABLE_ALLOCATOR_FIXED 1 |
902 | #else |
903 | #define ENABLE_EXECUTABLE_ALLOCATOR_DEMAND 1 |
904 | #endif |
905 | #endif |
906 | |
907 | /* Use the QXmlStreamReader implementation for XMLDocumentParser */ |
908 | /* Use the QXmlQuery implementation for XSLTProcessor */ |
909 | #if PLATFORM(QT) |
910 | #if !USE(LIBXML2) |
911 | #define WTF_USE_QXMLSTREAM 1 |
912 | #define WTF_USE_QXMLQUERY 1 |
913 | #endif |
914 | #endif |
915 | |
916 | /* Accelerated compositing */ |
917 | #if PLATFORM(MAC) || PLATFORM(IOS) || PLATFORM(QT) || (PLATFORM(WIN) && !OS(WINCE) && !PLATFORM(WIN_CAIRO)) |
918 | #define WTF_USE_ACCELERATED_COMPOSITING 1 |
919 | #endif |
920 | |
921 | #if ENABLE(WEBGL) && !defined(WTF_USE_3D_GRAPHICS) |
922 | #define WTF_USE_3D_GRAPHICS 1 |
923 | #endif |
924 | |
925 | /* Qt always uses Texture Mapper */ |
926 | #if PLATFORM(QT) |
927 | #define WTF_USE_TEXTURE_MAPPER 1 |
928 | #endif |
929 | |
930 | #if USE(TEXTURE_MAPPER) && USE(3D_GRAPHICS) && !defined(WTF_USE_TEXTURE_MAPPER_GL) |
931 | #define WTF_USE_TEXTURE_MAPPER_GL 1 |
932 | #endif |
933 | |
934 | /* Compositing on the UI-process in WebKit2 */ |
935 | #if USE(3D_GRAPHICS) && PLATFORM(QT) |
936 | #define WTF_USE_COORDINATED_GRAPHICS 1 |
937 | #endif |
938 | |
939 | #if PLATFORM(MAC) || PLATFORM(IOS) |
940 | #define WTF_USE_PROTECTION_SPACE_AUTH_CALLBACK 1 |
941 | #endif |
942 | |
943 | /* Set up a define for a common error that is intended to cause a build error -- thus the space after Error. */ |
944 | #define WTF_PLATFORM_CFNETWORK Error USE_macro_should_be_used_with_CFNETWORK |
945 | |
946 | /* FIXME: Eventually we should enable this for all platforms and get rid of the define. */ |
947 | #if PLATFORM(IOS) || PLATFORM(MAC) || PLATFORM(WIN) || PLATFORM(QT) || PLATFORM(GTK) || PLATFORM(EFL) |
948 | #define WTF_USE_PLATFORM_STRATEGIES 1 |
949 | #endif |
950 | |
951 | #if PLATFORM(WIN) |
952 | #define WTF_USE_CROSS_PLATFORM_CONTEXT_MENUS 1 |
953 | #endif |
954 | |
955 | #if PLATFORM(MAC) && HAVE(ACCESSIBILITY) |
956 | #define WTF_USE_ACCESSIBILITY_CONTEXT_MENUS 1 |
957 | #endif |
958 | |
959 | #if !defined(ENABLE_THREADING_LIBDISPATCH) && HAVE(DISPATCH_H) |
960 | #define ENABLE_THREADING_LIBDISPATCH 1 |
961 | #elif !defined(ENABLE_THREADING_OPENMP) && defined(_OPENMP) |
962 | #define ENABLE_THREADING_OPENMP 1 |
963 | #elif !defined(THREADING_GENERIC) |
964 | #define ENABLE_THREADING_GENERIC 1 |
965 | #endif |
966 | |
967 | #if USE(GLIB) |
968 | #include <wtf/gobject/GTypedefs.h> |
969 | #endif |
970 | |
971 | /* FIXME: This define won't be needed once #27551 is fully landed. However, |
972 | since most ports try to support sub-project independence, adding new headers |
973 | to WTF causes many ports to break, and so this way we can address the build |
974 | breakages one port at a time. */ |
975 | #if !defined(WTF_USE_EXPORT_MACROS) && (PLATFORM(MAC) || PLATFORM(QT) || PLATFORM(WX)) |
976 | #define WTF_USE_EXPORT_MACROS 1 |
977 | #endif |
978 | |
979 | #if !defined(WTF_USE_EXPORT_MACROS_FOR_TESTING) && (PLATFORM(GTK) || PLATFORM(WIN)) |
980 | #define WTF_USE_EXPORT_MACROS_FOR_TESTING 1 |
981 | #endif |
982 | |
983 | #if (PLATFORM(QT) && !OS(DARWIN) && !OS(WINDOWS)) || PLATFORM(GTK) || PLATFORM(EFL) |
984 | #define WTF_USE_UNIX_DOMAIN_SOCKETS 1 |
985 | #endif |
986 | |
987 | #if !defined(ENABLE_COMPARE_AND_SWAP) && (OS(WINDOWS) || (COMPILER(GCC) && (CPU(X86) || CPU(X86_64) || CPU(ARM_THUMB2)))) |
988 | #define ENABLE_COMPARE_AND_SWAP 1 |
989 | #endif |
990 | |
991 | #define ENABLE_OBJECT_MARK_LOGGING 0 |
992 | |
993 | #if !defined(ENABLE_PARALLEL_GC) && !ENABLE(OBJECT_MARK_LOGGING) && (PLATFORM(MAC) || PLATFORM(IOS) || PLATFORM(BLACKBERRY) || PLATFORM(GTK)) && ENABLE(COMPARE_AND_SWAP) |
994 | #define ENABLE_PARALLEL_GC 1 |
995 | #elif PLATFORM(QT) |
996 | // Parallel GC is temporarily disabled on Qt because of regular crashes, see https://bugs.webkit.org/show_bug.cgi?id=90957 for details |
997 | #define ENABLE_PARALLEL_GC 0 |
998 | #endif |
999 | |
1000 | #if !defined(ENABLE_GC_VALIDATION) && !defined(NDEBUG) |
1001 | #define ENABLE_GC_VALIDATION 1 |
1002 | #endif |
1003 | |
1004 | #if !defined(ENABLE_BINDING_INTEGRITY) |
1005 | #define ENABLE_BINDING_INTEGRITY 1 |
1006 | #endif |
1007 | |
1008 | #if PLATFORM(MAC) && !PLATFORM(IOS) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 |
1009 | #define WTF_USE_AVFOUNDATION 1 |
1010 | #endif |
1011 | |
1012 | #if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 60000) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080) |
1013 | #define WTF_USE_COREMEDIA 1 |
1014 | #endif |
1015 | |
1016 | #if PLATFORM(MAC) && !PLATFORM(IOS) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 |
1017 | #define HAVE_AVFOUNDATION_TEXT_TRACK_SUPPORT 1 |
1018 | #endif |
1019 | |
1020 | #if PLATFORM(MAC) && !PLATFORM(IOS) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 |
1021 | #define HAVE_MEDIA_ACCESSIBILITY_FRAMEWORK 1 |
1022 | #endif |
1023 | |
1024 | #if PLATFORM(MAC) || PLATFORM(GTK) || (PLATFORM(WIN) && !OS(WINCE) && !PLATFORM(WIN_CAIRO)) || PLATFORM(BLACKBERRY) |
1025 | #define WTF_USE_REQUEST_ANIMATION_FRAME_TIMER 1 |
1026 | #endif |
1027 | |
1028 | #if PLATFORM(MAC) || PLATFORM(BLACKBERRY) |
1029 | #define WTF_USE_REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR 1 |
1030 | #endif |
1031 | |
1032 | #if PLATFORM(MAC) && (PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070) |
1033 | #define HAVE_INVERTED_WHEEL_EVENTS 1 |
1034 | #endif |
1035 | |
1036 | #if PLATFORM(MAC) |
1037 | #define WTF_USE_COREAUDIO 1 |
1038 | #endif |
1039 | |
1040 | #if !defined(WTF_USE_ZLIB) && !PLATFORM(QT) |
1041 | #define WTF_USE_ZLIB 1 |
1042 | #endif |
1043 | |
1044 | #if PLATFORM(QT) |
1045 | #include <qglobal.h> |
1046 | #if defined(QT_OPENGL_ES_2) && !defined(WTF_USE_OPENGL_ES_2) |
1047 | #define WTF_USE_OPENGL_ES_2 1 |
1048 | #endif |
1049 | #endif |
1050 | |
1051 | #if !PLATFORM(IOS) && PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 |
1052 | #define WTF_USE_CONTENT_FILTERING 1 |
1053 | #endif |
1054 | |
1055 | #if ENABLE(YARR_JIT) |
1056 | #if CPU(ARM64) || (CPU(X86_64) && !OS(WINDOWS)) |
1057 | /* Enable JIT'ing Regular Expressions that have nested parenthesis. */ |
1058 | #define ENABLE_YARR_JIT_ALL_PARENS_EXPRESSIONS 1 |
1059 | #define ENABLE_YARR_JIT_BACKREFERENCES 1 |
1060 | #endif |
1061 | #endif |
1062 | |
1063 | #endif /* WTF_Platform_h */ |
1064 | |