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