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#define HAVE_AUDIT_TOKEN 1
697
698#if __has_include(<mach/mach_exc.defs>) && !PLATFORM(GTK)
699#define HAVE_MACH_EXCEPTIONS 1
700#endif
701
702#if !PLATFORM(GTK)
703#define USE_ACCELERATE 1
704#endif
705#if !PLATFORM(IOS_FAMILY)
706#define HAVE_HOSTED_CORE_ANIMATION 1
707#endif
708
709#endif /* OS(DARWIN) */
710
711#if OS(DARWIN) || OS(FUCHSIA) || ((OS(FREEBSD) || defined(__GLIBC__) || defined(__BIONIC__)) && (CPU(X86) || CPU(X86_64) || CPU(ARM) || CPU(ARM64) || CPU(MIPS)))
712#define HAVE_MACHINE_CONTEXT 1
713#endif
714
715#if OS(DARWIN) || (OS(LINUX) && defined(__GLIBC__) && !defined(__UCLIBC__) && !CPU(MIPS))
716#define HAVE_BACKTRACE 1
717#endif
718
719#if OS(DARWIN) || OS(LINUX)
720#if PLATFORM(GTK)
721#if defined(__GLIBC__) && !defined(__UCLIBC__) && !CPU(MIPS)
722#define HAVE_BACKTRACE_SYMBOLS 1
723#endif
724#endif /* PLATFORM(GTK) */
725#define HAVE_DLADDR 1
726#endif /* OS(DARWIN) || OS(LINUX) */
727
728
729/* ENABLE macro defaults */
730
731/* FIXME: move out all ENABLE() defines from here to FeatureDefines.h */
732
733#if USE(APPLE_INTERNAL_SDK) && __has_include(<WebKitAdditions/AdditionalPlatform.h>)
734#include <WebKitAdditions/AdditionalPlatform.h>
735#endif
736
737#if USE(APPLE_INTERNAL_SDK) && __has_include(<WebKitAdditions/AdditionalFeatureDefines.h>)
738#include <WebKitAdditions/AdditionalFeatureDefines.h>
739#endif
740
741/* Include feature macros */
742#include <wtf/FeatureDefines.h>
743
744#if OS(WINDOWS)
745#define USE_SYSTEM_MALLOC 1
746#endif
747
748#if CPU(ADDRESS64)
749#if OS(DARWIN) && CPU(ARM64)
750#define WTF_CPU_EFFECTIVE_ADDRESS_WIDTH 36
751#else
752/* We strongly assume that effective address width is <= 48 in 64bit architectures (e.g. NaN boxing). */
753#define WTF_CPU_EFFECTIVE_ADDRESS_WIDTH 48
754#endif
755#else
756#define WTF_CPU_EFFECTIVE_ADDRESS_WIDTH 32
757#endif
758
759#if !defined(USE_JSVALUE64) && !defined(USE_JSVALUE32_64)
760#if CPU(ADDRESS64) || CPU(ARM64)
761#define USE_JSVALUE64 1
762#else
763#define USE_JSVALUE32_64 1
764#endif
765#endif /* !defined(USE_JSVALUE64) && !defined(USE_JSVALUE32_64) */
766
767/* The JIT is enabled by default on all x86-64 & ARM64 platforms. */
768#if !defined(ENABLE_JIT) \
769 && (CPU(X86_64) || CPU(ARM64)) \
770 && !CPU(APPLE_ARMV7K)
771#define ENABLE_JIT 1
772#endif
773
774#if USE(JSVALUE32_64)
775#if (CPU(ARM_THUMB2) || CPU(MIPS)) && OS(LINUX)
776/* On ARMv7 and MIPS on Linux the JIT is enabled unless explicitly disabled. */
777#if !defined(ENABLE_JIT)
778#define ENABLE_JIT 1
779#endif
780#else
781/* Disable JIT and force C_LOOP on all other 32bit architectures. */
782#undef ENABLE_JIT
783#define ENABLE_JIT 0
784#undef ENABLE_C_LOOP
785#define ENABLE_C_LOOP 1
786#endif
787#endif
788
789#if !defined(ENABLE_C_LOOP)
790#if ENABLE(JIT) \
791 || CPU(X86_64) || (CPU(ARM64) && !defined(__ILP32__))
792#define ENABLE_C_LOOP 0
793#else
794#define ENABLE_C_LOOP 1
795#endif
796#endif
797
798/* The FTL *does not* work on 32-bit platforms. Disable it even if someone asked us to enable it. */
799#if USE(JSVALUE32_64)
800#undef ENABLE_FTL_JIT
801#define ENABLE_FTL_JIT 0
802#endif
803
804/* The FTL is disabled on the iOS simulator, mostly for simplicity. */
805#if PLATFORM(IOS_FAMILY_SIMULATOR)
806#undef ENABLE_FTL_JIT
807#define ENABLE_FTL_JIT 0
808#endif
809
810/* If possible, try to enable a disassembler. This is optional. We proceed in two
811 steps: first we try to find some disassembler that we can use, and then we
812 decide if the high-level disassembler API can be enabled. */
813#if !defined(USE_UDIS86) && ENABLE(JIT) && CPU(X86_64) && !USE(CAPSTONE)
814#define USE_UDIS86 1
815#endif
816
817#if !defined(USE_ARM64_DISASSEMBLER) && ENABLE(JIT) && CPU(ARM64) && !USE(CAPSTONE)
818#define USE_ARM64_DISASSEMBLER 1
819#endif
820
821#if !defined(ENABLE_DISASSEMBLER) && (USE(UDIS86) || USE(ARM64_DISASSEMBLER) || (ENABLE(JIT) && USE(CAPSTONE)))
822#define ENABLE_DISASSEMBLER 1
823#endif
824
825#if !defined(ENABLE_DFG_JIT) && ENABLE(JIT)
826/* Enable the DFG JIT on X86 and X86_64. */
827#if CPU(X86_64) && (OS(DARWIN) || OS(LINUX) || OS(FREEBSD) || OS(HURD) || OS(WINDOWS))
828#define ENABLE_DFG_JIT 1
829#endif
830/* Enable the DFG JIT on ARMv7. Only tested on iOS, Linux, and FreeBSD. */
831#if (CPU(ARM_THUMB2) || CPU(ARM64)) && (PLATFORM(IOS_FAMILY) || OS(LINUX) || OS(FREEBSD))
832#define ENABLE_DFG_JIT 1
833#endif
834/* Enable the DFG JIT on MIPS. */
835#if CPU(MIPS)
836#define ENABLE_DFG_JIT 1
837#endif
838#endif
839
840/* Concurrent JS only works on 64-bit platforms because it requires that
841 values get stored to atomically. This is trivially true on 64-bit platforms,
842 but not true at all on 32-bit platforms where values are composed of two
843 separate sub-values. */
844#if ENABLE(JIT) && USE(JSVALUE64)
845#define ENABLE_CONCURRENT_JS 1
846#endif
847
848#if __has_include(<System/pthread_machdep.h>)
849#define HAVE_FAST_TLS 1
850#endif
851
852#if (CPU(X86_64) || CPU(ARM64)) && HAVE(FAST_TLS)
853#define ENABLE_FAST_TLS_JIT 1
854#endif
855
856#if CPU(X86) || CPU(X86_64) || CPU(ARM_THUMB2) || CPU(ARM64) || CPU(MIPS)
857#define ENABLE_MASM_PROBE 1
858#else
859#define ENABLE_MASM_PROBE 0
860#endif
861
862#if !ENABLE(JIT)
863#undef ENABLE_MASM_PROBE
864#define ENABLE_MASM_PROBE 0
865#endif
866
867/* If the baseline jit is not available, then disable upper tiers as well.
868 The MacroAssembler::probe() is also required for supporting the upper tiers. */
869#if !ENABLE(JIT) || !ENABLE(MASM_PROBE)
870#undef ENABLE_DFG_JIT
871#undef ENABLE_FTL_JIT
872#define ENABLE_DFG_JIT 0
873#define ENABLE_FTL_JIT 0
874#endif
875
876/* If the DFG jit is not available, then disable upper tiers as well: */
877#if !ENABLE(DFG_JIT)
878#undef ENABLE_FTL_JIT
879#define ENABLE_FTL_JIT 0
880#endif
881
882/* This controls whether B3 is built. B3 is needed for FTL JIT and WebAssembly */
883#if ENABLE(FTL_JIT)
884#define ENABLE_B3_JIT 1
885#endif
886
887#if !defined(ENABLE_WEBASSEMBLY)
888#if ENABLE(B3_JIT) && PLATFORM(COCOA) && CPU(ADDRESS64)
889#define ENABLE_WEBASSEMBLY 1
890#else
891#define ENABLE_WEBASSEMBLY 0
892#endif
893#endif
894
895/* The SamplingProfiler is the probabilistic and low-overhead profiler used by
896 * JSC to measure where time is spent inside a JavaScript program.
897 * In configurations other than Windows and Darwin, because layout of mcontext_t depends on standard libraries (like glibc),
898 * sampling profiler is enabled if WebKit uses pthreads and glibc. */
899#if !defined(ENABLE_SAMPLING_PROFILER)
900#if !ENABLE(C_LOOP) && (OS(WINDOWS) || HAVE(MACHINE_CONTEXT))
901#define ENABLE_SAMPLING_PROFILER 1
902#else
903#define ENABLE_SAMPLING_PROFILER 0
904#endif
905#endif
906
907#if ENABLE(WEBASSEMBLY) && HAVE(MACHINE_CONTEXT)
908#define ENABLE_WEBASSEMBLY_FAST_MEMORY 1
909#endif
910
911/* Counts uses of write barriers using sampling counters. Be sure to also
912 set ENABLE_SAMPLING_COUNTERS to 1. */
913#if !defined(ENABLE_WRITE_BARRIER_PROFILING)
914#define ENABLE_WRITE_BARRIER_PROFILING 0
915#endif
916
917/* Logs all allocation-related activity that goes through fastMalloc or the
918 JSC GC (both cells and butterflies). Also logs marking. Note that this
919 isn't a completely accurate view of the heap since it doesn't include all
920 butterfly resize operations, doesn't tell you what is going on with weak
921 references (other than to tell you when they're marked), and doesn't
922 track direct mmap() allocations or things like JIT allocation. */
923#if !defined(ENABLE_ALLOCATION_LOGGING)
924#define ENABLE_ALLOCATION_LOGGING 0
925#endif
926
927/* Enable verification that that register allocations are not made within generated control flow.
928 Turned on for debug builds. */
929#if !defined(ENABLE_DFG_REGISTER_ALLOCATION_VALIDATION) && ENABLE(DFG_JIT)
930#if !defined(NDEBUG)
931#define ENABLE_DFG_REGISTER_ALLOCATION_VALIDATION 1
932#else
933#define ENABLE_DFG_REGISTER_ALLOCATION_VALIDATION 0
934#endif
935#endif
936
937/* Configure the JIT */
938#if CPU(X86) && COMPILER(MSVC)
939#define JSC_HOST_CALL __fastcall
940#elif CPU(X86) && COMPILER(GCC_COMPATIBLE)
941#define JSC_HOST_CALL __attribute__ ((fastcall))
942#else
943#define JSC_HOST_CALL
944#endif
945
946#if CPU(X86) && OS(WINDOWS)
947#define CALLING_CONVENTION_IS_STDCALL 1
948#ifndef CDECL
949#if COMPILER(MSVC)
950#define CDECL __cdecl
951#else
952#define CDECL __attribute__ ((__cdecl))
953#endif
954#endif
955#else
956#define CALLING_CONVENTION_IS_STDCALL 0
957#endif
958
959#if CPU(X86)
960#define WTF_COMPILER_SUPPORTS_FASTCALL_CALLING_CONVENTION 1
961#ifndef FASTCALL
962#if COMPILER(MSVC)
963#define FASTCALL __fastcall
964#else
965#define FASTCALL __attribute__ ((fastcall))
966#endif
967#endif
968#else
969#define WTF_COMPILER_SUPPORTS_FASTCALL_CALLING_CONVENTION 0
970#endif
971
972#if ENABLE(JIT) && CALLING_CONVENTION_IS_STDCALL
973#define JIT_OPERATION CDECL
974#else
975#define JIT_OPERATION
976#endif
977
978#if PLATFORM(IOS_FAMILY) && CPU(ARM64) && (!ENABLE(FAST_JIT_PERMISSIONS) || !CPU(ARM64E))
979#define ENABLE_SEPARATED_WX_HEAP 1
980#else
981#define ENABLE_SEPARATED_WX_HEAP 0
982#endif
983
984/* Configure the interpreter */
985#if COMPILER(GCC_COMPATIBLE)
986#define HAVE_COMPUTED_GOTO 1
987#endif
988
989/* Determine if we need to enable Computed Goto Opcodes or not: */
990#if HAVE(COMPUTED_GOTO) || !ENABLE(C_LOOP)
991#define ENABLE_COMPUTED_GOTO_OPCODES 1
992#endif
993
994#if !defined(USE_LLINT_EMBEDDED_OPCODE_ID) && !ENABLE(C_LOOP) && !COMPILER(MSVC) && \
995 (CPU(X86) || CPU(X86_64) || CPU(ARM64) || (CPU(ARM_THUMB2) && OS(DARWIN)))
996/* This feature works by embedding the OpcodeID in the 32 bit just before the generated LLint code
997 that executes each opcode. It cannot be supported by the CLoop since there's no way to embed the
998 OpcodeID word in the CLoop's switch statement cases. It is also currently not implemented for MSVC.
999*/
1000#define USE_LLINT_EMBEDDED_OPCODE_ID 1
1001#endif
1002
1003/* Use __builtin_frame_address(1) to get CallFrame* */
1004#if COMPILER(GCC_COMPATIBLE) && (CPU(ARM64) || CPU(X86_64))
1005#define USE_BUILTIN_FRAME_ADDRESS 1
1006#endif
1007
1008/* Regular Expression Tracing - Set to 1 to trace RegExp's in jsc. Results dumped at exit */
1009#define ENABLE_REGEXP_TRACING 0
1010
1011/* Yet Another Regex Runtime - turned on by default for JIT enabled ports. */
1012#if !defined(ENABLE_YARR_JIT) && ENABLE(JIT)
1013#define ENABLE_YARR_JIT 1
1014
1015/* Setting this flag compares JIT results with interpreter results. */
1016#define ENABLE_YARR_JIT_DEBUG 0
1017#endif
1018
1019#if ENABLE(YARR_JIT)
1020#if CPU(ARM64) || (CPU(X86_64) && !OS(WINDOWS))
1021/* Enable JIT'ing Regular Expressions that have nested parenthesis and back references. */
1022#define ENABLE_YARR_JIT_ALL_PARENS_EXPRESSIONS 1
1023#define ENABLE_YARR_JIT_BACKREFERENCES 1
1024#endif
1025#endif
1026
1027/* If either the JIT or the RegExp JIT is enabled, then the Assembler must be
1028 enabled as well: */
1029#if ENABLE(JIT) || ENABLE(YARR_JIT) || !ENABLE(C_LOOP)
1030#if defined(ENABLE_ASSEMBLER) && !ENABLE_ASSEMBLER
1031#error "Cannot enable the JIT or RegExp JIT without enabling the Assembler"
1032#else
1033#undef ENABLE_ASSEMBLER
1034#define ENABLE_ASSEMBLER 1
1035#endif
1036#endif
1037
1038/* If the Disassembler is enabled, then the Assembler must be enabled as well: */
1039#if ENABLE(DISASSEMBLER)
1040#if defined(ENABLE_ASSEMBLER) && !ENABLE_ASSEMBLER
1041#error "Cannot enable the Disassembler without enabling the Assembler"
1042#else
1043#undef ENABLE_ASSEMBLER
1044#define ENABLE_ASSEMBLER 1
1045#endif
1046#endif
1047
1048#ifndef ENABLE_EXCEPTION_SCOPE_VERIFICATION
1049#ifdef NDEBUG
1050#define ENABLE_EXCEPTION_SCOPE_VERIFICATION 0
1051#else
1052#define ENABLE_EXCEPTION_SCOPE_VERIFICATION 1
1053#endif
1054#endif
1055
1056#if ENABLE(DFG_JIT) && HAVE(MACHINE_CONTEXT) && (CPU(X86_64) || CPU(ARM64))
1057#define ENABLE_SIGNAL_BASED_VM_TRAPS 1
1058#endif
1059
1060/* CSS Selector JIT Compiler */
1061#if !defined(ENABLE_CSS_SELECTOR_JIT)
1062#if (CPU(X86_64) || CPU(ARM64) || (CPU(ARM_THUMB2) && PLATFORM(IOS_FAMILY))) && ENABLE(JIT) && (OS(DARWIN) || PLATFORM(GTK) || PLATFORM(WPE))
1063#define ENABLE_CSS_SELECTOR_JIT 1
1064#else
1065#define ENABLE_CSS_SELECTOR_JIT 0
1066#endif
1067#endif
1068
1069#if CPU(ARM64E) && OS(DARWIN)
1070#define HAVE_FJCVTZS_INSTRUCTION 1
1071#endif
1072
1073#if PLATFORM(IOS)
1074#define HAVE_APP_LINKS 1
1075#define USE_PASSKIT 1
1076#define USE_QUICK_LOOK 1
1077#define USE_SYSTEM_PREVIEW 1
1078#endif
1079
1080#if PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST)
1081#define HAVE_CELESTIAL 1
1082#define HAVE_CORE_ANIMATION_RENDER_SERVER 1
1083#endif
1084
1085#if PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST) && !PLATFORM(APPLETV)
1086#define HAVE_PARENTAL_CONTROLS_WITH_UNBLOCK_HANDLER 1
1087#endif
1088
1089#if PLATFORM(COCOA)
1090
1091#define USE_AVFOUNDATION 1
1092#define USE_PROTECTION_SPACE_AUTH_CALLBACK 1
1093
1094#if !PLATFORM(WATCHOS) && !PLATFORM(APPLETV) && !PLATFORM(MACCATALYST)
1095#define ENABLE_DATA_DETECTION 1
1096#endif
1097
1098/* FIXME: Enable HAVE_PARENTAL_CONTROLS for watchOS Simulator once rdar://problem/54608386 is resolved */
1099#if !PLATFORM(APPLETV) && (!PLATFORM(WATCHOS) || !PLATFORM(IOS_FAMILY_SIMULATOR))
1100#define HAVE_PARENTAL_CONTROLS 1
1101#endif
1102
1103#if !PLATFORM(APPLETV)
1104#define HAVE_AVKIT 1
1105#endif
1106
1107#if ENABLE(WEBGL)
1108/* USE_ANGLE=1 uses ANGLE for the WebGL backend.
1109 It replaces USE_OPENGL, USE_OPENGL_ES and USE_EGL. */
1110#if PLATFORM(MAC)
1111#define USE_OPENGL 1
1112#define USE_OPENGL_ES 0
1113#define USE_ANGLE 0
1114#elif PLATFORM(MACCATALYST) && __has_include(<OpenGL/OpenGL.h>)
1115#define USE_OPENGL 1
1116#define USE_OPENGL_ES 0
1117#define USE_ANGLE 0
1118#else
1119#define USE_OPENGL 0
1120#define USE_OPENGL_ES 1
1121#define USE_ANGLE 0
1122#endif
1123#if PLATFORM(COCOA)
1124#ifndef GL_SILENCE_DEPRECATION
1125#define GL_SILENCE_DEPRECATION 1
1126#endif
1127#endif
1128#endif
1129
1130#define USE_METAL 1
1131
1132#if ENABLE(ACCESSIBILITY)
1133#define USE_ACCESSIBILITY_CONTEXT_MENUS 1
1134#endif
1135
1136#endif
1137
1138#if ENABLE(WEBGL) && PLATFORM(WIN)
1139#define USE_OPENGL 1
1140#define USE_OPENGL_ES 1
1141#define USE_EGL 1
1142#endif
1143
1144#if ENABLE(WEBGL)
1145#if !defined(USE_ANGLE)
1146#define USE_ANGLE 0
1147#endif
1148
1149#if (USE_ANGLE && (USE_OPENGL || USE_OPENGL_ES || (defined(USE_EGL) && USE_EGL))) && !USE(TEXTURE_MAPPER)
1150#error USE_ANGLE is incompatible with USE_OPENGL, USE_OPENGL_ES and USE_EGL
1151#endif
1152#endif
1153
1154#if USE(TEXTURE_MAPPER) && ENABLE(GRAPHICS_CONTEXT_3D) && !defined(USE_TEXTURE_MAPPER_GL)
1155#define USE_TEXTURE_MAPPER_GL 1
1156#endif
1157
1158#if CPU(ARM_THUMB2) || CPU(ARM64)
1159#define ENABLE_BRANCH_COMPACTION 1
1160#endif
1161
1162#if !defined(ENABLE_THREADING_LIBDISPATCH) && HAVE(DISPATCH_H)
1163#define ENABLE_THREADING_LIBDISPATCH 1
1164#elif !defined(ENABLE_THREADING_OPENMP) && defined(_OPENMP)
1165#define ENABLE_THREADING_OPENMP 1
1166#elif !defined(THREADING_GENERIC)
1167#define ENABLE_THREADING_GENERIC 1
1168#endif
1169
1170#if USE(GLIB)
1171#include <wtf/glib/GTypedefs.h>
1172#endif
1173
1174#if !defined(USE_EXPORT_MACROS) && (PLATFORM(COCOA) || OS(WINDOWS))
1175#define USE_EXPORT_MACROS 1
1176#endif
1177
1178#if PLATFORM(GTK) || PLATFORM(WPE)
1179#define USE_UNIX_DOMAIN_SOCKETS 1
1180#endif
1181
1182#if !defined(USE_IMLANG_FONT_LINK2)
1183#define USE_IMLANG_FONT_LINK2 1
1184#endif
1185
1186#if !defined(ENABLE_GC_VALIDATION) && !defined(NDEBUG)
1187#define ENABLE_GC_VALIDATION 1
1188#endif
1189
1190#if !defined(ENABLE_BINDING_INTEGRITY) && !OS(WINDOWS)
1191#define ENABLE_BINDING_INTEGRITY 1
1192#endif
1193
1194#if !defined(ENABLE_TREE_DEBUGGING)
1195#if !defined(NDEBUG)
1196#define ENABLE_TREE_DEBUGGING 1
1197#else
1198#define ENABLE_TREE_DEBUGGING 0
1199#endif
1200#endif
1201
1202#if PLATFORM(COCOA)
1203#define USE_COREMEDIA 1
1204#define USE_VIDEOTOOLBOX 1
1205#define HAVE_AVFOUNDATION_VIDEO_OUTPUT 1
1206#define HAVE_CORE_VIDEO 1
1207#define HAVE_MEDIA_PLAYER 1
1208#endif
1209
1210#if PLATFORM(COCOA)
1211#define HAVE_AVFOUNDATION_MEDIA_SELECTION_GROUP 1
1212#endif
1213
1214#if PLATFORM(COCOA)
1215#define HAVE_AVFOUNDATION_LEGIBLE_OUTPUT_SUPPORT 1
1216#define HAVE_MEDIA_ACCESSIBILITY_FRAMEWORK 1
1217#endif
1218
1219#if PLATFORM(COCOA)
1220#define HAVE_AVFOUNDATION_LOADER_DELEGATE 1
1221#endif
1222
1223#if !PLATFORM(WIN)
1224#define USE_REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR 1
1225#endif
1226
1227#if PLATFORM(MAC) || PLATFORM(MACCATALYST)
1228#define HAVE_APPLE_GRAPHICS_CONTROL 1
1229#endif
1230
1231#if PLATFORM(MAC)
1232#define USE_COREAUDIO 1
1233#endif
1234
1235#if !defined(USE_ZLIB)
1236#define USE_ZLIB 1
1237#endif
1238
1239#ifndef HAVE_QOS_CLASSES
1240#if PLATFORM(COCOA)
1241#define HAVE_QOS_CLASSES 1
1242#endif
1243#endif
1244
1245#ifndef HAVE_VOUCHERS
1246#if PLATFORM(COCOA)
1247#define HAVE_VOUCHERS 1
1248#endif
1249#endif
1250
1251#define USE_GRAMMAR_CHECKING 1
1252
1253#if PLATFORM(COCOA) || PLATFORM(GTK)
1254#define USE_UNIFIED_TEXT_CHECKING 1
1255#endif
1256#if PLATFORM(MAC)
1257#define USE_AUTOMATIC_TEXT_REPLACEMENT 1
1258#endif
1259
1260#if PLATFORM(MAC)
1261/* Some platforms provide UI for suggesting autocorrection. */
1262#define USE_AUTOCORRECTION_PANEL 1
1263#endif
1264
1265#if PLATFORM(COCOA)
1266/* 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. */
1267#define USE_MARKER_REMOVAL_UPON_EDITING 1
1268#endif
1269
1270#if PLATFORM(MAC)
1271#define USE_INSERTION_UNDO_GROUPING 1
1272#endif
1273
1274#if PLATFORM(COCOA)
1275#define HAVE_AVASSETREADER 1
1276#endif
1277
1278#if PLATFORM(COCOA)
1279#define USE_AUDIO_SESSION 1
1280#endif
1281
1282#if PLATFORM(COCOA)
1283#define HAVE_IOSURFACE 1
1284#endif
1285
1286#if PLATFORM(IOS_FAMILY) && !PLATFORM(IOS_FAMILY_SIMULATOR)
1287#define HAVE_IOSURFACE_COREIMAGE_SUPPORT 1
1288#endif
1289
1290#if PLATFORM(IOS_FAMILY) && !PLATFORM(IOS_FAMILY_SIMULATOR) && !PLATFORM(MACCATALYST)
1291#define HAVE_IOSURFACE_ACCELERATOR 1
1292#endif
1293
1294#if PLATFORM(COCOA)
1295#define ENABLE_RESOURCE_USAGE 1
1296#endif
1297
1298#if PLATFORM(GTK) || PLATFORM(WPE)
1299#undef ENABLE_OPENTYPE_VERTICAL
1300#define ENABLE_OPENTYPE_VERTICAL 1
1301#endif
1302
1303#if COMPILER(MSVC)
1304#undef __STDC_FORMAT_MACROS
1305#define __STDC_FORMAT_MACROS
1306#undef __STDC_LIMIT_MACROS
1307#define __STDC_LIMIT_MACROS
1308#endif
1309
1310#if PLATFORM(MAC)
1311#define HAVE_NS_ACTIVITY 1
1312#endif
1313
1314/* Disable SharedArrayBuffers until Spectre security concerns are mitigated. */
1315#define ENABLE_SHARED_ARRAY_BUFFER 0
1316
1317#if (OS(DARWIN) && USE(CG)) || (USE(FREETYPE) && !PLATFORM(GTK)) || (PLATFORM(WIN) && (USE(CG) || USE(CAIRO)))
1318#undef ENABLE_OPENTYPE_MATH
1319#define ENABLE_OPENTYPE_MATH 1
1320#endif
1321
1322/* Set TARGET_OS_IPHONE to 0 by default to allow using it as a guard
1323 * in cross-platform the same way as it is used in OS(DARWIN) code. */
1324#if !defined(TARGET_OS_IPHONE) && !OS(DARWIN)
1325#define TARGET_OS_IPHONE 0
1326#endif
1327
1328#if PLATFORM(COCOA)
1329#define USE_MEDIATOOLBOX 1
1330#endif
1331
1332#if PLATFORM(COCOA)
1333#define USE_OS_LOG 1
1334#if USE(APPLE_INTERNAL_SDK)
1335#define USE_OS_STATE 1
1336#endif
1337#endif
1338
1339#if PLATFORM(COCOA)
1340#define HAVE_SEC_TRUST_SERIALIZATION 1
1341#endif
1342
1343#if !defined(WTF_DEFAULT_EVENT_LOOP)
1344#define WTF_DEFAULT_EVENT_LOOP 1
1345#endif
1346
1347#if WTF_DEFAULT_EVENT_LOOP
1348#if USE(GLIB)
1349/* Use GLib's event loop abstraction. Primarily GTK port uses it. */
1350#define USE_GLIB_EVENT_LOOP 1
1351#elif OS(WINDOWS)
1352/* Use Windows message pump abstraction.
1353 * Even if the port is AppleWin, we use the Windows message pump system for the event loop,
1354 * so that USE(WINDOWS_EVENT_LOOP) && USE(CF) can be true.
1355 * And PLATFORM(WIN) and PLATFORM(GTK) are exclusive. If the port is GTK,
1356 * PLATFORM(WIN) should be false. And in that case, GLib's event loop is used.
1357 */
1358#define USE_WINDOWS_EVENT_LOOP 1
1359#elif PLATFORM(COCOA)
1360/* OS X and IOS. Use CoreFoundation & GCD abstraction. */
1361#define USE_COCOA_EVENT_LOOP 1
1362#else
1363#define USE_GENERIC_EVENT_LOOP 1
1364#endif
1365#endif
1366
1367#if PLATFORM(COCOA)
1368#define USE_MEDIAREMOTE 1
1369#endif
1370
1371#if COMPILER(MSVC)
1372/* Enable strict runtime stack buffer checks. */
1373#pragma strict_gs_check(on)
1374#endif
1375
1376#if PLATFORM(MAC)
1377#define HAVE_TOUCH_BAR 1
1378#define USE_DICTATION_ALTERNATIVES 1
1379
1380#if defined(__LP64__)
1381#define ENABLE_WEB_PLAYBACK_CONTROLS_MANAGER 1
1382#endif
1383#endif /* PLATFORM(MAC) */
1384
1385#if PLATFORM(COCOA) && ENABLE(WEB_RTC)
1386#define USE_LIBWEBRTC 1
1387#endif
1388
1389#if PLATFORM(MAC) || PLATFORM(IOS) || PLATFORM(MACCATALYST) || USE(GCRYPT)
1390#define HAVE_RSA_PSS 1
1391#endif
1392
1393#if (PLATFORM(MAC) && USE(APPLE_INTERNAL_SDK) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) || PLATFORM(IOS_FAMILY)
1394#define USE_SOURCE_APPLICATION_AUDIT_DATA 1
1395#endif
1396
1397#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000)
1398#define HAVE_HSTS_STORAGE_PATH 1
1399#endif
1400
1401#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) || PLATFORM(IOS) || PLATFORM(MACCATALYST)
1402#define HAVE_URL_FORMATTING 1
1403#endif
1404
1405#if !OS(WINDOWS)
1406#define HAVE_STACK_BOUNDS_FOR_NEW_THREAD 1
1407#endif
1408
1409#if PLATFORM(MAC) || PLATFORM(IOS) || PLATFORM(MACCATALYST)
1410#define HAVE_AVCONTENTKEYSESSION 1
1411#endif
1412
1413#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) || PLATFORM(IOS) || PLATFORM(MACCATALYST)
1414#define HAVE_SEC_KEY_PROXY 1
1415#endif
1416
1417#if PLATFORM(COCOA) && USE(CA)
1418#define USE_IOSURFACE_CANVAS_BACKING_STORE 1
1419#endif
1420
1421/* FIXME: Should this be enabled or IOS_FAMILY, not just IOS? */
1422#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) || PLATFORM(IOS)
1423#define HAVE_FOUNDATION_WITH_SAVE_COOKIES_WITH_COMPLETION_HANDLER 1
1424#endif
1425
1426/* FIXME: Should this be enabled for IOS_FAMILY, not just IOS? */
1427#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) || PLATFORM(IOS)
1428#define HAVE_FOUNDATION_WITH_SAME_SITE_COOKIE_SUPPORT 1
1429#endif
1430
1431#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED < 101400
1432#define HAVE_NSHTTPCOOKIESTORAGE__INITWITHIDENTIFIER_WITH_INACCURATE_NULLABILITY 1
1433#endif
1434
1435#if PLATFORM(COCOA)
1436#define HAVE_CFNETWORK_WITH_CONTENT_ENCODING_SNIFFING_OVERRIDE 1
1437/* The override isn't needed on iOS family, as the default behavior is to not sniff. */
1438/* FIXME: This should probably be enabled on 10.13.2 and newer, not just 10.14 and newer. */
1439#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
1440#define USE_CFNETWORK_CONTENT_ENCODING_SNIFFING_OVERRIDE 1
1441#endif
1442#endif
1443
1444#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000) || PLATFORM(GTK)
1445#define HAVE_OS_DARK_MODE_SUPPORT 1
1446#endif
1447
1448#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
1449#define HAVE_CG_FONT_RENDERING_GET_FONT_SMOOTHING_DISABLED 1
1450#endif
1451
1452#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) || PLATFORM(IOS_FAMILY)
1453#define HAVE_CA_WHERE_ADDITIVE_TRANSFORMS_ARE_REVERSED 1
1454#endif
1455
1456#ifdef __APPLE__
1457#define HAVE_FUNC_USLEEP 1
1458#endif
1459
1460#if PLATFORM(MAC) || PLATFORM(WPE)
1461/* FIXME: This really needs a descriptive name, this "new theme" was added in 2008. */
1462#define USE_NEW_THEME 1
1463#endif
1464
1465#if PLATFORM(MAC)
1466#define HAVE_WINDOW_SERVER_OCCLUSION_NOTIFICATIONS 1
1467#endif
1468
1469#if PLATFORM(COCOA)
1470#define HAVE_SEC_ACCESS_CONTROL 1
1471#endif
1472
1473#if PLATFORM(IOS)
1474/* FIXME: SafariServices.framework exists on macOS. It is only used by WebKit on iOS, so the behavior is correct, but the name is misleading. */
1475#define HAVE_SAFARI_SERVICES_FRAMEWORK 1
1476#endif
1477
1478#if PLATFORM(MAC) || PLATFORM(IOS) || PLATFORM(WATCHOS)
1479#define HAVE_SAFE_BROWSING 1
1480#endif
1481
1482#if PLATFORM(IOS)
1483#define HAVE_LINK_PREVIEW 1
1484#endif
1485
1486#if PLATFORM(COCOA)
1487/* FIXME: This is a USE style macro, as it triggers the use of CFURLConnection framework stubs. */
1488/* FIXME: Is this still necessary? CFURLConnection isn't used on Cocoa platforms any more. */
1489#define ENABLE_SEC_ITEM_SHIM 1
1490#endif
1491
1492#if (PLATFORM(IOS_FAMILY) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400))
1493#define HAVE_ACCESSIBILITY_SUPPORT 1
1494#endif
1495
1496#if PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000 && __IPHONE_OS_VERSION_MAX_ALLOWED >= 130100
1497#define HAVE_ACCESSIBILITY_BUNDLES_PATH 1
1498#endif
1499
1500#if PLATFORM(MAC)
1501#define ENABLE_FULL_KEYBOARD_ACCESS 1
1502#endif
1503
1504#if ((PLATFORM(COCOA) || PLATFORM(PLAYSTATION) || PLATFORM(WPE)) && ENABLE(ASYNC_SCROLLING)) || PLATFORM(GTK)
1505#define ENABLE_KINETIC_SCROLLING 1
1506#endif
1507
1508#if PLATFORM(IOS_FAMILY) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400)
1509#define HAVE_AUTHORIZATION_STATUS_FOR_MEDIA_TYPE 1
1510#endif
1511
1512#if (PLATFORM(MAC) && (__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) || PLATFORM(APPLETV)
1513#define HAVE_CFNETWORK_OVERRIDE_SESSION_COOKIE_ACCEPT_POLICY 1
1514#endif
1515
1516#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000)
1517#define HAVE_CFNETWORK_NSURLSESSION_STRICTRUSTEVALUATE 1
1518#endif
1519
1520#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) || PLATFORM(IOS_FAMILY)
1521#define HAVE_CFNETWORK_NEGOTIATED_SSL_PROTOCOL_CIPHER 1
1522#endif
1523
1524#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101600) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000)
1525#define HAVE_CFNETWORK_METRICS_APIS_V4 1
1526#endif
1527
1528#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500
1529#define HAVE_CSCHECKFIXDISABLE 1
1530#endif
1531
1532#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) || PLATFORM(IOS_FAMILY)
1533#define HAVE_SANDBOX_ISSUE_MACH_EXTENSION_TO_PROCESS_BY_AUDIT_TOKEN 1
1534#endif
1535
1536#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) || PLATFORM(IOS_FAMILY)
1537#define HAVE_SANDBOX_ISSUE_READ_EXTENSION_TO_PROCESS_BY_AUDIT_TOKEN 1
1538#endif
1539
1540#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000)
1541#define HAVE_MDNS_FAST_REGISTRATION 1
1542#endif
1543
1544#if PLATFORM(MAC)
1545#define ENABLE_MONOSPACE_FONT_EXCEPTION (__MAC_OS_X_VERSION_MIN_REQUIRED < 101500)
1546#elif PLATFORM(IOS_FAMILY)
1547#define ENABLE_MONOSPACE_FONT_EXCEPTION (__IPHONE_OS_VERSION_MIN_REQUIRED < 130000)
1548#endif
1549
1550#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) || PLATFORM(IOS_FAMILY)
1551#define HAVE_DISALLOWABLE_USER_INSTALLED_FONTS 1
1552#endif
1553
1554#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000 && __IPHONE_OS_VERSION_MAX_ALLOWED >= 130100)
1555#define HAVE_CTFONTCREATEFORCHARACTERSWITHLANGUAGEANDOPTION 1
1556#endif
1557
1558#if PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000
1559#define HAVE_ARKIT_QUICK_LOOK_PREVIEW_ITEM 1
1560#endif
1561
1562#if PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000
1563#define HAVE_UI_WK_DOCUMENT_CONTEXT 1
1564#endif
1565
1566#if PLATFORM(MACCATALYST)
1567#define ENABLE_PLATFORM_DRIVEN_TEXT_CHECKING 1
1568#define HAVE_HOVER_GESTURE_RECOGNIZER 1
1569#define HAVE_UI_PARALLAX_TRANSITION_GESTURE_RECOGNIZER 1
1570#endif
1571
1572#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) || PLATFORM(IOS_FAMILY)
1573#define HAVE_ALLOWS_SENSITIVE_LOGGING 1
1574#endif
1575
1576#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) || PLATFORM(IOS_FAMILY)
1577#define HAVE_FAIRPLAYSTREAMING_CENC_INITDATA 1
1578#endif
1579
1580#if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000) || PLATFORM(WATCHOS) || PLATFORM(APPLETV)
1581#define HAVE_UI_SCROLL_VIEW_INDICATOR_FLASHING_SPI 1
1582#endif
1583
1584#if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000) || PLATFORM(WATCHOS) || PLATFORM(APPLETV)
1585#define HAVE_APP_LINKS_WITH_ISENABLED 1
1586#endif
1587
1588#if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000)
1589#define HAVE_ROUTE_SHARING_POLICY_LONG_FORM_VIDEO 1
1590#endif
1591
1592#if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 120000 && !PLATFORM(IOS_SIMULATOR))
1593#define HAVE_DEVICE_MANAGEMENT 1
1594#endif
1595
1596#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED < 101500
1597#define USE_REALPATH_FOR_DLOPEN_PREFLIGHT 1
1598#endif
1599
1600#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000) || PLATFORM(WATCHOS) || PLATFORM(APPLETV)
1601#define HAVE_NSURLSESSION_WEBSOCKET 1
1602#endif
1603
1604#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000) || PLATFORM(WATCHOS) || PLATFORM(APPLETV)
1605#define HAVE_AVPLAYER_RESOURCE_CONSERVATION_LEVEL 1
1606#endif
1607
1608#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 120000) || PLATFORM(WATCHOS) || PLATFORM(APPLETV)
1609#define HAVE_CORETEXT_AUTO_OPTICAL_SIZING 1
1610#endif
1611
1612#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101500) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED < 130000)
1613#define HAVE_NSFONT_WITH_OPTICAL_SIZING_BUG 1
1614#endif
1615
1616#if (PLATFORM(IOS) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500))
1617#define HAVE_APP_SSO 1
1618#endif
1619
1620#if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000 || PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) || PLATFORM(WATCHOS) || PLATFORM(APPLETV) || PLATFORM(MACCATALYST)
1621#define HAVE_TLS_PROTOCOL_VERSION_T 1
1622#endif
1623
1624#if PLATFORM(IOS) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) || PLATFORM(WATCHOS) || PLATFORM(APPLETV) || PLATFORM(MACCATALYST)
1625#define HAVE_SEC_TRUST_EVALUATE_WITH_ERROR 1
1626#endif
1627
1628#if PLATFORM(IOS) || PLATFORM(MACCATALYST)
1629#define USE_UICONTEXTMENU 1
1630#endif
1631
1632#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500
1633#define HAVE_SUBVIEWS_IVAR_SPI 1
1634#endif
1635
1636#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED < 101500
1637#define HAVE_SUBVIEWS_IVAR_DECLARED_BY_SDK 1
1638#endif
1639
1640#if PLATFORM(MAC) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000) || PLATFORM(WATCHOS) || PLATFORM(APPLETV)
1641#define USE_PLATFORM_SYSTEM_FALLBACK_LIST 1
1642#endif
1643
1644#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 101500
1645#define HAVE_AX_CLIENT_TYPE 1
1646#endif
1647
1648#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000) || PLATFORM(WATCHOS) || PLATFORM(APPLETV)
1649#define HAVE_DESIGN_SYSTEM_UI_FONTS 1
1650#endif
1651
1652#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) || (PLATFORM(IOS) && !PLATFORM(IOS_SIMULATOR))
1653#define HAVE_DEVICE_IDENTITY 1
1654#endif
1655
1656#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) || PLATFORM(IOS_FAMILY)
1657#define HAVE_DATA_PROTECTION_KEYCHAIN 1
1658#endif
1659
1660#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) || (PLATFORM(IOS_FAMILY) && !PLATFORM(IOS_FAMILY_SIMULATOR))
1661#define HAVE_NEAR_FIELD 1
1662#endif
1663