1 | /* |
2 | * Copyright (C) 2006-2009, 2013-2015 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 | * |
6 | * Redistribution and use in source and binary forms, with or without |
7 | * modification, are permitted provided that the following conditions |
8 | * are met: |
9 | * 1. Redistributions of source code must retain the above copyright |
10 | * notice, this list of conditions and the following disclaimer. |
11 | * 2. Redistributions in binary form must reproduce the above copyright |
12 | * notice, this list of conditions and the following disclaimer in the |
13 | * documentation and/or other materials provided with the distribution. |
14 | * |
15 | * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY |
16 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
17 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
18 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR |
19 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
21 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
23 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ |
27 | |
28 | #ifndef WTF_Platform_h |
29 | #define WTF_Platform_h |
30 | |
31 | /* Include compiler specific macros */ |
32 | #include <wtf/Compiler.h> |
33 | |
34 | /* ==== PLATFORM handles OS, operating environment, graphics API, and |
35 | CPU. This macro will be phased out in favor of platform adaptation |
36 | macros, policy decision macros, and top-level port definitions. ==== */ |
37 | #define PLATFORM(WTF_FEATURE) (defined WTF_PLATFORM_##WTF_FEATURE && WTF_PLATFORM_##WTF_FEATURE) |
38 | |
39 | |
40 | /* ==== Platform adaptation macros: these describe properties of the target environment. ==== */ |
41 | |
42 | /* CPU() - the target CPU architecture */ |
43 | #define CPU(WTF_FEATURE) (defined WTF_CPU_##WTF_FEATURE && WTF_CPU_##WTF_FEATURE) |
44 | /* HAVE() - specific system features (headers, functions or similar) that are present or not */ |
45 | #define HAVE(WTF_FEATURE) (defined HAVE_##WTF_FEATURE && HAVE_##WTF_FEATURE) |
46 | /* OS() - underlying operating system; only to be used for mandated low-level services like |
47 | virtual memory, not to choose a GUI toolkit */ |
48 | #define OS(WTF_FEATURE) (defined WTF_OS_##WTF_FEATURE && WTF_OS_##WTF_FEATURE) |
49 | |
50 | |
51 | /* ==== Policy decision macros: these define policy choices for a particular port. ==== */ |
52 | |
53 | /* USE() - use a particular third-party library or optional OS service */ |
54 | #define USE(WTF_FEATURE) (defined USE_##WTF_FEATURE && USE_##WTF_FEATURE) |
55 | /* ENABLE() - turn on a specific feature of WebKit */ |
56 | #define ENABLE(WTF_FEATURE) (defined ENABLE_##WTF_FEATURE && ENABLE_##WTF_FEATURE) |
57 | |
58 | |
59 | /* ==== CPU() - the target CPU architecture ==== */ |
60 | |
61 | /* This also defines CPU(BIG_ENDIAN) or CPU(MIDDLE_ENDIAN) or neither, as appropriate. */ |
62 | |
63 | /* CPU(ALPHA) - DEC Alpha */ |
64 | #if defined(__alpha__) |
65 | #define WTF_CPU_ALPHA 1 |
66 | #endif |
67 | |
68 | /* CPU(HPPA) - HP PA-RISC */ |
69 | #if defined(__hppa__) || defined(__hppa64__) |
70 | #define WTF_CPU_HPPA 1 |
71 | #define WTF_CPU_BIG_ENDIAN 1 |
72 | #endif |
73 | |
74 | /* CPU(IA64) - Itanium / IA-64 */ |
75 | #if defined(__ia64__) |
76 | #define WTF_CPU_IA64 1 |
77 | /* 32-bit mode on Itanium */ |
78 | #if !defined(__LP64__) |
79 | #define WTF_CPU_IA64_32 1 |
80 | #endif |
81 | #endif |
82 | |
83 | /* CPU(MIPS) - MIPS 32-bit and 64-bit */ |
84 | #if (defined(mips) || defined(__mips__) || defined(MIPS) || defined(_MIPS_) || defined(__mips64)) |
85 | #if defined(_ABI64) && (_MIPS_SIM == _ABI64) |
86 | #define WTF_CPU_MIPS64 1 |
87 | #define WTF_MIPS_ARCH __mips64 |
88 | #else |
89 | #define WTF_CPU_MIPS 1 |
90 | #define WTF_MIPS_ARCH __mips |
91 | #endif |
92 | #if defined(__MIPSEB__) |
93 | #define WTF_CPU_BIG_ENDIAN 1 |
94 | #endif |
95 | #define WTF_MIPS_PIC (defined __PIC__) |
96 | #define WTF_MIPS_ISA(v) (defined WTF_MIPS_ARCH && WTF_MIPS_ARCH == v) |
97 | #define WTF_MIPS_ISA_AT_LEAST(v) (defined WTF_MIPS_ARCH && WTF_MIPS_ARCH >= v) |
98 | #define WTF_MIPS_ARCH_REV __mips_isa_rev |
99 | #define WTF_MIPS_ISA_REV(v) (defined WTF_MIPS_ARCH_REV && WTF_MIPS_ARCH_REV == v) |
100 | #define WTF_MIPS_DOUBLE_FLOAT (defined __mips_hard_float && !defined __mips_single_float) |
101 | #define WTF_MIPS_FP64 (defined __mips_fpr && __mips_fpr == 64) |
102 | /* MIPS requires allocators to use aligned memory */ |
103 | #define USE_ARENA_ALLOC_ALIGNMENT_INTEGER 1 |
104 | #endif /* MIPS */ |
105 | |
106 | /* CPU(PPC64) - PowerPC 64-bit Big Endian */ |
107 | #if ( defined(__ppc64__) \ |
108 | || defined(__PPC64__)) \ |
109 | && defined(__BYTE_ORDER__) \ |
110 | && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) |
111 | #define WTF_CPU_PPC64 1 |
112 | #define WTF_CPU_BIG_ENDIAN 1 |
113 | #endif |
114 | |
115 | /* CPU(PPC64) - PowerPC 64-bit Little Endian */ |
116 | #if ( defined(__ppc64__) \ |
117 | || defined(__PPC64__) \ |
118 | || defined(__ppc64le__) \ |
119 | || defined(__PPC64LE__)) \ |
120 | && defined(__BYTE_ORDER__) \ |
121 | && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) |
122 | #define WTF_CPU_PPC64LE 1 |
123 | #endif |
124 | |
125 | /* CPU(PPC) - PowerPC 32-bit */ |
126 | #if ( defined(__ppc__) \ |
127 | || defined(__PPC__) \ |
128 | || defined(__powerpc__) \ |
129 | || defined(__powerpc) \ |
130 | || defined(__POWERPC__) \ |
131 | || defined(_M_PPC) \ |
132 | || defined(__PPC)) \ |
133 | && !CPU(PPC64) \ |
134 | && defined(__BYTE_ORDER__) \ |
135 | && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) |
136 | #define WTF_CPU_PPC 1 |
137 | #define WTF_CPU_BIG_ENDIAN 1 |
138 | #endif |
139 | |
140 | /* CPU(SH4) - SuperH SH-4 */ |
141 | #if defined(__SH4__) |
142 | #define WTF_CPU_SH4 1 |
143 | #endif |
144 | |
145 | /* CPU(S390X) - S390 64-bit */ |
146 | #if defined(__s390x__) |
147 | #define WTF_CPU_S390X 1 |
148 | #define WTF_CPU_BIG_ENDIAN 1 |
149 | #endif |
150 | |
151 | /* CPU(S390) - S390 32-bit */ |
152 | #if ( defined(__s390__) \ |
153 | && !CPU(S390X)) |
154 | #define WTF_CPU_S390 1 |
155 | #define WTF_CPU_BIG_ENDIAN 1 |
156 | #endif |
157 | |
158 | /* CPU(X86) - i386 / x86 32-bit */ |
159 | #if defined(__i386__) \ |
160 | || defined(i386) \ |
161 | || defined(_M_IX86) \ |
162 | || defined(_X86_) \ |
163 | || defined(__THW_INTEL) |
164 | #define WTF_CPU_X86 1 |
165 | |
166 | #if defined(__SSE2__) || (defined(_M_IX86_FP) && _M_IX86_FP >= 2) |
167 | #define WTF_CPU_X86_SSE2 1 |
168 | #endif |
169 | |
170 | #endif |
171 | |
172 | /* CPU(X86_64) - AMD64 / Intel64 / x86_64 64-bit */ |
173 | #if defined(__x86_64__) \ |
174 | || defined(_M_X64) |
175 | #define WTF_CPU_X86_64 1 |
176 | #define WTF_CPU_X86_SSE2 1 |
177 | #endif |
178 | |
179 | /* CPU(ARM64) - Apple */ |
180 | #if (defined(__arm64__) && defined(__APPLE__)) || defined(__aarch64__) |
181 | #define WTF_CPU_ARM64 1 |
182 | #endif |
183 | |
184 | /* CPU(ARM) - ARM, any version*/ |
185 | #define WTF_ARM_ARCH_AT_LEAST(N) (CPU(ARM) && WTF_ARM_ARCH_VERSION >= N) |
186 | |
187 | #if defined(arm) \ |
188 | || defined(__arm__) \ |
189 | || defined(ARM) \ |
190 | || defined(_ARM_) |
191 | #define WTF_CPU_ARM 1 |
192 | |
193 | #if defined(__ARM_PCS_VFP) |
194 | #define WTF_CPU_ARM_HARDFP 1 |
195 | #endif |
196 | |
197 | #if defined(__ARMEB__) |
198 | #define WTF_CPU_BIG_ENDIAN 1 |
199 | |
200 | #elif !defined(__ARM_EABI__) \ |
201 | && !defined(__EABI__) \ |
202 | && !defined(__VFP_FP__) \ |
203 | && !defined(_WIN32_WCE) |
204 | #define WTF_CPU_MIDDLE_ENDIAN 1 |
205 | |
206 | #endif |
207 | |
208 | /* Set WTF_ARM_ARCH_VERSION */ |
209 | #if defined(__ARM_ARCH_4__) \ |
210 | || defined(__ARM_ARCH_4T__) \ |
211 | || defined(__MARM_ARMV4__) |
212 | #define WTF_ARM_ARCH_VERSION 4 |
213 | |
214 | #elif defined(__ARM_ARCH_5__) \ |
215 | || defined(__ARM_ARCH_5T__) \ |
216 | || defined(__MARM_ARMV5__) |
217 | #define WTF_ARM_ARCH_VERSION 5 |
218 | |
219 | #elif defined(__ARM_ARCH_5E__) \ |
220 | || defined(__ARM_ARCH_5TE__) \ |
221 | || defined(__ARM_ARCH_5TEJ__) |
222 | #define WTF_ARM_ARCH_VERSION 5 |
223 | /*ARMv5TE requires allocators to use aligned memory*/ |
224 | #define USE_ARENA_ALLOC_ALIGNMENT_INTEGER 1 |
225 | |
226 | #elif defined(__ARM_ARCH_6__) \ |
227 | || defined(__ARM_ARCH_6J__) \ |
228 | || defined(__ARM_ARCH_6K__) \ |
229 | || defined(__ARM_ARCH_6Z__) \ |
230 | || defined(__ARM_ARCH_6ZK__) \ |
231 | || defined(__ARM_ARCH_6T2__) \ |
232 | || defined(__ARMV6__) |
233 | #define WTF_ARM_ARCH_VERSION 6 |
234 | |
235 | #elif defined(__ARM_ARCH_7A__) \ |
236 | || defined(__ARM_ARCH_7K__) \ |
237 | || defined(__ARM_ARCH_7R__) \ |
238 | || defined(__ARM_ARCH_7S__) |
239 | #define WTF_ARM_ARCH_VERSION 7 |
240 | |
241 | #elif defined(__ARM_ARCH_8__) |
242 | #define WTF_ARM_ARCH_VERSION 8 |
243 | |
244 | /* MSVC sets _M_ARM */ |
245 | #elif defined(_M_ARM) |
246 | #define WTF_ARM_ARCH_VERSION _M_ARM |
247 | |
248 | /* RVCT sets _TARGET_ARCH_ARM */ |
249 | #elif defined(__TARGET_ARCH_ARM) |
250 | #define WTF_ARM_ARCH_VERSION __TARGET_ARCH_ARM |
251 | |
252 | #if defined(__TARGET_ARCH_5E) \ |
253 | || defined(__TARGET_ARCH_5TE) \ |
254 | || defined(__TARGET_ARCH_5TEJ) |
255 | /*ARMv5TE requires allocators to use aligned memory*/ |
256 | #define USE_ARENA_ALLOC_ALIGNMENT_INTEGER 1 |
257 | #endif |
258 | |
259 | #else |
260 | #define WTF_ARM_ARCH_VERSION 0 |
261 | |
262 | #endif |
263 | |
264 | /* Set WTF_THUMB_ARCH_VERSION */ |
265 | #if defined(__ARM_ARCH_4T__) |
266 | #define WTF_THUMB_ARCH_VERSION 1 |
267 | |
268 | #elif defined(__ARM_ARCH_5T__) \ |
269 | || defined(__ARM_ARCH_5TE__) \ |
270 | || defined(__ARM_ARCH_5TEJ__) |
271 | #define WTF_THUMB_ARCH_VERSION 2 |
272 | |
273 | #elif defined(__ARM_ARCH_6J__) \ |
274 | || defined(__ARM_ARCH_6K__) \ |
275 | || defined(__ARM_ARCH_6Z__) \ |
276 | || defined(__ARM_ARCH_6ZK__) \ |
277 | || defined(__ARM_ARCH_6M__) |
278 | #define WTF_THUMB_ARCH_VERSION 3 |
279 | |
280 | #elif defined(__ARM_ARCH_6T2__) \ |
281 | || defined(__ARM_ARCH_7__) \ |
282 | || defined(__ARM_ARCH_7A__) \ |
283 | || defined(__ARM_ARCH_7K__) \ |
284 | || defined(__ARM_ARCH_7M__) \ |
285 | || defined(__ARM_ARCH_7R__) \ |
286 | || defined(__ARM_ARCH_7S__) |
287 | #define WTF_THUMB_ARCH_VERSION 4 |
288 | |
289 | /* RVCT sets __TARGET_ARCH_THUMB */ |
290 | #elif defined(__TARGET_ARCH_THUMB) |
291 | #define WTF_THUMB_ARCH_VERSION __TARGET_ARCH_THUMB |
292 | |
293 | #else |
294 | #define WTF_THUMB_ARCH_VERSION 0 |
295 | #endif |
296 | |
297 | |
298 | /* CPU(ARMV5_OR_LOWER) - ARM instruction set v5 or earlier */ |
299 | /* On ARMv5 and below the natural alignment is required. |
300 | And there are some other differences for v5 or earlier. */ |
301 | #if !defined(ARMV5_OR_LOWER) && !WTF_ARM_ARCH_AT_LEAST(6) |
302 | #define WTF_CPU_ARMV5_OR_LOWER 1 |
303 | #endif |
304 | |
305 | |
306 | /* CPU(ARM_TRADITIONAL) - Thumb2 is not available, only traditional ARM (v4 or greater) */ |
307 | /* CPU(ARM_THUMB2) - Thumb2 instruction set is available */ |
308 | /* Only one of these will be defined. */ |
309 | #if !defined(WTF_CPU_ARM_TRADITIONAL) && !defined(WTF_CPU_ARM_THUMB2) |
310 | # if defined(thumb2) || defined(__thumb2__) \ |
311 | || ((defined(__thumb) || defined(__thumb__)) && WTF_THUMB_ARCH_VERSION == 4) |
312 | # define WTF_CPU_ARM_TRADITIONAL 0 |
313 | # define WTF_CPU_ARM_THUMB2 1 |
314 | # elif WTF_ARM_ARCH_AT_LEAST(4) |
315 | # define WTF_CPU_ARM_TRADITIONAL 1 |
316 | # define WTF_CPU_ARM_THUMB2 0 |
317 | # else |
318 | # error "Not supported ARM architecture" |
319 | # endif |
320 | #elif CPU(ARM_TRADITIONAL) && CPU(ARM_THUMB2) /* Sanity Check */ |
321 | # error "Cannot use both of WTF_CPU_ARM_TRADITIONAL and WTF_CPU_ARM_THUMB2 platforms" |
322 | #endif /* !defined(WTF_CPU_ARM_TRADITIONAL) && !defined(WTF_CPU_ARM_THUMB2) */ |
323 | |
324 | #if defined(__ARM_NEON__) && !defined(WTF_CPU_ARM_NEON) |
325 | #define WTF_CPU_ARM_NEON 1 |
326 | #endif |
327 | |
328 | #if CPU(ARM_NEON) |
329 | /* All NEON intrinsics usage can be disabled by this macro. */ |
330 | #define HAVE_ARM_NEON_INTRINSICS 1 |
331 | #endif |
332 | |
333 | #if (defined(__VFP_FP__) && !defined(__SOFTFP__)) |
334 | #define WTF_CPU_ARM_VFP 1 |
335 | #endif |
336 | |
337 | #if defined(__ARM_ARCH_7K__) |
338 | #define WTF_CPU_APPLE_ARMV7K 1 |
339 | #endif |
340 | |
341 | #if defined(__ARM_ARCH_7S__) |
342 | #define WTF_CPU_APPLE_ARMV7S 1 |
343 | #endif |
344 | |
345 | #if defined(__ARM_ARCH_EXT_IDIV__) || CPU(APPLE_ARMV7S) |
346 | #define HAVE_ARM_IDIV_INSTRUCTIONS 1 |
347 | #endif |
348 | |
349 | #endif /* ARM */ |
350 | |
351 | #if CPU(ARM) || CPU(MIPS) || CPU(SH4) |
352 | #define WTF_CPU_NEEDS_ALIGNED_ACCESS 1 |
353 | #endif |
354 | |
355 | /* ==== OS() - underlying operating system; only to be used for mandated low-level services like |
356 | virtual memory, not to choose a GUI toolkit ==== */ |
357 | |
358 | /* OS(AIX) - AIX */ |
359 | #ifdef _AIX |
360 | #define WTF_OS_AIX 1 |
361 | #endif |
362 | |
363 | /* OS(DARWIN) - Any Darwin-based OS, including Mac OS X and iPhone OS */ |
364 | #ifdef __APPLE__ |
365 | #define WTF_OS_DARWIN 1 |
366 | |
367 | #include <Availability.h> |
368 | #include <AvailabilityMacros.h> |
369 | #include <TargetConditionals.h> |
370 | #endif |
371 | |
372 | /* OS(IOS) - iOS */ |
373 | /* OS(MAC_OS_X) - Mac OS X (not including iOS) */ |
374 | #if OS(DARWIN) && ((defined(TARGET_OS_EMBEDDED) && TARGET_OS_EMBEDDED) \ |
375 | || (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE) \ |
376 | || (defined(TARGET_IPHONE_SIMULATOR) && TARGET_IPHONE_SIMULATOR)) |
377 | #define WTF_OS_IOS 1 |
378 | #elif OS(DARWIN) && defined(TARGET_OS_MAC) && TARGET_OS_MAC |
379 | #define WTF_OS_MAC_OS_X 1 |
380 | #endif |
381 | |
382 | /* OS(FREEBSD) - FreeBSD */ |
383 | #if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__) |
384 | #define WTF_OS_FREEBSD 1 |
385 | #endif |
386 | |
387 | /* OS(HURD) - GNU/Hurd */ |
388 | #ifdef __GNU__ |
389 | #define WTF_OS_HURD 1 |
390 | #endif |
391 | |
392 | /* OS(LINUX) - Linux */ |
393 | #ifdef __linux__ |
394 | #define WTF_OS_LINUX 1 |
395 | #endif |
396 | |
397 | /* OS(NETBSD) - NetBSD */ |
398 | #if defined(__NetBSD__) |
399 | #define WTF_OS_NETBSD 1 |
400 | #endif |
401 | |
402 | /* OS(OPENBSD) - OpenBSD */ |
403 | #ifdef __OpenBSD__ |
404 | #define WTF_OS_OPENBSD 1 |
405 | #endif |
406 | |
407 | /* OS(SOLARIS) - Solaris */ |
408 | #if defined(sun) || defined(__sun) |
409 | #define WTF_OS_SOLARIS 1 |
410 | #endif |
411 | |
412 | /* OS(WINDOWS) - Any version of Windows */ |
413 | #if defined(WIN32) || defined(_WIN32) |
414 | #define WTF_OS_WINDOWS 1 |
415 | #endif |
416 | |
417 | #define WTF_OS_WIN ERROR "USE WINDOWS WITH OS NOT WIN" |
418 | #define WTF_OS_MAC ERROR "USE MAC_OS_X WITH OS NOT MAC" |
419 | |
420 | /* OS(UNIX) - Any Unix-like system */ |
421 | #if OS(AIX) \ |
422 | || OS(DARWIN) \ |
423 | || OS(FREEBSD) \ |
424 | || OS(HURD) \ |
425 | || OS(LINUX) \ |
426 | || OS(NETBSD) \ |
427 | || OS(OPENBSD) \ |
428 | || OS(SOLARIS) \ |
429 | || defined(unix) \ |
430 | || defined(__unix) \ |
431 | || defined(__unix__) |
432 | #define WTF_OS_UNIX 1 |
433 | #endif |
434 | |
435 | /* Operating environments */ |
436 | |
437 | /* Standard libraries */ |
438 | #if defined(HAVE_FEATURES_H) && HAVE_FEATURES_H |
439 | /* If the included features.h is glibc's one, __GLIBC__ is defined. */ |
440 | #include <features.h> |
441 | #endif |
442 | |
443 | /* FIXME: these are all mixes of OS, operating environment and policy choices. */ |
444 | /* PLATFORM(QT) */ |
445 | /* PLATFORM(EFL) */ |
446 | /* PLATFORM(GTK) */ |
447 | /* PLATFORM(MAC) */ |
448 | /* PLATFORM(IOS) */ |
449 | /* PLATFORM(IOS_SIMULATOR) */ |
450 | /* PLATFORM(WIN) */ |
451 | #if defined(BUILDING_QT__) |
452 | #define WTF_PLATFORM_QT 1 |
453 | #elif defined(BUILDING_EFL__) |
454 | #define WTF_PLATFORM_EFL 1 |
455 | #elif defined(BUILDING_GTK__) |
456 | #define WTF_PLATFORM_GTK 1 |
457 | #elif OS(MAC_OS_X) |
458 | #define WTF_PLATFORM_MAC 1 |
459 | #elif OS(IOS) |
460 | #define WTF_PLATFORM_IOS 1 |
461 | #if defined(TARGET_IPHONE_SIMULATOR) && TARGET_IPHONE_SIMULATOR |
462 | #define WTF_PLATFORM_IOS_SIMULATOR 1 |
463 | #endif |
464 | #elif OS(WINDOWS) |
465 | #define WTF_PLATFORM_WIN 1 |
466 | #endif |
467 | |
468 | /* PLATFORM(COCOA) */ |
469 | #if PLATFORM(MAC) || PLATFORM(IOS) |
470 | #define WTF_PLATFORM_COCOA 1 |
471 | #endif |
472 | |
473 | #if PLATFORM(COCOA) |
474 | #if defined __has_include && __has_include(<CoreFoundation/CFPriv.h>) |
475 | #define USE_APPLE_INTERNAL_SDK 1 |
476 | #endif |
477 | #endif |
478 | |
479 | /* PLATFORM(APPLETV) */ |
480 | #if defined(TARGET_OS_TV) && TARGET_OS_TV |
481 | #define WTF_PLATFORM_APPLETV 1 |
482 | #endif |
483 | |
484 | /* PLATFORM(WATCHOS) */ |
485 | #if defined(TARGET_OS_WATCH) && TARGET_OS_WATCH |
486 | #define WTF_PLATFORM_WATCHOS 1 |
487 | #endif |
488 | |
489 | /* Graphics engines */ |
490 | |
491 | /* USE(CG) and PLATFORM(CI) */ |
492 | #if PLATFORM(COCOA) || (PLATFORM(WIN) && !USE(WINGDI) && !PLATFORM(WIN_CAIRO)) |
493 | #define USE_CG 1 |
494 | #endif |
495 | #if PLATFORM(COCOA) || (PLATFORM(WIN) && USE(CG)) |
496 | #define USE_CA 1 |
497 | #endif |
498 | |
499 | #if PLATFORM(GTK) || PLATFORM(EFL) |
500 | #define USE_CAIRO 1 |
501 | #define USE_GLIB 1 |
502 | #define USE_FREETYPE 1 |
503 | #define USE_HARFBUZZ 1 |
504 | #define USE_SOUP 1 |
505 | #define USE_WEBP 1 |
506 | #endif |
507 | |
508 | #if PLATFORM(EFL) |
509 | #define GLIB_VERSION_MIN_REQUIRED GLIB_VERSION_2_38 |
510 | #elif PLATFORM(GTK) |
511 | #define GLIB_VERSION_MIN_REQUIRED GLIB_VERSION_2_36 |
512 | #endif |
513 | |
514 | #if PLATFORM(GTK) && !defined(GTK_API_VERSION_2) |
515 | #define GDK_VERSION_MIN_REQUIRED GDK_VERSION_3_6 |
516 | #endif |
517 | |
518 | #if USE(SOUP) |
519 | #define SOUP_VERSION_MIN_REQUIRED SOUP_VERSION_2_42 |
520 | #endif |
521 | |
522 | /* On Windows, use QueryPerformanceCounter by default */ |
523 | #if OS(WINDOWS) |
524 | #define USE_QUERY_PERFORMANCE_COUNTER 1 |
525 | #endif |
526 | |
527 | #if PLATFORM(COCOA) |
528 | |
529 | #define USE_CF 1 |
530 | #define USE_FOUNDATION 1 |
531 | #define USE_NETWORK_CFDATA_ARRAY_CALLBACK 1 |
532 | #define ENABLE_USER_MESSAGE_HANDLERS 1 |
533 | #define HAVE_OUT_OF_PROCESS_LAYER_HOSTING 1 |
534 | #define HAVE_DTRACE 1 |
535 | |
536 | #if !PLATFORM(WATCHOS) && !PLATFORM(APPLETV) |
537 | #define HAVE_AVKIT 1 |
538 | #define HAVE_PARENTAL_CONTROLS 1 |
539 | #endif |
540 | |
541 | #endif |
542 | |
543 | #if PLATFORM(MAC) |
544 | |
545 | #define USE_APPKIT 1 |
546 | #define HAVE_RUNLOOP_TIMER 1 |
547 | #define HAVE_SEC_IDENTITY 1 |
548 | #define HAVE_SEC_KEYCHAIN 1 |
549 | |
550 | #if CPU(X86_64) |
551 | #define HAVE_NETWORK_EXTENSION 1 |
552 | #define USE_PLUGIN_HOST_PROCESS 1 |
553 | #endif |
554 | |
555 | /* OS X defines a series of platform macros for debugging. */ |
556 | /* Some of them are really annoying because they use common names (e.g. check()). */ |
557 | /* Disable those macros so that we are not limited in how we name methods and functions. */ |
558 | #undef __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES |
559 | #define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0 |
560 | |
561 | #endif /* PLATFORM(MAC) */ |
562 | |
563 | #if PLATFORM(IOS) |
564 | |
565 | #define HAVE_NETWORK_EXTENSION 1 |
566 | #define HAVE_READLINE 1 |
567 | #if USE(APPLE_INTERNAL_SDK) |
568 | #define USE_CFNETWORK 1 |
569 | #endif |
570 | #define USE_UIKIT_EDITING 1 |
571 | #define USE_WEB_THREAD 1 |
572 | |
573 | #if !PLATFORM(WATCHOS) && !PLATFORM(APPLETV) |
574 | #define USE_QUICK_LOOK 1 |
575 | #endif |
576 | |
577 | #if TARGET_OS_IOS |
578 | #define HAVE_APP_LINKS 1 |
579 | #endif |
580 | |
581 | #if CPU(ARM64) |
582 | #define ENABLE_JIT_CONSTANT_BLINDING 0 |
583 | #endif |
584 | |
585 | #if CPU(ARM_NEON) |
586 | #undef HAVE_ARM_NEON_INTRINSICS |
587 | #define HAVE_ARM_NEON_INTRINSICS 0 |
588 | #endif |
589 | |
590 | #endif /* PLATFORM(IOS) */ |
591 | |
592 | #if PLATFORM(WIN) && !USE(WINGDI) |
593 | #define USE_CF 1 |
594 | #endif |
595 | |
596 | #if PLATFORM(WIN) && !USE(WINGDI) && !PLATFORM(WIN_CAIRO) |
597 | #define USE_CFNETWORK 1 |
598 | #endif |
599 | |
600 | #if USE(CFNETWORK) || PLATFORM(COCOA) |
601 | #define USE_CFURLCACHE 1 |
602 | #endif |
603 | |
604 | #if PLATFORM(QT) && OS(DARWIN) |
605 | #define USE_CF 1 |
606 | #endif |
607 | |
608 | #if !defined(HAVE_ACCESSIBILITY) |
609 | #if PLATFORM(COCOA) || PLATFORM(WIN) || PLATFORM(GTK) || PLATFORM(EFL) |
610 | #define HAVE_ACCESSIBILITY 1 |
611 | #endif |
612 | #endif /* !defined(HAVE_ACCESSIBILITY) */ |
613 | |
614 | #if OS(UNIX) |
615 | #define HAVE_ERRNO_H 1 |
616 | #define HAVE_LANGINFO_H 1 |
617 | #define HAVE_MMAP 1 |
618 | #define HAVE_SIGNAL_H 1 |
619 | #define HAVE_STRINGS_H 1 |
620 | #define HAVE_SYS_PARAM_H 1 |
621 | #define HAVE_SYS_TIME_H 1 |
622 | #define USE_PTHREADS 1 |
623 | #endif /* OS(UNIX) */ |
624 | |
625 | #if (OS(FREEBSD) || OS(OPENBSD)) && !defined(__GLIBC__) |
626 | #define HAVE_PTHREAD_NP_H 1 |
627 | #endif |
628 | |
629 | #if !defined(HAVE_STRNSTR) |
630 | #if OS(DARWIN) || (OS(FREEBSD) && !defined(__GLIBC__)) |
631 | #define HAVE_STRNSTR 1 |
632 | #endif |
633 | #endif |
634 | |
635 | #if (OS(DARWIN) || OS(FREEBSD) || OS(NETBSD)) && !defined(__GLIBC__) |
636 | #define HAVE_STAT_BIRTHTIME 1 |
637 | #endif |
638 | |
639 | #if !OS(WINDOWS) && !OS(SOLARIS) |
640 | #define HAVE_TM_GMTOFF 1 |
641 | #define HAVE_TM_ZONE 1 |
642 | #define HAVE_TIMEGM 1 |
643 | #endif |
644 | |
645 | #if OS(DARWIN) |
646 | |
647 | #define HAVE_DISPATCH_H 1 |
648 | #define HAVE_MADV_FREE 1 |
649 | #define HAVE_MADV_FREE_REUSE 1 |
650 | #define HAVE_MADV_DONTNEED 1 |
651 | #define HAVE_MERGESORT 1 |
652 | #define HAVE_PTHREAD_SETNAME_NP 1 |
653 | #define HAVE_READLINE 1 |
654 | #define HAVE_SYS_TIMEB_H 1 |
655 | |
656 | #if !PLATFORM(GTK) && !PLATFORM(QT) |
657 | #define USE_ACCELERATE 1 |
658 | #endif |
659 | #if !PLATFORM(IOS) |
660 | #define HAVE_HOSTED_CORE_ANIMATION 1 |
661 | #endif |
662 | |
663 | #endif /* OS(DARWIN) */ |
664 | |
665 | #if OS(WINDOWS) |
666 | |
667 | #define HAVE_SYS_TIMEB_H 1 |
668 | #define HAVE_ALIGNED_MALLOC 1 |
669 | #define HAVE_ISDEBUGGERPRESENT 1 |
670 | |
671 | #endif |
672 | |
673 | #if OS(WINDOWS) |
674 | #define HAVE_VIRTUALALLOC 1 |
675 | #endif |
676 | |
677 | /* ENABLE macro defaults */ |
678 | |
679 | /* FIXME: move out all ENABLE() defines from here to FeatureDefines.h */ |
680 | |
681 | /* Include feature macros */ |
682 | #include <wtf/FeatureDefines.h> |
683 | |
684 | #if OS(WINDOWS) && !PLATFORM(QT) |
685 | #define USE_SYSTEM_MALLOC 1 |
686 | #endif |
687 | |
688 | #define ENABLE_DEBUG_WITH_BREAKPOINT 0 |
689 | #define ENABLE_SAMPLING_COUNTERS 0 |
690 | #define ENABLE_SAMPLING_FLAGS 0 |
691 | #define ENABLE_SAMPLING_REGIONS 0 |
692 | #define ENABLE_OPCODE_SAMPLING 0 |
693 | #define ENABLE_CODEBLOCK_SAMPLING 0 |
694 | #if ENABLE(CODEBLOCK_SAMPLING) && !ENABLE(OPCODE_SAMPLING) |
695 | #error "CODEBLOCK_SAMPLING requires OPCODE_SAMPLING" |
696 | #endif |
697 | #if ENABLE(OPCODE_SAMPLING) || ENABLE(SAMPLING_FLAGS) || ENABLE(SAMPLING_REGIONS) |
698 | #define ENABLE_SAMPLING_THREAD 1 |
699 | #endif |
700 | |
701 | #if !defined(USE_JSVALUE64) && !defined(USE_JSVALUE32_64) |
702 | #if (CPU(X86_64) && (OS(UNIX) || OS(WINDOWS))) \ |
703 | || (CPU(IA64) && !CPU(IA64_32)) \ |
704 | || CPU(ALPHA) \ |
705 | || CPU(ARM64) \ |
706 | || CPU(S390X) \ |
707 | || CPU(MIPS64) \ |
708 | || CPU(PPC64) \ |
709 | || CPU(PPC64LE) |
710 | #define USE_JSVALUE64 1 |
711 | #else |
712 | #define USE_JSVALUE32_64 1 |
713 | #endif |
714 | #endif /* !defined(USE_JSVALUE64) && !defined(USE_JSVALUE32_64) */ |
715 | |
716 | /* The JIT is enabled by default on all x86, x86-64, ARM & MIPS platforms except ARMv7k. */ |
717 | #if !defined(ENABLE_JIT) \ |
718 | && (CPU(X86) || CPU(X86_64) || CPU(ARM) || CPU(ARM64) || CPU(MIPS)) \ |
719 | && !CPU(APPLE_ARMV7K) |
720 | #define ENABLE_JIT 1 |
721 | #endif |
722 | |
723 | /* The FTL *does not* work on 32-bit platforms. Disable it even if someone asked us to enable it. */ |
724 | #if USE(JSVALUE32_64) |
725 | #undef ENABLE_FTL_JIT |
726 | #define ENABLE_FTL_JIT 0 |
727 | #endif |
728 | |
729 | /* The FTL is disabled on the iOS simulator, mostly for simplicity. */ |
730 | #if PLATFORM(IOS_SIMULATOR) |
731 | #undef ENABLE_FTL_JIT |
732 | #define ENABLE_FTL_JIT 0 |
733 | #endif |
734 | |
735 | /* If possible, try to enable a disassembler. This is optional. We proceed in two |
736 | steps: first we try to find some disassembler that we can use, and then we |
737 | decide if the high-level disassembler API can be enabled. */ |
738 | #if !defined(USE_UDIS86) && ENABLE(JIT) && ((OS(DARWIN) && !PLATFORM(EFL) && !PLATFORM(GTK)) || (OS(LINUX) && (PLATFORM(EFL) || PLATFORM(GTK) || PLATFORM(QT)))) \ |
739 | && (CPU(X86) || CPU(X86_64)) |
740 | #define USE_UDIS86 1 |
741 | #endif |
742 | |
743 | #if !defined(ENABLE_DISASSEMBLER) && USE(UDIS86) |
744 | #define ENABLE_DISASSEMBLER 1 |
745 | #endif |
746 | |
747 | #if !defined(USE_ARM64_DISASSEMBLER) && ENABLE(JIT) && CPU(ARM64) |
748 | #define USE_ARM64_DISASSEMBLER 1 |
749 | #endif |
750 | |
751 | #if !defined(USE_ARMV7_DISASSEMBLER) && ENABLE(JIT) && CPU(ARM_THUMB2) |
752 | #define USE_ARMV7_DISASSEMBLER 1 |
753 | #endif |
754 | |
755 | #if !defined(ENABLE_DISASSEMBLER) && (USE(UDIS86) || USE(ARMV7_DISASSEMBLER) || USE(ARM64_DISASSEMBLER)) |
756 | #define ENABLE_DISASSEMBLER 1 |
757 | #endif |
758 | |
759 | #if !defined(ENABLE_DFG_JIT) && ENABLE(JIT) |
760 | /* Enable the DFG JIT on X86 and X86_64. */ |
761 | #if (CPU(X86) || CPU(X86_64)) && (OS(DARWIN) || OS(LINUX) || OS(FREEBSD) || OS(WINDOWS) || OS(HURD)) |
762 | #define ENABLE_DFG_JIT 1 |
763 | #endif |
764 | /* Enable the DFG JIT on ARMv7. Only tested on iOS and Qt/GTK+ Linux. */ |
765 | #if (CPU(ARM_THUMB2) || CPU(ARM64)) && (PLATFORM(IOS) || PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(QT)) |
766 | #define ENABLE_DFG_JIT 1 |
767 | #endif |
768 | /* Enable the DFG JIT on ARM, MIPS and SH4. */ |
769 | #if CPU(ARM_TRADITIONAL) || CPU(MIPS) || CPU(SH4) |
770 | #define ENABLE_DFG_JIT 1 |
771 | #endif |
772 | #endif |
773 | |
774 | /* Concurrent JIT only works on 64-bit platforms because it requires that |
775 | values get stored to atomically. This is trivially true on 64-bit platforms, |
776 | but not true at all on 32-bit platforms where values are composed of two |
777 | separate sub-values. */ |
778 | #if ENABLE(DFG_JIT) && USE(JSVALUE64) |
779 | #define ENABLE_CONCURRENT_JIT 1 |
780 | #endif |
781 | |
782 | /* This controls whether B3 is built. It will not be used unless FTL_USES_B3 is enabled. */ |
783 | #if ENABLE(FTL_JIT) |
784 | #define ENABLE_B3_JIT 1 |
785 | #endif |
786 | |
787 | /* If the baseline jit is not available, then disable upper tiers as well: */ |
788 | #if !ENABLE(JIT) |
789 | #undef ENABLE_DFG_JIT |
790 | #undef ENABLE_FTL_JIT |
791 | #undef ENABLE_B3_JIT |
792 | #define ENABLE_DFG_JIT 0 |
793 | #define ENABLE_FTL_JIT 0 |
794 | #define ENABLE_B3_JIT 0 |
795 | #endif |
796 | |
797 | /* The SamplingProfiler is the probabilistic and low-overhead profiler used by |
798 | * JSC to measure where time is spent inside a JavaScript program. |
799 | * In configurations other than Windows and Darwin, because layout of mcontext_t depends on standard libraries (like glibc), |
800 | * sampling profiler is enabled if WebKit uses pthreads and glibc. */ |
801 | #if !defined(ENABLE_SAMPLING_PROFILER) |
802 | #if (OS(DARWIN) || OS(WINDOWS) || PLATFORM(GTK) || PLATFORM(EFL)) && ENABLE(JIT) |
803 | #define ENABLE_SAMPLING_PROFILER 1 |
804 | #else |
805 | #define ENABLE_SAMPLING_PROFILER 0 |
806 | #endif |
807 | #endif |
808 | |
809 | /* Counts uses of write barriers using sampling counters. Be sure to also |
810 | set ENABLE_SAMPLING_COUNTERS to 1. */ |
811 | #if !defined(ENABLE_WRITE_BARRIER_PROFILING) |
812 | #define ENABLE_WRITE_BARRIER_PROFILING 0 |
813 | #endif |
814 | |
815 | /* Logs all allocation-related activity that goes through fastMalloc or the |
816 | JSC GC (both cells and butterflies). Also logs marking. Note that this |
817 | isn't a completely accurate view of the heap since it doesn't include all |
818 | butterfly resize operations, doesn't tell you what is going on with weak |
819 | references (other than to tell you when they're marked), and doesn't |
820 | track direct mmap() allocations or things like JIT allocation. */ |
821 | #if !defined(ENABLE_ALLOCATION_LOGGING) |
822 | #define ENABLE_ALLOCATION_LOGGING 0 |
823 | #endif |
824 | |
825 | /* Enable verification that that register allocations are not made within generated control flow. |
826 | Turned on for debug builds. */ |
827 | #if !defined(ENABLE_DFG_REGISTER_ALLOCATION_VALIDATION) && ENABLE(DFG_JIT) |
828 | #if !defined(NDEBUG) |
829 | #define ENABLE_DFG_REGISTER_ALLOCATION_VALIDATION 1 |
830 | #else |
831 | #define ENABLE_DFG_REGISTER_ALLOCATION_VALIDATION 0 |
832 | #endif |
833 | #endif |
834 | |
835 | /* Configure the JIT */ |
836 | #if CPU(X86) && COMPILER(MSVC) |
837 | #define JSC_HOST_CALL __fastcall |
838 | #elif CPU(X86) && COMPILER(GCC_OR_CLANG) |
839 | #define JSC_HOST_CALL __attribute__ ((fastcall)) |
840 | #else |
841 | #define JSC_HOST_CALL |
842 | #endif |
843 | |
844 | /* Configure the interpreter */ |
845 | #if COMPILER(GCC_OR_CLANG) |
846 | #define HAVE_COMPUTED_GOTO 1 |
847 | #endif |
848 | |
849 | /* Determine if we need to enable Computed Goto Opcodes or not: */ |
850 | #if HAVE(COMPUTED_GOTO) || ENABLE(JIT) |
851 | #define ENABLE_COMPUTED_GOTO_OPCODES 1 |
852 | #endif |
853 | |
854 | /* Regular Expression Tracing - Set to 1 to trace RegExp's in jsc. Results dumped at exit */ |
855 | #define ENABLE_REGEXP_TRACING 0 |
856 | |
857 | /* Yet Another Regex Runtime - turned on by default for JIT enabled ports. */ |
858 | #if !defined(ENABLE_YARR_JIT) && ENABLE(JIT) |
859 | #define ENABLE_YARR_JIT 1 |
860 | |
861 | /* Setting this flag compares JIT results with interpreter results. */ |
862 | #define ENABLE_YARR_JIT_DEBUG 0 |
863 | #endif |
864 | |
865 | /* If either the JIT or the RegExp JIT is enabled, then the Assembler must be |
866 | enabled as well: */ |
867 | #if ENABLE(JIT) || ENABLE(YARR_JIT) |
868 | #if defined(ENABLE_ASSEMBLER) && !ENABLE_ASSEMBLER |
869 | #error "Cannot enable the JIT or RegExp JIT without enabling the Assembler" |
870 | #else |
871 | #undef ENABLE_ASSEMBLER |
872 | #define ENABLE_ASSEMBLER 1 |
873 | #endif |
874 | #endif |
875 | |
876 | /* If the Disassembler is enabled, then the Assembler must be enabled as well: */ |
877 | #if ENABLE(DISASSEMBLER) |
878 | #if defined(ENABLE_ASSEMBLER) && !ENABLE_ASSEMBLER |
879 | #error "Cannot enable the Disassembler without enabling the Assembler" |
880 | #else |
881 | #undef ENABLE_ASSEMBLER |
882 | #define ENABLE_ASSEMBLER 1 |
883 | #endif |
884 | #endif |
885 | |
886 | /* Enable the following if you want to use the MacroAssembler::probe() facility |
887 | to do JIT debugging. */ |
888 | #if (CPU(X86) || CPU(X86_64) || CPU(ARM64) || (CPU(ARM_THUMB2) && PLATFORM(IOS))) && ENABLE(JIT) && OS(DARWIN) && !defined(NDEBUG) |
889 | #define ENABLE_MASM_PROBE 1 |
890 | #else |
891 | #define ENABLE_MASM_PROBE 0 |
892 | #endif |
893 | |
894 | /* Pick which allocator to use; we only need an executable allocator if the assembler is compiled in. |
895 | On non-Windows x86-64, iOS, and ARM64 we use a single fixed mmap, on other platforms we mmap on demand. */ |
896 | #if ENABLE(ASSEMBLER) |
897 | #if CPU(X86_64) || PLATFORM(IOS) || CPU(ARM64) || CPU(MIPS) |
898 | #define ENABLE_EXECUTABLE_ALLOCATOR_FIXED 1 |
899 | #else |
900 | #define ENABLE_EXECUTABLE_ALLOCATOR_DEMAND 1 |
901 | #endif |
902 | #endif |
903 | |
904 | /* CSS Selector JIT Compiler */ |
905 | #if !defined(ENABLE_CSS_SELECTOR_JIT) |
906 | #if (CPU(X86_64) || CPU(ARM64) || (CPU(ARM_THUMB2) && PLATFORM(IOS))) && ENABLE(JIT) && (OS(DARWIN) || PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(QT)) |
907 | #define ENABLE_CSS_SELECTOR_JIT 1 |
908 | #else |
909 | #define ENABLE_CSS_SELECTOR_JIT 0 |
910 | #endif |
911 | #endif |
912 | |
913 | #if ENABLE(WEBGL) && PLATFORM(WIN) |
914 | #define USE_OPENGL 1 |
915 | #define USE_OPENGL_ES_2 1 |
916 | #define USE_EGL 1 |
917 | #endif |
918 | |
919 | #if ENABLE(VIDEO) && PLATFORM(WIN_CAIRO) |
920 | #if ENABLE(GSTREAMER_WINCAIRO) |
921 | #define USE_MEDIA_FOUNDATION 0 |
922 | #define USE_GLIB 1 |
923 | #define USE_GSTREAMER 1 |
924 | #else |
925 | #define USE_MEDIA_FOUNDATION 1 |
926 | #endif |
927 | #endif |
928 | |
929 | #if PLATFORM(WIN_CAIRO) || PLATFORM(QT) |
930 | #define USE_TEXTURE_MAPPER 1 |
931 | #endif |
932 | |
933 | #if USE(TEXTURE_MAPPER) && ENABLE(GRAPHICS_CONTEXT_3D) && !defined(USE_TEXTURE_MAPPER_GL) |
934 | #define USE_TEXTURE_MAPPER_GL 1 |
935 | #endif |
936 | |
937 | #if PLATFORM(COCOA) |
938 | #define USE_PROTECTION_SPACE_AUTH_CALLBACK 1 |
939 | #endif |
940 | |
941 | /* Set up a define for a common error that is intended to cause a build error -- thus the space after Error. */ |
942 | #define WTF_PLATFORM_CFNETWORK Error USE_macro_should_be_used_with_CFNETWORK |
943 | |
944 | #if PLATFORM(COCOA) && HAVE(ACCESSIBILITY) |
945 | #define USE_ACCESSIBILITY_CONTEXT_MENUS 1 |
946 | #endif |
947 | |
948 | #if CPU(ARM_THUMB2) || CPU(ARM64) |
949 | #define ENABLE_BRANCH_COMPACTION 1 |
950 | #endif |
951 | |
952 | #if !defined(ENABLE_THREADING_LIBDISPATCH) && HAVE(DISPATCH_H) |
953 | #define ENABLE_THREADING_LIBDISPATCH 1 |
954 | #elif !defined(ENABLE_THREADING_OPENMP) && defined(_OPENMP) |
955 | #define ENABLE_THREADING_OPENMP 1 |
956 | #elif !defined(THREADING_GENERIC) |
957 | #define ENABLE_THREADING_GENERIC 1 |
958 | #endif |
959 | |
960 | #if USE(GLIB) |
961 | #include <wtf/glib/GTypedefs.h> |
962 | #endif |
963 | |
964 | #if PLATFORM(EFL) |
965 | #include <wtf/efl/EflTypedefs.h> |
966 | #endif |
967 | |
968 | /* FIXME: This define won't be needed once #27551 is fully landed. However, |
969 | since most ports try to support sub-project independence, adding new headers |
970 | to WTF causes many ports to break, and so this way we can address the build |
971 | breakages one port at a time. */ |
972 | #if !defined(USE_EXPORT_MACROS) && (PLATFORM(COCOA) || PLATFORM(QT) || PLATFORM(WIN)) |
973 | #define USE_EXPORT_MACROS 1 |
974 | #endif |
975 | |
976 | #if !defined(USE_EXPORT_MACROS_FOR_TESTING) && (PLATFORM(GTK) || PLATFORM(WIN)) |
977 | #define USE_EXPORT_MACROS_FOR_TESTING 1 |
978 | #endif |
979 | |
980 | #if PLATFORM(GTK) || PLATFORM(EFL) |
981 | #define USE_UNIX_DOMAIN_SOCKETS 1 |
982 | #endif |
983 | |
984 | #if !defined(USE_IMLANG_FONT_LINK2) |
985 | #define USE_IMLANG_FONT_LINK2 1 |
986 | #endif |
987 | |
988 | #if !defined(ENABLE_GC_VALIDATION) && !defined(NDEBUG) |
989 | #define ENABLE_GC_VALIDATION 1 |
990 | #endif |
991 | |
992 | #if !defined(ENABLE_BINDING_INTEGRITY) && !OS(WINDOWS) |
993 | #define ENABLE_BINDING_INTEGRITY 1 |
994 | #endif |
995 | |
996 | #if PLATFORM(COCOA) |
997 | #define USE_AVFOUNDATION 1 |
998 | #endif |
999 | |
1000 | #if !defined(ENABLE_TREE_DEBUGGING) |
1001 | #if !defined(NDEBUG) |
1002 | #define ENABLE_TREE_DEBUGGING 1 |
1003 | #else |
1004 | #define ENABLE_TREE_DEBUGGING 0 |
1005 | #endif |
1006 | #endif |
1007 | |
1008 | #if PLATFORM(IOS) || PLATFORM(MAC) |
1009 | #define USE_COREMEDIA 1 |
1010 | #define HAVE_AVFOUNDATION_VIDEO_OUTPUT 1 |
1011 | #endif |
1012 | |
1013 | #if PLATFORM(IOS) || PLATFORM(MAC) || (OS(WINDOWS) && USE(CG)) |
1014 | #define HAVE_AVFOUNDATION_MEDIA_SELECTION_GROUP 1 |
1015 | #endif |
1016 | |
1017 | #if PLATFORM(IOS) || PLATFORM(MAC) || (OS(WINDOWS) && USE(CG)) |
1018 | #define HAVE_AVFOUNDATION_LEGIBLE_OUTPUT_SUPPORT 1 |
1019 | #define HAVE_MEDIA_ACCESSIBILITY_FRAMEWORK 1 |
1020 | #endif |
1021 | |
1022 | #if PLATFORM(IOS) || PLATFORM(MAC) |
1023 | #define HAVE_AVFOUNDATION_LOADER_DELEGATE 1 |
1024 | #endif |
1025 | |
1026 | #if PLATFORM(MAC) |
1027 | #define USE_VIDEOTOOLBOX 1 |
1028 | #endif |
1029 | |
1030 | #if PLATFORM(COCOA) || PLATFORM(GTK) || (PLATFORM(WIN) && !USE(WINGDI)) |
1031 | #define USE_REQUEST_ANIMATION_FRAME_TIMER 1 |
1032 | #endif |
1033 | |
1034 | #if PLATFORM(COCOA) |
1035 | #define USE_REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR 1 |
1036 | #endif |
1037 | |
1038 | #if PLATFORM(MAC) |
1039 | #define USE_COREAUDIO 1 |
1040 | #endif |
1041 | |
1042 | #if !defined(USE_ZLIB) |
1043 | #define USE_ZLIB 1 |
1044 | #endif |
1045 | |
1046 | #ifndef HAVE_QOS_CLASSES |
1047 | #if PLATFORM(COCOA) |
1048 | #define HAVE_QOS_CLASSES 1 |
1049 | #endif |
1050 | #endif |
1051 | |
1052 | #if PLATFORM(QT) |
1053 | #ifdef __cplusplus |
1054 | #include <qglobal.h> |
1055 | #endif |
1056 | #if defined(QT_OPENGL_ES_2) && !defined(USE_OPENGL_ES_2) |
1057 | #define USE_OPENGL_ES_2 1 |
1058 | #endif |
1059 | #endif |
1060 | |
1061 | #ifndef HAVE_VOUCHERS |
1062 | #if PLATFORM(COCOA) |
1063 | #define HAVE_VOUCHERS 1 |
1064 | #endif |
1065 | #endif |
1066 | |
1067 | #define USE_GRAMMAR_CHECKING 1 |
1068 | |
1069 | #if PLATFORM(COCOA) || PLATFORM(EFL) || PLATFORM(GTK) |
1070 | #define USE_UNIFIED_TEXT_CHECKING 1 |
1071 | #endif |
1072 | #if PLATFORM(MAC) |
1073 | #define USE_AUTOMATIC_TEXT_REPLACEMENT 1 |
1074 | #endif |
1075 | |
1076 | #if PLATFORM(MAC) |
1077 | /* Some platforms provide UI for suggesting autocorrection. */ |
1078 | #define USE_AUTOCORRECTION_PANEL 1 |
1079 | #endif |
1080 | |
1081 | #if PLATFORM(COCOA) |
1082 | /* Some platforms use spelling and autocorrection markers to provide visual cue. On such platform, if word with marker is edited, we need to remove the marker. */ |
1083 | #define USE_MARKER_REMOVAL_UPON_EDITING 1 |
1084 | #endif |
1085 | |
1086 | #if PLATFORM(MAC) |
1087 | #define USE_INSERTION_UNDO_GROUPING 1 |
1088 | #endif |
1089 | |
1090 | #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) || PLATFORM(IOS) |
1091 | #define HAVE_TIMINGDATAOPTIONS 1 |
1092 | #endif |
1093 | |
1094 | #if PLATFORM(COCOA) |
1095 | #define USE_AUDIO_SESSION 1 |
1096 | #endif |
1097 | |
1098 | #if PLATFORM(COCOA) && !PLATFORM(IOS_SIMULATOR) |
1099 | #define USE_IOSURFACE 1 |
1100 | #endif |
1101 | |
1102 | #if PLATFORM(COCOA) |
1103 | #define ENABLE_RESOURCE_USAGE 1 |
1104 | #endif |
1105 | |
1106 | #if PLATFORM(GTK) || PLATFORM(EFL) |
1107 | #undef ENABLE_OPENTYPE_VERTICAL |
1108 | #define ENABLE_OPENTYPE_VERTICAL 1 |
1109 | #define ENABLE_CSS3_TEXT_DECORATION_SKIP_INK 1 |
1110 | #endif |
1111 | |
1112 | #if PLATFORM(GTK) |
1113 | #define USE_WOFF2 1 |
1114 | #endif |
1115 | |
1116 | #if PLATFORM(COCOA) |
1117 | #define ENABLE_CSS3_TEXT_DECORATION_SKIP_INK 1 |
1118 | #endif |
1119 | |
1120 | #if PLATFORM(IOS) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED > 101000) |
1121 | #define ENABLE_PLATFORM_FONT_LOOKUP 1 |
1122 | #endif |
1123 | |
1124 | #if COMPILER(MSVC) |
1125 | #undef __STDC_LIMIT_MACROS |
1126 | #define __STDC_LIMIT_MACROS |
1127 | #endif |
1128 | |
1129 | #if PLATFORM(MAC) |
1130 | #define HAVE_NS_ACTIVITY 1 |
1131 | #endif |
1132 | |
1133 | #if (OS(DARWIN) && USE(CG)) || USE(FREETYPE) || (PLATFORM(WIN) && (USE(CG) || USE(CAIRO))) |
1134 | #undef ENABLE_OPENTYPE_MATH |
1135 | #define ENABLE_OPENTYPE_MATH 1 |
1136 | #endif |
1137 | |
1138 | /* Set TARGET_OS_IPHONE to 0 by default to allow using it as a guard |
1139 | * in cross-platform the same way as it is used in OS(DARWIN) code. */ |
1140 | #if !defined(TARGET_OS_IPHONE) && !OS(DARWIN) |
1141 | #define TARGET_OS_IPHONE 0 |
1142 | #endif |
1143 | |
1144 | #if PLATFORM(COCOA) |
1145 | #define USE_MEDIATOOLBOX 1 |
1146 | #endif |
1147 | |
1148 | /* While 10.10 has support for fences, it is missing some API important for our integration of them. */ |
1149 | #if PLATFORM(IOS) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) |
1150 | #define HAVE_COREANIMATION_FENCES 1 |
1151 | #endif |
1152 | |
1153 | #endif /* WTF_Platform_h */ |
1154 | |