1 | /* |
2 | * Copyright (C) 2006-2019 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 | #pragma once |
29 | |
30 | /* Include compiler specific macros */ |
31 | #include <wtf/Compiler.h> |
32 | |
33 | /* ==== PLATFORM handles OS, operating environment, graphics API, and |
34 | CPU. This macro will be phased out in favor of platform adaptation |
35 | macros, policy decision macros, and top-level port definitions. ==== */ |
36 | #define PLATFORM(WTF_FEATURE) (defined WTF_PLATFORM_##WTF_FEATURE && WTF_PLATFORM_##WTF_FEATURE) |
37 | |
38 | |
39 | /* ==== Platform adaptation macros: these describe properties of the target environment. ==== */ |
40 | |
41 | /* CPU() - the target CPU architecture */ |
42 | #define CPU(WTF_FEATURE) (defined WTF_CPU_##WTF_FEATURE && WTF_CPU_##WTF_FEATURE) |
43 | /* HAVE() - specific system features (headers, functions or similar) that are present or not */ |
44 | #define HAVE(WTF_FEATURE) (defined HAVE_##WTF_FEATURE && HAVE_##WTF_FEATURE) |
45 | /* OS() - underlying operating system; only to be used for mandated low-level services like |
46 | virtual memory, not to choose a GUI toolkit */ |
47 | #define OS(WTF_FEATURE) (defined WTF_OS_##WTF_FEATURE && WTF_OS_##WTF_FEATURE) |
48 | |
49 | |
50 | /* ==== Policy decision macros: these define policy choices for a particular port. ==== */ |
51 | |
52 | /* USE() - use a particular third-party library or optional OS service */ |
53 | #define USE(WTF_FEATURE) (defined USE_##WTF_FEATURE && USE_##WTF_FEATURE) |
54 | /* ENABLE() - turn on a specific feature of WebKit */ |
55 | #define ENABLE(WTF_FEATURE) (defined ENABLE_##WTF_FEATURE && ENABLE_##WTF_FEATURE) |
56 | |
57 | |
58 | /* ==== CPU() - the target CPU architecture ==== */ |
59 | /* CPU(KNOWN) becomes true if we explicitly support a target CPU. */ |
60 | |
61 | /* CPU(MIPS) - MIPS 32-bit and 64-bit */ |
62 | #if (defined(mips) || defined(__mips__) || defined(MIPS) || defined(_MIPS_) || defined(__mips64)) |
63 | #if defined(_ABI64) && (_MIPS_SIM == _ABI64) |
64 | #define WTF_CPU_MIPS64 1 |
65 | #define WTF_MIPS_ARCH __mips64 |
66 | #else |
67 | #define WTF_CPU_MIPS 1 |
68 | #define WTF_MIPS_ARCH __mips |
69 | #endif |
70 | #define WTF_CPU_KNOWN 1 |
71 | #define WTF_MIPS_PIC (defined __PIC__) |
72 | #define WTF_MIPS_ISA(v) (defined WTF_MIPS_ARCH && WTF_MIPS_ARCH == v) |
73 | #define WTF_MIPS_ISA_AT_LEAST(v) (defined WTF_MIPS_ARCH && WTF_MIPS_ARCH >= v) |
74 | #define WTF_MIPS_ARCH_REV __mips_isa_rev |
75 | #define WTF_MIPS_ISA_REV(v) (defined WTF_MIPS_ARCH_REV && WTF_MIPS_ARCH_REV == v) |
76 | #define WTF_MIPS_ISA_REV_AT_LEAST(v) (defined WTF_MIPS_ARCH_REV && WTF_MIPS_ARCH_REV >= v) |
77 | #define WTF_MIPS_DOUBLE_FLOAT (defined __mips_hard_float && !defined __mips_single_float) |
78 | #define WTF_MIPS_FP64 (defined __mips_fpr && __mips_fpr == 64) |
79 | /* MIPS requires allocators to use aligned memory */ |
80 | #define USE_ARENA_ALLOC_ALIGNMENT_INTEGER 1 |
81 | #endif /* MIPS */ |
82 | |
83 | /* CPU(PPC64) - PowerPC 64-bit Big Endian */ |
84 | #if ( defined(__ppc64__) \ |
85 | || defined(__PPC64__)) \ |
86 | && defined(__BYTE_ORDER__) \ |
87 | && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) |
88 | #define WTF_CPU_PPC64 1 |
89 | #define WTF_CPU_KNOWN 1 |
90 | #endif |
91 | |
92 | /* CPU(PPC64LE) - PowerPC 64-bit Little Endian */ |
93 | #if ( defined(__ppc64__) \ |
94 | || defined(__PPC64__) \ |
95 | || defined(__ppc64le__) \ |
96 | || defined(__PPC64LE__)) \ |
97 | && defined(__BYTE_ORDER__) \ |
98 | && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) |
99 | #define WTF_CPU_PPC64LE 1 |
100 | #define WTF_CPU_KNOWN 1 |
101 | #endif |
102 | |
103 | /* CPU(PPC) - PowerPC 32-bit */ |
104 | #if ( defined(__ppc__) \ |
105 | || defined(__PPC__) \ |
106 | || defined(__powerpc__) \ |
107 | || defined(__powerpc) \ |
108 | || defined(__POWERPC__) \ |
109 | || defined(_M_PPC) \ |
110 | || defined(__PPC)) \ |
111 | && !CPU(PPC64) \ |
112 | && CPU(BIG_ENDIAN) |
113 | #define WTF_CPU_PPC 1 |
114 | #define WTF_CPU_KNOWN 1 |
115 | #endif |
116 | |
117 | /* CPU(X86) - i386 / x86 32-bit */ |
118 | #if defined(__i386__) \ |
119 | || defined(i386) \ |
120 | || defined(_M_IX86) \ |
121 | || defined(_X86_) \ |
122 | || defined(__THW_INTEL) |
123 | #define WTF_CPU_X86 1 |
124 | #define WTF_CPU_KNOWN 1 |
125 | |
126 | #if defined(__SSE2__) || (defined(_M_IX86_FP) && _M_IX86_FP >= 2) |
127 | #define WTF_CPU_X86_SSE2 1 |
128 | #endif |
129 | |
130 | #endif |
131 | |
132 | /* CPU(X86_64) - AMD64 / Intel64 / x86_64 64-bit */ |
133 | #if defined(__x86_64__) \ |
134 | || defined(_M_X64) |
135 | #define WTF_CPU_X86_64 1 |
136 | #define WTF_CPU_X86_SSE2 1 |
137 | #define WTF_CPU_KNOWN 1 |
138 | #endif |
139 | |
140 | /* CPU(ARM64) - Apple */ |
141 | #if (defined(__arm64__) && defined(__APPLE__)) || defined(__aarch64__) |
142 | #define WTF_CPU_ARM64 1 |
143 | #define WTF_CPU_KNOWN 1 |
144 | |
145 | #if defined(__arm64e__) |
146 | #define WTF_CPU_ARM64E 1 |
147 | #endif |
148 | #endif |
149 | |
150 | /* CPU(ARM) - ARM, any version*/ |
151 | #define WTF_ARM_ARCH_AT_LEAST(N) (CPU(ARM) && WTF_ARM_ARCH_VERSION >= N) |
152 | |
153 | #if defined(arm) \ |
154 | || defined(__arm__) \ |
155 | || defined(ARM) \ |
156 | || defined(_ARM_) |
157 | #define WTF_CPU_ARM 1 |
158 | #define WTF_CPU_KNOWN 1 |
159 | |
160 | #if defined(__ARM_PCS_VFP) |
161 | #define WTF_CPU_ARM_HARDFP 1 |
162 | #endif |
163 | |
164 | /* Set WTF_ARM_ARCH_VERSION */ |
165 | #if defined(__ARM_ARCH_4__) \ |
166 | || defined(__ARM_ARCH_4T__) \ |
167 | || defined(__MARM_ARMV4__) |
168 | #define WTF_ARM_ARCH_VERSION 4 |
169 | |
170 | #elif defined(__ARM_ARCH_5__) \ |
171 | || defined(__ARM_ARCH_5T__) \ |
172 | || defined(__MARM_ARMV5__) |
173 | #define WTF_ARM_ARCH_VERSION 5 |
174 | |
175 | #elif defined(__ARM_ARCH_5E__) \ |
176 | || defined(__ARM_ARCH_5TE__) \ |
177 | || defined(__ARM_ARCH_5TEJ__) |
178 | #define WTF_ARM_ARCH_VERSION 5 |
179 | /*ARMv5TE requires allocators to use aligned memory*/ |
180 | #define USE_ARENA_ALLOC_ALIGNMENT_INTEGER 1 |
181 | |
182 | #elif defined(__ARM_ARCH_6__) \ |
183 | || defined(__ARM_ARCH_6J__) \ |
184 | || defined(__ARM_ARCH_6K__) \ |
185 | || defined(__ARM_ARCH_6Z__) \ |
186 | || defined(__ARM_ARCH_6ZK__) \ |
187 | || defined(__ARM_ARCH_6T2__) \ |
188 | || defined(__ARMV6__) |
189 | #define WTF_ARM_ARCH_VERSION 6 |
190 | |
191 | #elif defined(__ARM_ARCH_7A__) \ |
192 | || defined(__ARM_ARCH_7K__) \ |
193 | || defined(__ARM_ARCH_7R__) \ |
194 | || defined(__ARM_ARCH_7S__) |
195 | #define WTF_ARM_ARCH_VERSION 7 |
196 | |
197 | #elif defined(__ARM_ARCH_8__) \ |
198 | || defined(__ARM_ARCH_8A__) |
199 | #define WTF_ARM_ARCH_VERSION 8 |
200 | |
201 | /* MSVC sets _M_ARM */ |
202 | #elif defined(_M_ARM) |
203 | #define WTF_ARM_ARCH_VERSION _M_ARM |
204 | |
205 | /* RVCT sets _TARGET_ARCH_ARM */ |
206 | #elif defined(__TARGET_ARCH_ARM) |
207 | #define WTF_ARM_ARCH_VERSION __TARGET_ARCH_ARM |
208 | |
209 | #if defined(__TARGET_ARCH_5E) \ |
210 | || defined(__TARGET_ARCH_5TE) \ |
211 | || defined(__TARGET_ARCH_5TEJ) |
212 | /*ARMv5TE requires allocators to use aligned memory*/ |
213 | #define USE_ARENA_ALLOC_ALIGNMENT_INTEGER 1 |
214 | #endif |
215 | |
216 | #else |
217 | #define WTF_ARM_ARCH_VERSION 0 |
218 | |
219 | #endif |
220 | |
221 | /* Set WTF_THUMB_ARCH_VERSION */ |
222 | #if defined(__ARM_ARCH_4T__) |
223 | #define WTF_THUMB_ARCH_VERSION 1 |
224 | |
225 | #elif defined(__ARM_ARCH_5T__) \ |
226 | || defined(__ARM_ARCH_5TE__) \ |
227 | || defined(__ARM_ARCH_5TEJ__) |
228 | #define WTF_THUMB_ARCH_VERSION 2 |
229 | |
230 | #elif defined(__ARM_ARCH_6J__) \ |
231 | || defined(__ARM_ARCH_6K__) \ |
232 | || defined(__ARM_ARCH_6Z__) \ |
233 | || defined(__ARM_ARCH_6ZK__) \ |
234 | || defined(__ARM_ARCH_6M__) |
235 | #define WTF_THUMB_ARCH_VERSION 3 |
236 | |
237 | #elif defined(__ARM_ARCH_6T2__) \ |
238 | || defined(__ARM_ARCH_7__) \ |
239 | || defined(__ARM_ARCH_7A__) \ |
240 | || defined(__ARM_ARCH_7K__) \ |
241 | || defined(__ARM_ARCH_7M__) \ |
242 | || defined(__ARM_ARCH_7R__) \ |
243 | || defined(__ARM_ARCH_7S__) |
244 | #define WTF_THUMB_ARCH_VERSION 4 |
245 | |
246 | /* RVCT sets __TARGET_ARCH_THUMB */ |
247 | #elif defined(__TARGET_ARCH_THUMB) |
248 | #define WTF_THUMB_ARCH_VERSION __TARGET_ARCH_THUMB |
249 | |
250 | #else |
251 | #define WTF_THUMB_ARCH_VERSION 0 |
252 | #endif |
253 | |
254 | |
255 | /* CPU(ARMV5_OR_LOWER) - ARM instruction set v5 or earlier */ |
256 | /* On ARMv5 and below the natural alignment is required. |
257 | And there are some other differences for v5 or earlier. */ |
258 | #if !defined(ARMV5_OR_LOWER) && !WTF_ARM_ARCH_AT_LEAST(6) |
259 | #define WTF_CPU_ARMV5_OR_LOWER 1 |
260 | #endif |
261 | |
262 | |
263 | /* CPU(ARM_TRADITIONAL) - Thumb2 is not available, only traditional ARM (v4 or greater) */ |
264 | /* CPU(ARM_THUMB2) - Thumb2 instruction set is available */ |
265 | /* Only one of these will be defined. */ |
266 | #if !defined(WTF_CPU_ARM_TRADITIONAL) && !defined(WTF_CPU_ARM_THUMB2) |
267 | # if defined(thumb2) || defined(__thumb2__) \ |
268 | || ((defined(__thumb) || defined(__thumb__)) && WTF_THUMB_ARCH_VERSION == 4) |
269 | # define WTF_CPU_ARM_TRADITIONAL 0 |
270 | # define WTF_CPU_ARM_THUMB2 1 |
271 | # elif WTF_ARM_ARCH_AT_LEAST(4) |
272 | # define WTF_CPU_ARM_TRADITIONAL 1 |
273 | # define WTF_CPU_ARM_THUMB2 0 |
274 | # else |
275 | # error "Not supported ARM architecture" |
276 | # endif |
277 | #elif CPU(ARM_TRADITIONAL) && CPU(ARM_THUMB2) /* Sanity Check */ |
278 | # error "Cannot use both of WTF_CPU_ARM_TRADITIONAL and WTF_CPU_ARM_THUMB2 platforms" |
279 | #endif /* !defined(WTF_CPU_ARM_TRADITIONAL) && !defined(WTF_CPU_ARM_THUMB2) */ |
280 | |
281 | #if defined(__ARM_NEON__) && !defined(WTF_CPU_ARM_NEON) |
282 | #define WTF_CPU_ARM_NEON 1 |
283 | #endif |
284 | |
285 | #if CPU(ARM_NEON) |
286 | /* All NEON intrinsics usage can be disabled by this macro. */ |
287 | #define HAVE_ARM_NEON_INTRINSICS 1 |
288 | #endif |
289 | |
290 | #if (defined(__VFP_FP__) && !defined(__SOFTFP__)) |
291 | #define WTF_CPU_ARM_VFP 1 |
292 | #endif |
293 | |
294 | /* If CPU(ARM_NEON) is not enabled, we'll conservatively assume only VFP2 or VFPv3D16 |
295 | support is available. Hence, only the first 16 64-bit floating point registers |
296 | are available. See: |
297 | NEON registers: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0473c/CJACABEJ.html |
298 | VFP2 and VFP3 registers: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0473c/CIHDIBDG.html |
299 | NEON to VFP register mapping: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0473c/CJAIJHFC.html |
300 | */ |
301 | #if CPU(ARM_NEON) |
302 | #define WTF_CPU_ARM_VFP_V3_D32 1 |
303 | #else |
304 | #define WTF_CPU_ARM_VFP_V2 1 |
305 | #endif |
306 | |
307 | #if defined(__ARM_ARCH_7K__) |
308 | #define WTF_CPU_APPLE_ARMV7K 1 |
309 | #endif |
310 | |
311 | #if defined(__ARM_ARCH_7S__) |
312 | #define WTF_CPU_APPLE_ARMV7S 1 |
313 | #endif |
314 | |
315 | #if defined(__ARM_ARCH_EXT_IDIV__) || CPU(APPLE_ARMV7S) |
316 | #define HAVE_ARM_IDIV_INSTRUCTIONS 1 |
317 | #endif |
318 | |
319 | #endif /* ARM */ |
320 | |
321 | #if !CPU(KNOWN) |
322 | #define WTF_CPU_UNKNOWN 1 |
323 | #endif |
324 | |
325 | #if CPU(ARM) || CPU(MIPS) || CPU(UNKNOWN) |
326 | #define WTF_CPU_NEEDS_ALIGNED_ACCESS 1 |
327 | #endif |
328 | |
329 | #if COMPILER(GCC_COMPATIBLE) |
330 | /* __LP64__ is not defined on 64bit Windows since it uses LLP64. Using __SIZEOF_POINTER__ is simpler. */ |
331 | #if __SIZEOF_POINTER__ == 8 |
332 | #define WTF_CPU_ADDRESS64 1 |
333 | #elif __SIZEOF_POINTER__ == 4 |
334 | #define WTF_CPU_ADDRESS32 1 |
335 | #else |
336 | #error "Unsupported pointer width" |
337 | #endif |
338 | #elif COMPILER(MSVC) |
339 | #if defined(_WIN64) |
340 | #define WTF_CPU_ADDRESS64 1 |
341 | #else |
342 | #define WTF_CPU_ADDRESS32 1 |
343 | #endif |
344 | #else |
345 | /* This is the most generic way. But in OS(DARWIN), Platform.h can be included by sandbox definition file (.sb). |
346 | * At that time, we cannot include "stdint.h" header. So in the case of known compilers, we use predefined constants instead. */ |
347 | #include <stdint.h> |
348 | #if UINTPTR_MAX > UINT32_MAX |
349 | #define WTF_CPU_ADDRESS64 1 |
350 | #else |
351 | #define WTF_CPU_ADDRESS32 1 |
352 | #endif |
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_FAMILY) - iOS family, including iOS, macCatalyst, tvOS, watchOS */ |
373 | /* OS(IOS) - iOS only, not including macCatalyst */ |
374 | /* OS(MAC_OS_X) - macOS (not including iOS family) */ |
375 | #if OS(DARWIN) |
376 | #if TARGET_OS_IOS && !(defined(TARGET_OS_IOSMAC) && TARGET_OS_IOSMAC) |
377 | #define WTF_OS_IOS 1 |
378 | #endif |
379 | #if TARGET_OS_IPHONE |
380 | #define WTF_OS_IOS_FAMILY 1 |
381 | #elif TARGET_OS_MAC |
382 | #define WTF_OS_MAC_OS_X 1 |
383 | #endif |
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(FUCHSIA) - Fuchsia */ |
392 | #ifdef __Fuchsia__ |
393 | #define WTF_OS_FUCHSIA 1 |
394 | #endif |
395 | |
396 | /* OS(HURD) - GNU/Hurd */ |
397 | #ifdef __GNU__ |
398 | #define WTF_OS_HURD 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(WINDOWS) - Any version of Windows */ |
417 | #if defined(WIN32) || defined(_WIN32) |
418 | #define WTF_OS_WINDOWS 1 |
419 | #endif |
420 | |
421 | #define WTF_OS_WIN ERROR "USE WINDOWS WITH OS NOT WIN" |
422 | #define WTF_OS_MAC ERROR "USE MAC_OS_X WITH OS NOT MAC" |
423 | |
424 | /* OS(UNIX) - Any Unix-like system */ |
425 | #if OS(AIX) \ |
426 | || OS(DARWIN) \ |
427 | || OS(FREEBSD) \ |
428 | || OS(FUCHSIA) \ |
429 | || OS(HURD) \ |
430 | || OS(LINUX) \ |
431 | || OS(NETBSD) \ |
432 | || OS(OPENBSD) \ |
433 | || defined(unix) \ |
434 | || defined(__unix) \ |
435 | || defined(__unix__) |
436 | #define WTF_OS_UNIX 1 |
437 | #endif |
438 | |
439 | /* Operating environments */ |
440 | |
441 | /* CPU(BIG_ENDIAN) or CPU(MIDDLE_ENDIAN) or neither, as appropriate. */ |
442 | |
443 | #if COMPILER(GCC_COMPATIBLE) |
444 | #if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ |
445 | #define WTF_CPU_BIG_ENDIAN 1 |
446 | #elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ |
447 | #define WTF_CPU_LITTLE_ENDIAN 1 |
448 | #elif __BYTE_ORDER__ == __ORDER_PDP_ENDIAN__ |
449 | #define WTF_CPU_MIDDLE_ENDIAN 1 |
450 | #else |
451 | #error "Unknown endian" |
452 | #endif |
453 | #else |
454 | #if OS(WINDOWS) |
455 | /* Windows only have little endian architecture. */ |
456 | #define WTF_CPU_LITTLE_ENDIAN 1 |
457 | #else |
458 | #include <sys/types.h> |
459 | #if __has_include(<endian.h>) |
460 | #include <endian.h> |
461 | #if __BYTE_ORDER == __BIG_ENDIAN |
462 | #define WTF_CPU_BIG_ENDIAN 1 |
463 | #elif __BYTE_ORDER == __LITTLE_ENDIAN |
464 | #define WTF_CPU_LITTLE_ENDIAN 1 |
465 | #elif __BYTE_ORDER == __PDP_ENDIAN |
466 | #define WTF_CPU_MIDDLE_ENDIAN 1 |
467 | #else |
468 | #error "Unknown endian" |
469 | #endif |
470 | #else |
471 | #if __has_include(<machine/endian.h>) |
472 | #include <machine/endian.h> |
473 | #else |
474 | #include <sys/endian.h> |
475 | #endif |
476 | #if BYTE_ORDER == BIG_ENDIAN |
477 | #define WTF_CPU_BIG_ENDIAN 1 |
478 | #elif BYTE_ORDER == LITTLE_ENDIAN |
479 | #define WTF_CPU_LITTLE_ENDIAN 1 |
480 | #elif BYTE_ORDER == PDP_ENDIAN |
481 | #define WTF_CPU_MIDDLE_ENDIAN 1 |
482 | #else |
483 | #error "Unknown endian" |
484 | #endif |
485 | #endif |
486 | #endif |
487 | #endif |
488 | |
489 | #if !CPU(LITTLE_ENDIAN) && !CPU(BIG_ENDIAN) |
490 | #error "Unsupported endian" |
491 | #endif |
492 | |
493 | /* Export macro support. Detects the attributes available for shared library symbol export |
494 | decorations. */ |
495 | #if OS(WINDOWS) || (COMPILER_HAS_CLANG_DECLSPEC(dllimport) && COMPILER_HAS_CLANG_DECLSPEC(dllexport)) |
496 | #define USE_DECLSPEC_ATTRIBUTE 1 |
497 | #define USE_VISIBILITY_ATTRIBUTE 0 |
498 | #elif defined(__GNUC__) |
499 | #define USE_DECLSPEC_ATTRIBUTE 0 |
500 | #define USE_VISIBILITY_ATTRIBUTE 1 |
501 | #else |
502 | #define USE_DECLSPEC_ATTRIBUTE 0 |
503 | #define USE_VISIBILITY_ATTRIBUTE 0 |
504 | #endif |
505 | |
506 | /* Standard libraries */ |
507 | #if defined(HAVE_FEATURES_H) && HAVE_FEATURES_H |
508 | /* If the included features.h is glibc's one, __GLIBC__ is defined. */ |
509 | #include <features.h> |
510 | #endif |
511 | |
512 | /* FIXME: these are all mixes of OS, operating environment and policy choices. */ |
513 | /* PLATFORM(GTK) */ |
514 | /* PLATFORM(MAC) */ |
515 | /* PLATFORM(IOS) */ |
516 | /* PLATFORM(IOS_FAMILY) */ |
517 | /* PLATFORM(IOS_SIMULATOR) */ |
518 | /* PLATFORM(IOS_FAMILY_SIMULATOR) */ |
519 | /* PLATFORM(WIN) */ |
520 | #if defined(BUILDING_GTK__) |
521 | #define WTF_PLATFORM_GTK 1 |
522 | #elif defined(BUILDING_WPE__) |
523 | #define WTF_PLATFORM_WPE 1 |
524 | #elif defined(BUILDING_JSCONLY__) |
525 | /* JSCOnly does not provide PLATFORM() macro */ |
526 | #elif OS(MAC_OS_X) |
527 | #define WTF_PLATFORM_MAC 1 |
528 | #elif OS(IOS_FAMILY) |
529 | #if OS(IOS) |
530 | #define WTF_PLATFORM_IOS 1 |
531 | #endif |
532 | #define WTF_PLATFORM_IOS_FAMILY 1 |
533 | #if TARGET_OS_SIMULATOR |
534 | #if OS(IOS) |
535 | #define WTF_PLATFORM_IOS_SIMULATOR 1 |
536 | #endif |
537 | #define WTF_PLATFORM_IOS_FAMILY_SIMULATOR 1 |
538 | #endif |
539 | #if defined(TARGET_OS_IOSMAC) && TARGET_OS_IOSMAC |
540 | #define WTF_PLATFORM_MACCATALYST 1 |
541 | #endif |
542 | #elif OS(WINDOWS) |
543 | #define WTF_PLATFORM_WIN 1 |
544 | #endif |
545 | |
546 | /* PLATFORM(COCOA) */ |
547 | #if PLATFORM(MAC) || PLATFORM(IOS_FAMILY) |
548 | #define WTF_PLATFORM_COCOA 1 |
549 | #endif |
550 | |
551 | #if PLATFORM(COCOA) |
552 | #if defined __has_include && __has_include(<CoreFoundation/CFPriv.h>) |
553 | #define USE_APPLE_INTERNAL_SDK 1 |
554 | #endif |
555 | #endif |
556 | |
557 | /* PLATFORM(APPLETV) */ |
558 | #if defined(TARGET_OS_TV) && TARGET_OS_TV |
559 | #define WTF_PLATFORM_APPLETV 1 |
560 | #endif |
561 | |
562 | /* PLATFORM(WATCHOS) */ |
563 | #if defined(TARGET_OS_WATCH) && TARGET_OS_WATCH |
564 | #define WTF_PLATFORM_WATCHOS 1 |
565 | #endif |
566 | |
567 | /* Graphics engines */ |
568 | |
569 | /* USE(CG) and PLATFORM(CI) */ |
570 | #if PLATFORM(COCOA) |
571 | #define USE_CG 1 |
572 | #define USE_CA 1 |
573 | #endif |
574 | |
575 | #if PLATFORM(GTK) || PLATFORM(WPE) |
576 | #define USE_GLIB 1 |
577 | #define USE_FREETYPE 1 |
578 | #define USE_HARFBUZZ 1 |
579 | #define USE_SOUP 1 |
580 | #define USE_WEBP 1 |
581 | #define USE_FILE_LOCK 1 |
582 | #endif |
583 | |
584 | #if PLATFORM(GTK) |
585 | #define GLIB_VERSION_MIN_REQUIRED GLIB_VERSION_2_36 |
586 | #define GDK_VERSION_MIN_REQUIRED GDK_VERSION_3_6 |
587 | #endif |
588 | |
589 | #if PLATFORM(WPE) |
590 | #define GLIB_VERSION_MIN_REQUIRED GLIB_VERSION_2_40 |
591 | #endif |
592 | |
593 | #if USE(SOUP) |
594 | #define SOUP_VERSION_MIN_REQUIRED SOUP_VERSION_2_42 |
595 | #endif |
596 | |
597 | /* On Windows, use QueryPerformanceCounter by default */ |
598 | #if OS(WINDOWS) |
599 | #define USE_QUERY_PERFORMANCE_COUNTER 1 |
600 | #endif |
601 | |
602 | #if PLATFORM(COCOA) |
603 | |
604 | #define HAVE_OUT_OF_PROCESS_LAYER_HOSTING 1 |
605 | #define USE_CF 1 |
606 | #define USE_FILE_LOCK 1 |
607 | #define USE_FOUNDATION 1 |
608 | #define USE_NETWORK_CFDATA_ARRAY_CALLBACK 1 |
609 | |
610 | /* Cocoa defines a series of platform macros for debugging. */ |
611 | /* Some of them are really annoying because they use common names (e.g. check()). */ |
612 | /* Disable those macros so that we are not limited in how we name methods and functions. */ |
613 | #undef __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES |
614 | #define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0 |
615 | |
616 | #endif |
617 | |
618 | #if PLATFORM(MAC) |
619 | |
620 | #define HAVE_RUNLOOP_TIMER 1 |
621 | #define HAVE_SEC_KEYCHAIN 1 |
622 | #define USE_APPKIT 1 |
623 | #define USE_PASSKIT 1 |
624 | |
625 | #if CPU(X86_64) |
626 | #define HAVE_NETWORK_EXTENSION 1 |
627 | #define USE_PLUGIN_HOST_PROCESS 1 |
628 | #endif |
629 | #endif /* PLATFORM(MAC) */ |
630 | |
631 | #if PLATFORM(IOS_FAMILY) |
632 | |
633 | #define HAVE_NETWORK_EXTENSION 1 |
634 | #define HAVE_READLINE 1 |
635 | #define USE_UIKIT_EDITING 1 |
636 | #define USE_WEB_THREAD 1 |
637 | |
638 | #if CPU(ARM64) |
639 | #define ENABLE_JIT_CONSTANT_BLINDING 0 |
640 | #endif |
641 | |
642 | #if CPU(ARM_NEON) |
643 | #undef HAVE_ARM_NEON_INTRINSICS |
644 | #define HAVE_ARM_NEON_INTRINSICS 0 |
645 | #endif |
646 | |
647 | #endif /* PLATFORM(IOS_FAMILY) */ |
648 | |
649 | #if !defined(HAVE_ACCESSIBILITY) |
650 | #if PLATFORM(COCOA) || PLATFORM(WIN) || PLATFORM(GTK) || PLATFORM(WPE) |
651 | #define HAVE_ACCESSIBILITY 1 |
652 | #endif |
653 | #endif /* !defined(HAVE_ACCESSIBILITY) */ |
654 | |
655 | /* FIXME: Remove after CMake build enabled on Darwin */ |
656 | #if OS(DARWIN) |
657 | #define HAVE_ERRNO_H 1 |
658 | #define HAVE_LANGINFO_H 1 |
659 | #define HAVE_LOCALTIME_R 1 |
660 | #define HAVE_MMAP 1 |
661 | #define HAVE_REGEX_H 1 |
662 | #define HAVE_SIGNAL_H 1 |
663 | #define HAVE_STAT_BIRTHTIME 1 |
664 | #define HAVE_STRINGS_H 1 |
665 | #define HAVE_STRNSTR 1 |
666 | #define HAVE_SYS_PARAM_H 1 |
667 | #define HAVE_SYS_TIME_H 1 |
668 | #define HAVE_TM_GMTOFF 1 |
669 | #define HAVE_TM_ZONE 1 |
670 | #define HAVE_TIMEGM 1 |
671 | #define HAVE_PTHREAD_MAIN_NP 1 |
672 | |
673 | #if CPU(X86_64) || CPU(ARM64) |
674 | #define HAVE_INT128_T 1 |
675 | #endif |
676 | #endif /* OS(DARWIN) */ |
677 | |
678 | #if OS(UNIX) |
679 | #define USE_PTHREADS 1 |
680 | #endif /* OS(UNIX) */ |
681 | |
682 | #if OS(UNIX) && !OS(FUCHSIA) |
683 | #define HAVE_RESOURCE_H 1 |
684 | #define HAVE_PTHREAD_SETSCHEDPARAM 1 |
685 | #endif |
686 | |
687 | #if OS(DARWIN) |
688 | #define HAVE_DISPATCH_H 1 |
689 | #define HAVE_MADV_FREE 1 |
690 | #define HAVE_MADV_FREE_REUSE 1 |
691 | #define HAVE_MADV_DONTNEED 1 |
692 | #define HAVE_MERGESORT 1 |
693 | #define HAVE_PTHREAD_SETNAME_NP 1 |
694 | #define HAVE_READLINE 1 |
695 | #define HAVE_SYS_TIMEB_H 1 |
696 | |
697 | #if __has_include(<mach/mach_exc.defs>) && !PLATFORM(GTK) |
698 | #define HAVE_MACH_EXCEPTIONS 1 |
699 | #endif |
700 | |
701 | #if !PLATFORM(GTK) |
702 | #define USE_ACCELERATE 1 |
703 | #endif |
704 | #if !PLATFORM(IOS_FAMILY) |
705 | #define HAVE_HOSTED_CORE_ANIMATION 1 |
706 | #endif |
707 | |
708 | #endif /* OS(DARWIN) */ |
709 | |
710 | #if OS(DARWIN) || OS(FUCHSIA) || ((OS(FREEBSD) || defined(__GLIBC__) || defined(__BIONIC__)) && (CPU(X86) || CPU(X86_64) || CPU(ARM) || CPU(ARM64) || CPU(MIPS))) |
711 | #define HAVE_MACHINE_CONTEXT 1 |
712 | #endif |
713 | |
714 | #if OS(DARWIN) || (OS(LINUX) && defined(__GLIBC__) && !defined(__UCLIBC__)) |
715 | #define HAVE_BACKTRACE 1 |
716 | #endif |
717 | |
718 | #if OS(DARWIN) || OS(LINUX) |
719 | #if PLATFORM(GTK) |
720 | #if defined(__GLIBC__) && !defined(__UCLIBC__) |
721 | #define HAVE_BACKTRACE_SYMBOLS 1 |
722 | #endif |
723 | #endif /* PLATFORM(GTK) */ |
724 | #define HAVE_DLADDR 1 |
725 | #endif /* OS(DARWIN) || OS(LINUX) */ |
726 | |
727 | |
728 | /* ENABLE macro defaults */ |
729 | |
730 | /* FIXME: move out all ENABLE() defines from here to FeatureDefines.h */ |
731 | |
732 | #if USE(APPLE_INTERNAL_SDK) && __has_include(<WebKitAdditions/AdditionalPlatform.h>) |
733 | #include <WebKitAdditions/AdditionalPlatform.h> |
734 | #endif |
735 | |
736 | #if USE(APPLE_INTERNAL_SDK) && __has_include(<WebKitAdditions/AdditionalFeatureDefines.h>) |
737 | #include <WebKitAdditions/AdditionalFeatureDefines.h> |
738 | #endif |
739 | |
740 | /* Include feature macros */ |
741 | #include <wtf/FeatureDefines.h> |
742 | |
743 | #if OS(WINDOWS) |
744 | #define USE_SYSTEM_MALLOC 1 |
745 | #endif |
746 | |
747 | #if CPU(ADDRESS64) |
748 | #if OS(DARWIN) && CPU(ARM64) |
749 | #define WTF_CPU_EFFECTIVE_ADDRESS_WIDTH 36 |
750 | #else |
751 | /* We strongly assume that effective address width is <= 48 in 64bit architectures (e.g. NaN boxing). */ |
752 | #define WTF_CPU_EFFECTIVE_ADDRESS_WIDTH 48 |
753 | #endif |
754 | #else |
755 | #define WTF_CPU_EFFECTIVE_ADDRESS_WIDTH 32 |
756 | #endif |
757 | |
758 | #if !defined(USE_JSVALUE64) && !defined(USE_JSVALUE32_64) |
759 | #if CPU(ADDRESS64) || CPU(ARM64) |
760 | #define USE_JSVALUE64 1 |
761 | #else |
762 | #define USE_JSVALUE32_64 1 |
763 | #endif |
764 | #endif /* !defined(USE_JSVALUE64) && !defined(USE_JSVALUE32_64) */ |
765 | |
766 | /* The JIT is enabled by default on all x86-64 & ARM64 platforms. */ |
767 | #if !defined(ENABLE_JIT) \ |
768 | && (CPU(X86_64) || CPU(ARM64)) \ |
769 | && !CPU(APPLE_ARMV7K) |
770 | #define ENABLE_JIT 1 |
771 | #endif |
772 | |
773 | #if USE(JSVALUE32_64) |
774 | #if (CPU(ARM_THUMB2) || CPU(MIPS)) && OS(LINUX) |
775 | /* On ARMv7 and MIPS on Linux the JIT is enabled unless explicitly disabled. */ |
776 | #if !defined(ENABLE_JIT) |
777 | #define ENABLE_JIT 1 |
778 | #endif |
779 | #else |
780 | /* Disable JIT and force C_LOOP on all other 32bit architectures. */ |
781 | #undef ENABLE_JIT |
782 | #define ENABLE_JIT 0 |
783 | #undef ENABLE_C_LOOP |
784 | #define ENABLE_C_LOOP 1 |
785 | #endif |
786 | #endif |
787 | |
788 | #if !defined(ENABLE_C_LOOP) |
789 | #if ENABLE(JIT) \ |
790 | || CPU(X86_64) || (CPU(ARM64) && !defined(__ILP32__)) |
791 | #define ENABLE_C_LOOP 0 |
792 | #else |
793 | #define ENABLE_C_LOOP 1 |
794 | #endif |
795 | #endif |
796 | |
797 | /* The FTL *does not* work on 32-bit platforms. Disable it even if someone asked us to enable it. */ |
798 | #if USE(JSVALUE32_64) |
799 | #undef ENABLE_FTL_JIT |
800 | #define ENABLE_FTL_JIT 0 |
801 | #endif |
802 | |
803 | /* The FTL is disabled on the iOS simulator, mostly for simplicity. */ |
804 | #if PLATFORM(IOS_FAMILY_SIMULATOR) |
805 | #undef ENABLE_FTL_JIT |
806 | #define ENABLE_FTL_JIT 0 |
807 | #endif |
808 | |
809 | /* If possible, try to enable a disassembler. This is optional. We proceed in two |
810 | steps: first we try to find some disassembler that we can use, and then we |
811 | decide if the high-level disassembler API can be enabled. */ |
812 | #if !defined(USE_UDIS86) && ENABLE(JIT) && (CPU(X86) || CPU(X86_64)) && !USE(CAPSTONE) |
813 | #define USE_UDIS86 1 |
814 | #endif |
815 | |
816 | #if !defined(USE_ARM64_DISASSEMBLER) && ENABLE(JIT) && CPU(ARM64) && !USE(CAPSTONE) |
817 | #define USE_ARM64_DISASSEMBLER 1 |
818 | #endif |
819 | |
820 | #if !defined(ENABLE_DISASSEMBLER) && (USE(UDIS86) || USE(ARM64_DISASSEMBLER) || (ENABLE(JIT) && USE(CAPSTONE))) |
821 | #define ENABLE_DISASSEMBLER 1 |
822 | #endif |
823 | |
824 | #if !defined(ENABLE_DFG_JIT) && ENABLE(JIT) |
825 | /* Enable the DFG JIT on X86 and X86_64. */ |
826 | #if (CPU(X86) || CPU(X86_64)) && (OS(DARWIN) || OS(LINUX) || OS(FREEBSD) || OS(HURD) || OS(WINDOWS)) |
827 | #define ENABLE_DFG_JIT 1 |
828 | #endif |
829 | /* Enable the DFG JIT on ARMv7. Only tested on iOS, Linux, and FreeBSD. */ |
830 | #if (CPU(ARM_THUMB2) || CPU(ARM64)) && (PLATFORM(IOS_FAMILY) || OS(LINUX) || OS(FREEBSD)) |
831 | #define ENABLE_DFG_JIT 1 |
832 | #endif |
833 | /* Enable the DFG JIT on MIPS. */ |
834 | #if CPU(MIPS) |
835 | #define ENABLE_DFG_JIT 1 |
836 | #endif |
837 | #endif |
838 | |
839 | /* Concurrent JS only works on 64-bit platforms because it requires that |
840 | values get stored to atomically. This is trivially true on 64-bit platforms, |
841 | but not true at all on 32-bit platforms where values are composed of two |
842 | separate sub-values. */ |
843 | #if ENABLE(DFG_JIT) && USE(JSVALUE64) |
844 | #define ENABLE_CONCURRENT_JS 1 |
845 | #endif |
846 | |
847 | #if __has_include(<System/pthread_machdep.h>) |
848 | #define HAVE_FAST_TLS 1 |
849 | #endif |
850 | |
851 | #if (CPU(X86_64) || CPU(ARM64)) && HAVE(FAST_TLS) |
852 | #define ENABLE_FAST_TLS_JIT 1 |
853 | #endif |
854 | |
855 | #if CPU(X86) || CPU(X86_64) || CPU(ARM_THUMB2) || CPU(ARM64) || CPU(MIPS) |
856 | #define ENABLE_MASM_PROBE 1 |
857 | #else |
858 | #define ENABLE_MASM_PROBE 0 |
859 | #endif |
860 | |
861 | #if !ENABLE(JIT) |
862 | #undef ENABLE_MASM_PROBE |
863 | #define ENABLE_MASM_PROBE 0 |
864 | #endif |
865 | |
866 | /* If the baseline jit is not available, then disable upper tiers as well. |
867 | The MacroAssembler::probe() is also required for supporting the upper tiers. */ |
868 | #if !ENABLE(JIT) || !ENABLE(MASM_PROBE) |
869 | #undef ENABLE_DFG_JIT |
870 | #undef ENABLE_FTL_JIT |
871 | #define ENABLE_DFG_JIT 0 |
872 | #define ENABLE_FTL_JIT 0 |
873 | #endif |
874 | |
875 | /* If the DFG jit is not available, then disable upper tiers as well: */ |
876 | #if !ENABLE(DFG_JIT) |
877 | #undef ENABLE_FTL_JIT |
878 | #define ENABLE_FTL_JIT 0 |
879 | #endif |
880 | |
881 | /* This controls whether B3 is built. B3 is needed for FTL JIT and WebAssembly */ |
882 | #if ENABLE(FTL_JIT) |
883 | #define ENABLE_B3_JIT 1 |
884 | #endif |
885 | |
886 | #if !defined(ENABLE_WEBASSEMBLY) |
887 | #if ENABLE(B3_JIT) && PLATFORM(COCOA) && CPU(ADDRESS64) |
888 | #define ENABLE_WEBASSEMBLY 1 |
889 | #else |
890 | #define ENABLE_WEBASSEMBLY 0 |
891 | #endif |
892 | #endif |
893 | |
894 | /* The SamplingProfiler is the probabilistic and low-overhead profiler used by |
895 | * JSC to measure where time is spent inside a JavaScript program. |
896 | * In configurations other than Windows and Darwin, because layout of mcontext_t depends on standard libraries (like glibc), |
897 | * sampling profiler is enabled if WebKit uses pthreads and glibc. */ |
898 | #if !defined(ENABLE_SAMPLING_PROFILER) |
899 | #if !ENABLE(C_LOOP) && (OS(WINDOWS) || HAVE(MACHINE_CONTEXT)) |
900 | #define ENABLE_SAMPLING_PROFILER 1 |
901 | #else |
902 | #define ENABLE_SAMPLING_PROFILER 0 |
903 | #endif |
904 | #endif |
905 | |
906 | #if ENABLE(WEBASSEMBLY) && HAVE(MACHINE_CONTEXT) |
907 | #define ENABLE_WEBASSEMBLY_FAST_MEMORY 1 |
908 | #endif |
909 | |
910 | /* Counts uses of write barriers using sampling counters. Be sure to also |
911 | set ENABLE_SAMPLING_COUNTERS to 1. */ |
912 | #if !defined(ENABLE_WRITE_BARRIER_PROFILING) |
913 | #define ENABLE_WRITE_BARRIER_PROFILING 0 |
914 | #endif |
915 | |
916 | /* Logs all allocation-related activity that goes through fastMalloc or the |
917 | JSC GC (both cells and butterflies). Also logs marking. Note that this |
918 | isn't a completely accurate view of the heap since it doesn't include all |
919 | butterfly resize operations, doesn't tell you what is going on with weak |
920 | references (other than to tell you when they're marked), and doesn't |
921 | track direct mmap() allocations or things like JIT allocation. */ |
922 | #if !defined(ENABLE_ALLOCATION_LOGGING) |
923 | #define ENABLE_ALLOCATION_LOGGING 0 |
924 | #endif |
925 | |
926 | /* Enable verification that that register allocations are not made within generated control flow. |
927 | Turned on for debug builds. */ |
928 | #if !defined(ENABLE_DFG_REGISTER_ALLOCATION_VALIDATION) && ENABLE(DFG_JIT) |
929 | #if !defined(NDEBUG) |
930 | #define ENABLE_DFG_REGISTER_ALLOCATION_VALIDATION 1 |
931 | #else |
932 | #define ENABLE_DFG_REGISTER_ALLOCATION_VALIDATION 0 |
933 | #endif |
934 | #endif |
935 | |
936 | /* Configure the JIT */ |
937 | #if CPU(X86) && COMPILER(MSVC) |
938 | #define JSC_HOST_CALL __fastcall |
939 | #elif CPU(X86) && COMPILER(GCC_COMPATIBLE) |
940 | #define JSC_HOST_CALL __attribute__ ((fastcall)) |
941 | #else |
942 | #define JSC_HOST_CALL |
943 | #endif |
944 | |
945 | #if CPU(X86) && OS(WINDOWS) |
946 | #define CALLING_CONVENTION_IS_STDCALL 1 |
947 | #ifndef CDECL |
948 | #if COMPILER(MSVC) |
949 | #define CDECL __cdecl |
950 | #else |
951 | #define CDECL __attribute__ ((__cdecl)) |
952 | #endif |
953 | #endif |
954 | #else |
955 | #define CALLING_CONVENTION_IS_STDCALL 0 |
956 | #endif |
957 | |
958 | #if CPU(X86) |
959 | #define WTF_COMPILER_SUPPORTS_FASTCALL_CALLING_CONVENTION 1 |
960 | #ifndef FASTCALL |
961 | #if COMPILER(MSVC) |
962 | #define FASTCALL __fastcall |
963 | #else |
964 | #define FASTCALL __attribute__ ((fastcall)) |
965 | #endif |
966 | #endif |
967 | #else |
968 | #define WTF_COMPILER_SUPPORTS_FASTCALL_CALLING_CONVENTION 0 |
969 | #endif |
970 | |
971 | #if ENABLE(JIT) && CALLING_CONVENTION_IS_STDCALL |
972 | #define JIT_OPERATION CDECL |
973 | #else |
974 | #define JIT_OPERATION |
975 | #endif |
976 | |
977 | #if PLATFORM(IOS_FAMILY) && CPU(ARM64) && (!ENABLE(FAST_JIT_PERMISSIONS) || !CPU(ARM64E)) |
978 | #define ENABLE_SEPARATED_WX_HEAP 1 |
979 | #else |
980 | #define ENABLE_SEPARATED_WX_HEAP 0 |
981 | #endif |
982 | |
983 | /* Configure the interpreter */ |
984 | #if COMPILER(GCC_COMPATIBLE) |
985 | #define HAVE_COMPUTED_GOTO 1 |
986 | #endif |
987 | |
988 | /* Determine if we need to enable Computed Goto Opcodes or not: */ |
989 | #if HAVE(COMPUTED_GOTO) || !ENABLE(C_LOOP) |
990 | #define ENABLE_COMPUTED_GOTO_OPCODES 1 |
991 | #endif |
992 | |
993 | #if !defined(USE_LLINT_EMBEDDED_OPCODE_ID) && !ENABLE(C_LOOP) && !COMPILER(MSVC) && \ |
994 | (CPU(X86) || CPU(X86_64) || CPU(ARM64) || (CPU(ARM_THUMB2) && OS(DARWIN))) |
995 | /* This feature works by embedding the OpcodeID in the 32 bit just before the generated LLint code |
996 | that executes each opcode. It cannot be supported by the CLoop since there's no way to embed the |
997 | OpcodeID word in the CLoop's switch statement cases. It is also currently not implemented for MSVC. |
998 | */ |
999 | #define USE_LLINT_EMBEDDED_OPCODE_ID 1 |
1000 | #endif |
1001 | |
1002 | /* Regular Expression Tracing - Set to 1 to trace RegExp's in jsc. Results dumped at exit */ |
1003 | #define ENABLE_REGEXP_TRACING 0 |
1004 | |
1005 | /* Yet Another Regex Runtime - turned on by default for JIT enabled ports. */ |
1006 | #if !defined(ENABLE_YARR_JIT) && ENABLE(JIT) |
1007 | #define ENABLE_YARR_JIT 1 |
1008 | |
1009 | /* Setting this flag compares JIT results with interpreter results. */ |
1010 | #define ENABLE_YARR_JIT_DEBUG 0 |
1011 | #endif |
1012 | |
1013 | #if ENABLE(YARR_JIT) |
1014 | #if CPU(ARM64) || (CPU(X86_64) && !OS(WINDOWS)) |
1015 | /* Enable JIT'ing Regular Expressions that have nested parenthesis and back references. */ |
1016 | #define ENABLE_YARR_JIT_ALL_PARENS_EXPRESSIONS 1 |
1017 | #define ENABLE_YARR_JIT_BACKREFERENCES 1 |
1018 | #endif |
1019 | #endif |
1020 | |
1021 | /* If either the JIT or the RegExp JIT is enabled, then the Assembler must be |
1022 | enabled as well: */ |
1023 | #if ENABLE(JIT) || ENABLE(YARR_JIT) || !ENABLE(C_LOOP) |
1024 | #if defined(ENABLE_ASSEMBLER) && !ENABLE_ASSEMBLER |
1025 | #error "Cannot enable the JIT or RegExp JIT without enabling the Assembler" |
1026 | #else |
1027 | #undef ENABLE_ASSEMBLER |
1028 | #define ENABLE_ASSEMBLER 1 |
1029 | #endif |
1030 | #endif |
1031 | |
1032 | /* If the Disassembler is enabled, then the Assembler must be enabled as well: */ |
1033 | #if ENABLE(DISASSEMBLER) |
1034 | #if defined(ENABLE_ASSEMBLER) && !ENABLE_ASSEMBLER |
1035 | #error "Cannot enable the Disassembler without enabling the Assembler" |
1036 | #else |
1037 | #undef ENABLE_ASSEMBLER |
1038 | #define ENABLE_ASSEMBLER 1 |
1039 | #endif |
1040 | #endif |
1041 | |
1042 | #ifndef ENABLE_EXCEPTION_SCOPE_VERIFICATION |
1043 | #ifdef NDEBUG |
1044 | #define ENABLE_EXCEPTION_SCOPE_VERIFICATION 0 |
1045 | #else |
1046 | #define ENABLE_EXCEPTION_SCOPE_VERIFICATION 1 |
1047 | #endif |
1048 | #endif |
1049 | |
1050 | #if ENABLE(DFG_JIT) && HAVE(MACHINE_CONTEXT) && (CPU(X86) || CPU(X86_64) || CPU(ARM64)) |
1051 | #define ENABLE_SIGNAL_BASED_VM_TRAPS 1 |
1052 | #endif |
1053 | |
1054 | /* CSS Selector JIT Compiler */ |
1055 | #if !defined(ENABLE_CSS_SELECTOR_JIT) |
1056 | #if (CPU(X86_64) || CPU(ARM64) || (CPU(ARM_THUMB2) && PLATFORM(IOS_FAMILY))) && ENABLE(JIT) && (OS(DARWIN) || PLATFORM(GTK) || PLATFORM(WPE)) |
1057 | #define ENABLE_CSS_SELECTOR_JIT 1 |
1058 | #else |
1059 | #define ENABLE_CSS_SELECTOR_JIT 0 |
1060 | #endif |
1061 | #endif |
1062 | |
1063 | #if CPU(ARM64E) && OS(DARWIN) |
1064 | #define HAVE_FJCVTZS_INSTRUCTION 1 |
1065 | #endif |
1066 | |
1067 | #if PLATFORM(IOS) |
1068 | #define HAVE_APP_LINKS 1 |
1069 | #define USE_PASSKIT 1 |
1070 | #define USE_QUICK_LOOK 1 |
1071 | #define USE_SYSTEM_PREVIEW 1 |
1072 | #endif |
1073 | |
1074 | #if PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST) |
1075 | #define HAVE_CELESTIAL 1 |
1076 | #define HAVE_CORE_ANIMATION_RENDER_SERVER 1 |
1077 | #endif |
1078 | |
1079 | #if PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST) && !PLATFORM(APPLETV) |
1080 | #define HAVE_PARENTAL_CONTROLS_WITH_UNBLOCK_HANDLER 1 |
1081 | #endif |
1082 | |
1083 | #if PLATFORM(COCOA) |
1084 | |
1085 | #define USE_AVFOUNDATION 1 |
1086 | #define USE_PROTECTION_SPACE_AUTH_CALLBACK 1 |
1087 | |
1088 | #if !PLATFORM(WATCHOS) && !PLATFORM(APPLETV) && !PLATFORM(MACCATALYST) |
1089 | #define ENABLE_DATA_DETECTION 1 |
1090 | #endif |
1091 | |
1092 | #if !PLATFORM(APPLETV) |
1093 | #define HAVE_PARENTAL_CONTROLS 1 |
1094 | #endif |
1095 | |
1096 | #if !PLATFORM(APPLETV) |
1097 | #define HAVE_AVKIT 1 |
1098 | #endif |
1099 | |
1100 | #if ENABLE(WEBGL) |
1101 | /* USE_ANGLE=1 uses ANGLE for the WebGL backend. |
1102 | It replaces USE_OPENGL, USE_OPENGL_ES and USE_EGL. */ |
1103 | #if PLATFORM(MAC) |
1104 | #define USE_OPENGL 1 |
1105 | #define USE_OPENGL_ES 0 |
1106 | #define USE_ANGLE 0 |
1107 | #elif PLATFORM(MACCATALYST) && __has_include(<OpenGL/OpenGL.h>) |
1108 | #define USE_OPENGL 1 |
1109 | #define USE_OPENGL_ES 0 |
1110 | #define USE_ANGLE 0 |
1111 | #else |
1112 | #define USE_OPENGL 0 |
1113 | #define USE_OPENGL_ES 1 |
1114 | #define USE_ANGLE 0 |
1115 | #endif |
1116 | #if PLATFORM(COCOA) |
1117 | #ifndef GL_SILENCE_DEPRECATION |
1118 | #define GL_SILENCE_DEPRECATION 1 |
1119 | #endif |
1120 | #endif |
1121 | #endif |
1122 | |
1123 | #define USE_METAL 1 |
1124 | |
1125 | #if HAVE(ACCESSIBILITY) |
1126 | #define USE_ACCESSIBILITY_CONTEXT_MENUS 1 |
1127 | #endif |
1128 | |
1129 | #endif |
1130 | |
1131 | #if ENABLE(WEBGL) && PLATFORM(WIN) |
1132 | #define USE_OPENGL 1 |
1133 | #define USE_OPENGL_ES 1 |
1134 | #define USE_EGL 1 |
1135 | #endif |
1136 | |
1137 | #if ENABLE(WEBGL) |
1138 | #if !defined(USE_ANGLE) |
1139 | #define USE_ANGLE 0 |
1140 | #endif |
1141 | |
1142 | #if (USE_ANGLE && (USE_OPENGL || USE_OPENGL_ES || (defined(USE_EGL) && USE_EGL))) |
1143 | #error USE_ANGLE is incompatible with USE_OPENGL, USE_OPENGL_ES and USE_EGL |
1144 | #endif |
1145 | #endif |
1146 | |
1147 | #if USE(TEXTURE_MAPPER) && ENABLE(GRAPHICS_CONTEXT_3D) && !defined(USE_TEXTURE_MAPPER_GL) |
1148 | #define USE_TEXTURE_MAPPER_GL 1 |
1149 | #endif |
1150 | |
1151 | #if CPU(ARM_THUMB2) || CPU(ARM64) |
1152 | #define ENABLE_BRANCH_COMPACTION 1 |
1153 | #endif |
1154 | |
1155 | #if !defined(ENABLE_THREADING_LIBDISPATCH) && HAVE(DISPATCH_H) |
1156 | #define ENABLE_THREADING_LIBDISPATCH 1 |
1157 | #elif !defined(ENABLE_THREADING_OPENMP) && defined(_OPENMP) |
1158 | #define ENABLE_THREADING_OPENMP 1 |
1159 | #elif !defined(THREADING_GENERIC) |
1160 | #define ENABLE_THREADING_GENERIC 1 |
1161 | #endif |
1162 | |
1163 | #if USE(GLIB) |
1164 | #include <wtf/glib/GTypedefs.h> |
1165 | #endif |
1166 | |
1167 | #if !defined(USE_EXPORT_MACROS) && (PLATFORM(COCOA) || OS(WINDOWS)) |
1168 | #define USE_EXPORT_MACROS 1 |
1169 | #endif |
1170 | |
1171 | #if PLATFORM(GTK) || PLATFORM(WPE) |
1172 | #define USE_UNIX_DOMAIN_SOCKETS 1 |
1173 | #endif |
1174 | |
1175 | #if !defined(USE_IMLANG_FONT_LINK2) |
1176 | #define USE_IMLANG_FONT_LINK2 1 |
1177 | #endif |
1178 | |
1179 | #if !defined(ENABLE_GC_VALIDATION) && !defined(NDEBUG) |
1180 | #define ENABLE_GC_VALIDATION 1 |
1181 | #endif |
1182 | |
1183 | #if !defined(ENABLE_BINDING_INTEGRITY) && !OS(WINDOWS) |
1184 | #define ENABLE_BINDING_INTEGRITY 1 |
1185 | #endif |
1186 | |
1187 | #if !defined(ENABLE_TREE_DEBUGGING) |
1188 | #if !defined(NDEBUG) |
1189 | #define ENABLE_TREE_DEBUGGING 1 |
1190 | #else |
1191 | #define ENABLE_TREE_DEBUGGING 0 |
1192 | #endif |
1193 | #endif |
1194 | |
1195 | #if PLATFORM(IOS_FAMILY) || PLATFORM(MAC) |
1196 | #define USE_COREMEDIA 1 |
1197 | #define USE_VIDEOTOOLBOX 1 |
1198 | #define HAVE_AVFOUNDATION_VIDEO_OUTPUT 1 |
1199 | #define HAVE_CORE_VIDEO 1 |
1200 | #define HAVE_MEDIA_PLAYER 1 |
1201 | #endif |
1202 | |
1203 | #if PLATFORM(IOS_FAMILY) || PLATFORM(MAC) |
1204 | #define HAVE_AVFOUNDATION_MEDIA_SELECTION_GROUP 1 |
1205 | #endif |
1206 | |
1207 | #if PLATFORM(IOS_FAMILY) || PLATFORM(MAC) |
1208 | #define HAVE_AVFOUNDATION_LEGIBLE_OUTPUT_SUPPORT 1 |
1209 | #define HAVE_MEDIA_ACCESSIBILITY_FRAMEWORK 1 |
1210 | #endif |
1211 | |
1212 | #if PLATFORM(IOS_FAMILY) || PLATFORM(MAC) |
1213 | #define HAVE_AVFOUNDATION_LOADER_DELEGATE 1 |
1214 | #endif |
1215 | |
1216 | #if !PLATFORM(WIN) |
1217 | #define USE_REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR 1 |
1218 | #endif |
1219 | |
1220 | #if PLATFORM(MAC) |
1221 | #define HAVE_APPLE_GRAPHICS_CONTROL 1 |
1222 | #define USE_COREAUDIO 1 |
1223 | #endif |
1224 | |
1225 | #if !defined(USE_ZLIB) |
1226 | #define USE_ZLIB 1 |
1227 | #endif |
1228 | |
1229 | #ifndef HAVE_QOS_CLASSES |
1230 | #if PLATFORM(COCOA) |
1231 | #define HAVE_QOS_CLASSES 1 |
1232 | #endif |
1233 | #endif |
1234 | |
1235 | #ifndef HAVE_VOUCHERS |
1236 | #if PLATFORM(COCOA) |
1237 | #define HAVE_VOUCHERS 1 |
1238 | #endif |
1239 | #endif |
1240 | |
1241 | #define USE_GRAMMAR_CHECKING 1 |
1242 | |
1243 | #if PLATFORM(COCOA) || PLATFORM(GTK) |
1244 | #define USE_UNIFIED_TEXT_CHECKING 1 |
1245 | #endif |
1246 | #if PLATFORM(MAC) |
1247 | #define USE_AUTOMATIC_TEXT_REPLACEMENT 1 |
1248 | #endif |
1249 | |
1250 | #if PLATFORM(MAC) |
1251 | /* Some platforms provide UI for suggesting autocorrection. */ |
1252 | #define USE_AUTOCORRECTION_PANEL 1 |
1253 | #endif |
1254 | |
1255 | #if PLATFORM(COCOA) |
1256 | /* 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. */ |
1257 | #define USE_MARKER_REMOVAL_UPON_EDITING 1 |
1258 | #endif |
1259 | |
1260 | #if PLATFORM(MAC) |
1261 | #define USE_INSERTION_UNDO_GROUPING 1 |
1262 | #endif |
1263 | |
1264 | #if PLATFORM(MAC) || PLATFORM(IOS_FAMILY) |
1265 | #define HAVE_AVASSETREADER 1 |
1266 | #endif |
1267 | |
1268 | #if PLATFORM(COCOA) |
1269 | #define HAVE_TIMINGDATAOPTIONS 1 |
1270 | #endif |
1271 | |
1272 | #if PLATFORM(COCOA) |
1273 | #define USE_AUDIO_SESSION 1 |
1274 | #endif |
1275 | |
1276 | #if PLATFORM(COCOA) && !PLATFORM(IOS_FAMILY_SIMULATOR) |
1277 | #define HAVE_IOSURFACE 1 |
1278 | #endif |
1279 | |
1280 | #if PLATFORM(IOS_FAMILY) && !PLATFORM(IOS_FAMILY_SIMULATOR) && !PLATFORM(MACCATALYST) |
1281 | #define HAVE_IOSURFACE_ACCELERATOR 1 |
1282 | #endif |
1283 | |
1284 | #if PLATFORM(COCOA) |
1285 | #define ENABLE_RESOURCE_USAGE 1 |
1286 | #endif |
1287 | |
1288 | #if PLATFORM(GTK) || PLATFORM(WPE) |
1289 | #undef ENABLE_OPENTYPE_VERTICAL |
1290 | #define ENABLE_OPENTYPE_VERTICAL 1 |
1291 | #endif |
1292 | |
1293 | #if COMPILER(MSVC) |
1294 | #undef __STDC_FORMAT_MACROS |
1295 | #define __STDC_FORMAT_MACROS |
1296 | #undef __STDC_LIMIT_MACROS |
1297 | #define __STDC_LIMIT_MACROS |
1298 | #endif |
1299 | |
1300 | #if PLATFORM(MAC) |
1301 | #define HAVE_NS_ACTIVITY 1 |
1302 | #endif |
1303 | |
1304 | /* Disable SharedArrayBuffers until Spectre security concerns are mitigated. */ |
1305 | #define ENABLE_SHARED_ARRAY_BUFFER 0 |
1306 | |
1307 | #if (OS(DARWIN) && USE(CG)) || (USE(FREETYPE) && !PLATFORM(GTK)) || (PLATFORM(WIN) && (USE(CG) || USE(CAIRO))) |
1308 | #undef ENABLE_OPENTYPE_MATH |
1309 | #define ENABLE_OPENTYPE_MATH 1 |
1310 | #endif |
1311 | |
1312 | /* Set TARGET_OS_IPHONE to 0 by default to allow using it as a guard |
1313 | * in cross-platform the same way as it is used in OS(DARWIN) code. */ |
1314 | #if !defined(TARGET_OS_IPHONE) && !OS(DARWIN) |
1315 | #define TARGET_OS_IPHONE 0 |
1316 | #endif |
1317 | |
1318 | #if PLATFORM(COCOA) |
1319 | #define USE_MEDIATOOLBOX 1 |
1320 | #endif |
1321 | |
1322 | #if PLATFORM(MAC) || PLATFORM(IOS_FAMILY) |
1323 | #define USE_OS_LOG 1 |
1324 | #if USE(APPLE_INTERNAL_SDK) |
1325 | #define USE_OS_STATE 1 |
1326 | #endif |
1327 | #endif |
1328 | |
1329 | #if PLATFORM(COCOA) |
1330 | #define HAVE_SEC_TRUST_SERIALIZATION 1 |
1331 | #endif |
1332 | |
1333 | #if !defined(WTF_DEFAULT_EVENT_LOOP) |
1334 | #define WTF_DEFAULT_EVENT_LOOP 1 |
1335 | #endif |
1336 | |
1337 | #if WTF_DEFAULT_EVENT_LOOP |
1338 | #if USE(GLIB) |
1339 | /* Use GLib's event loop abstraction. Primarily GTK port uses it. */ |
1340 | #define USE_GLIB_EVENT_LOOP 1 |
1341 | #elif OS(WINDOWS) |
1342 | /* Use Windows message pump abstraction. |
1343 | * Even if the port is AppleWin, we use the Windows message pump system for the event loop, |
1344 | * so that USE(WINDOWS_EVENT_LOOP) && USE(CF) can be true. |
1345 | * And PLATFORM(WIN) and PLATFORM(GTK) are exclusive. If the port is GTK, |
1346 | * PLATFORM(WIN) should be false. And in that case, GLib's event loop is used. |
1347 | */ |
1348 | #define USE_WINDOWS_EVENT_LOOP 1 |
1349 | #elif PLATFORM(COCOA) |
1350 | /* OS X and IOS. Use CoreFoundation & GCD abstraction. */ |
1351 | #define USE_COCOA_EVENT_LOOP 1 |
1352 | #else |
1353 | #define USE_GENERIC_EVENT_LOOP 1 |
1354 | #endif |
1355 | #endif |
1356 | |
1357 | #if PLATFORM(MAC) || PLATFORM(IOS_FAMILY) |
1358 | #define USE_MEDIAREMOTE 1 |
1359 | #endif |
1360 | |
1361 | #if COMPILER(MSVC) |
1362 | /* Enable strict runtime stack buffer checks. */ |
1363 | #pragma strict_gs_check(on) |
1364 | #endif |
1365 | |
1366 | #if PLATFORM(MAC) |
1367 | #define HAVE_TOUCH_BAR 1 |
1368 | #define USE_DICTATION_ALTERNATIVES 1 |
1369 | |
1370 | #if defined(__LP64__) |
1371 | #define ENABLE_WEB_PLAYBACK_CONTROLS_MANAGER 1 |
1372 | #endif |
1373 | #endif /* PLATFORM(MAC) */ |
1374 | |
1375 | #if PLATFORM(COCOA) && ENABLE(WEB_RTC) |
1376 | #define USE_LIBWEBRTC 1 |
1377 | #endif |
1378 | |
1379 | #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || PLATFORM(IOS) || PLATFORM(MACCATALYST) || USE(GCRYPT) |
1380 | #define HAVE_RSA_PSS 1 |
1381 | #endif |
1382 | |
1383 | #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) || PLATFORM(IOS_FAMILY) |
1384 | #define USE_SOURCE_APPLICATION_AUDIT_DATA 1 |
1385 | #endif |
1386 | |
1387 | #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000) |
1388 | #define HAVE_HSTS_STORAGE_PATH 1 |
1389 | #endif |
1390 | |
1391 | #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) || PLATFORM(IOS) || PLATFORM(MACCATALYST) |
1392 | #define HAVE_URL_FORMATTING 1 |
1393 | #endif |
1394 | |
1395 | #if !OS(WINDOWS) |
1396 | #define HAVE_STACK_BOUNDS_FOR_NEW_THREAD 1 |
1397 | #endif |
1398 | |
1399 | #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || PLATFORM(IOS) || PLATFORM(MACCATALYST) |
1400 | #define HAVE_AVCONTENTKEYSESSION 1 |
1401 | #endif |
1402 | |
1403 | #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) || PLATFORM(IOS) || PLATFORM(MACCATALYST) |
1404 | #define HAVE_SEC_KEY_PROXY 1 |
1405 | #endif |
1406 | |
1407 | #if PLATFORM(COCOA) && USE(CA) && !PLATFORM(IOS_FAMILY_SIMULATOR) |
1408 | #define USE_IOSURFACE_CANVAS_BACKING_STORE 1 |
1409 | #endif |
1410 | |
1411 | /* FIXME: Should this be enabled or IOS_FAMILY, not just IOS? */ |
1412 | #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) || PLATFORM(IOS) |
1413 | #define HAVE_FOUNDATION_WITH_SAVE_COOKIES_WITH_COMPLETION_HANDLER 1 |
1414 | #endif |
1415 | |
1416 | /* FIXME: Should this be enabled for IOS_FAMILY, not just IOS? */ |
1417 | #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) || PLATFORM(IOS) |
1418 | #define HAVE_FOUNDATION_WITH_SAME_SITE_COOKIE_SUPPORT 1 |
1419 | #endif |
1420 | |
1421 | #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED < 101400 |
1422 | #define HAVE_NSHTTPCOOKIESTORAGE__INITWITHIDENTIFIER_WITH_INACCURATE_NULLABILITY 1 |
1423 | #endif |
1424 | |
1425 | #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 101302 && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || PLATFORM(IOS_FAMILY) |
1426 | #define HAVE_CFNETWORK_WITH_CONTENT_ENCODING_SNIFFING_OVERRIDE 1 |
1427 | /* The override isn't needed on iOS family, as the default behavior is to not sniff. */ |
1428 | /* FIXME: This should probably be enabled on 10.13.2 and newer, not just 10.14 and newer. */ |
1429 | #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 |
1430 | #define USE_CFNETWORK_CONTENT_ENCODING_SNIFFING_OVERRIDE 1 |
1431 | #endif |
1432 | #endif |
1433 | |
1434 | #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 101302 && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || PLATFORM(IOS_FAMILY) |
1435 | #define HAVE_CFNETWORK_WITH_IGNORE_HSTS 1 |
1436 | #endif |
1437 | |
1438 | #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300 && __MAC_OS_X_VERSION_MAX_ALLOWED >= 101302) || PLATFORM(IOS_FAMILY) |
1439 | #define HAVE_CFNETWORK_WITH_AUTO_ADDED_HTTP_HEADER_SUPPRESSION_SUPPORT 1 |
1440 | /* FIXME: Does this work, and is this needed on other iOS family platforms? */ |
1441 | #if PLATFORM(MAC) || PLATFORM(IOS) |
1442 | #define USE_CFNETWORK_AUTO_ADDED_HTTP_HEADER_SUPPRESSION 1 |
1443 | #endif |
1444 | #endif |
1445 | |
1446 | #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000) || PLATFORM(GTK) |
1447 | #define HAVE_OS_DARK_MODE_SUPPORT 1 |
1448 | #endif |
1449 | |
1450 | #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 |
1451 | #define HAVE_CG_FONT_RENDERING_GET_FONT_SMOOTHING_DISABLED 1 |
1452 | #endif |
1453 | |
1454 | #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000) |
1455 | #define HAVE_CA_WHERE_ADDITIVE_TRANSFORMS_ARE_REVERSED 1 |
1456 | #endif |
1457 | |
1458 | #ifdef __APPLE__ |
1459 | #define HAVE_FUNC_USLEEP 1 |
1460 | #endif |
1461 | |
1462 | #if PLATFORM(MAC) || PLATFORM(WPE) |
1463 | /* FIXME: This really needs a descriptive name, this "new theme" was added in 2008. */ |
1464 | #define USE_NEW_THEME 1 |
1465 | #endif |
1466 | |
1467 | #if PLATFORM(MAC) |
1468 | #define HAVE_WINDOW_SERVER_OCCLUSION_NOTIFICATIONS 1 |
1469 | #endif |
1470 | |
1471 | #if PLATFORM(COCOA) |
1472 | #define HAVE_SEC_ACCESS_CONTROL 1 |
1473 | #endif |
1474 | |
1475 | #if PLATFORM(IOS) |
1476 | /* FIXME: SafariServices.framework exists on macOS. It is only used by WebKit on iOS, so the behavior is correct, but the name is misleading. */ |
1477 | #define HAVE_SAFARI_SERVICES_FRAMEWORK 1 |
1478 | #endif |
1479 | |
1480 | #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300 && !defined(__i386__)) || PLATFORM(IOS) || PLATFORM(WATCHOS) |
1481 | #define HAVE_SAFE_BROWSING 1 |
1482 | #endif |
1483 | |
1484 | #if PLATFORM(IOS) |
1485 | #define HAVE_LINK_PREVIEW 1 |
1486 | #endif |
1487 | |
1488 | #if PLATFORM(COCOA) |
1489 | /* FIXME: This is a USE style macro, as it triggers the use of CFURLConnection framework stubs. */ |
1490 | /* FIXME: Is this still necessary? CFURLConnection isn't used on Cocoa platforms any more. */ |
1491 | #define ENABLE_SEC_ITEM_SHIM 1 |
1492 | #endif |
1493 | |
1494 | #if (PLATFORM(IOS_FAMILY) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400)) |
1495 | #define HAVE_ACCESSIBILITY_SUPPORT 1 |
1496 | #endif |
1497 | |
1498 | #if PLATFORM(MAC) |
1499 | #define ENABLE_FULL_KEYBOARD_ACCESS 1 |
1500 | #endif |
1501 | |
1502 | #if PLATFORM(IOS_FAMILY) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) |
1503 | #define HAVE_AUTHORIZATION_STATUS_FOR_MEDIA_TYPE 1 |
1504 | #endif |
1505 | |
1506 | #if (PLATFORM(MAC) && (__MAC_OS_X_VERSION_MIN_REQUIRED == 101200 || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 && __MAC_OS_X_VERSION_MAX_ALLOWED >= 101404))) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 120000 && __IPHONE_OS_VERSION_MAX_ALLOWED >= 120200) || (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 50000 && __WATCH_OS_VERSION_MAX_ALLOWED >= 50200) || (PLATFORM(APPLETV) && __TV_OS_VERSION_MIN_REQUIRED >= 120000 && __TV_OS_VERSION_MAX_ALLOWED >= 120200) |
1507 | #define HAVE_CFNETWORK_OVERRIDE_SESSION_COOKIE_ACCEPT_POLICY 1 |
1508 | #endif |
1509 | |
1510 | #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000) |
1511 | #define HAVE_CFNETWORK_NSURLSESSION_STRICTRUSTEVALUATE 1 |
1512 | #endif |
1513 | |
1514 | #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000) |
1515 | #define HAVE_CFNETWORK_NSURLSESSIONTASKTRANSACTIONMETRICS_SPI 1 |
1516 | #endif |
1517 | |
1518 | #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000) |
1519 | #define HAVE_CFNETWORK_NEGOTIATED_SSL_PROTOCOL_CIPHER 1 |
1520 | #define HAVE_CFNETWORK_NSURLSESSIONTASKTRANSACTIONMETRICS_ADDITIONS 1 |
1521 | #endif |
1522 | |
1523 | #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500 |
1524 | #define HAVE_CSCHECKFIXDISABLE 1 |
1525 | #endif |
1526 | |
1527 | #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000) |
1528 | #define HAVE_SANDBOX_ISSUE_MACH_EXTENSION_TO_PROCESS_BY_PID 1 |
1529 | #endif |
1530 | |
1531 | #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000) |
1532 | #define HAVE_MDNS_FAST_REGISTRATION 1 |
1533 | #endif |
1534 | |
1535 | #if PLATFORM(MAC) |
1536 | #define ENABLE_MONOSPACE_FONT_EXCEPTION (__MAC_OS_X_VERSION_MIN_REQUIRED < 101500) |
1537 | #elif PLATFORM(IOS_FAMILY) |
1538 | #define ENABLE_MONOSPACE_FONT_EXCEPTION (__IPHONE_OS_VERSION_MIN_REQUIRED < 130000) |
1539 | #endif |
1540 | |
1541 | #if PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000 |
1542 | #define HAVE_UI_WEB_TOUCH_EVENTS_GESTURE_RECOGNIZER_WITH_ACTIVE_TOUCHES_BY_ID 1 |
1543 | #endif |
1544 | |
1545 | #if PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000 |
1546 | #define HAVE_ARKIT_QUICK_LOOK_PREVIEW_ITEM 1 |
1547 | #endif |
1548 | |
1549 | #if PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000 |
1550 | #define HAVE_UI_WK_DOCUMENT_CONTEXT 1 |
1551 | #endif |
1552 | |
1553 | #if PLATFORM(MACCATALYST) |
1554 | #define ENABLE_PLATFORM_DRIVEN_TEXT_CHECKING 1 |
1555 | #endif |
1556 | |
1557 | #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000) || (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 60000) || (PLATFORM(APPLETV) && __TV_OS_VERSION_MIN_REQUIRED >= 130000) |
1558 | #define HAVE_ALLOWS_SENSITIVE_LOGGING 1 |
1559 | #define HAVE_FAIRPLAYSTREAMING_CENC_INITDATA 1 |
1560 | #endif |
1561 | |
1562 | #if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000) || (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 60000) || (PLATFORM(APPLETV) && __TV_OS_VERSION_MIN_REQUIRED >= 130000) |
1563 | #define HAVE_UI_SCROLL_VIEW_INDICATOR_FLASHING_SPI 1 |
1564 | #endif |
1565 | |
1566 | #if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000) |
1567 | #define HAVE_APP_LINKS_WITH_ISENABLED 1 |
1568 | #define HAVE_ROUTE_SHARING_POLICY_LONG_FORM_VIDEO 1 |
1569 | #endif |
1570 | |
1571 | #if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 120000 && !PLATFORM(IOS_SIMULATOR)) |
1572 | #define HAVE_DEVICE_MANAGEMENT 1 |
1573 | #endif |
1574 | |
1575 | #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED < 101500 |
1576 | #define USE_REALPATH_FOR_DLOPEN_PREFLIGHT 1 |
1577 | #endif |
1578 | |
1579 | #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000) || (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 60000) || (PLATFORM(APPLETV) && __TV_OS_VERSION_MIN_REQUIRED >= 130000) |
1580 | #define HAVE_NSURLSESSION_WEBSOCKET 1 |
1581 | #endif |
1582 | |
1583 | #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000) || (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 60000) || (PLATFORM(APPLETV) && __TV_OS_VERSION_MIN_REQUIRED >= 130000) |
1584 | #define HAVE_AVPLAYER_RESOURCE_CONSERVATION_LEVEL 1 |
1585 | #endif |
1586 | |
1587 | #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 120000) || (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 50000) || (PLATFORM(APPLETV) && __TV_OS_VERSION_MIN_REQUIRED >= 120000) |
1588 | #define HAVE_CORETEXT_AUTO_OPTICAL_SIZING 1 |
1589 | #endif |
1590 | |
1591 | #if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000 || PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) |
1592 | #define HAVE_APP_SSO 1 |
1593 | #endif |
1594 | |
1595 | #if PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000 |
1596 | #define USE_UICONTEXTMENU 1 |
1597 | #endif |
1598 | |
1599 | #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED <= 101300 |
1600 | #define USE_INTEL_METAL_WORKAROUND 1 |
1601 | #endif |
1602 | |
1603 | #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500 |
1604 | #define HAVE_SUBVIEWS_IVAR_SPI 1 |
1605 | #endif |
1606 | |