Changeset 254452 in webkit


Ignore:
Timestamp:
Jan 13, 2020 1:49:24 PM (4 years ago)
Author:
weinig@apple.com
Message:

Platform.h is out of control Part 3: Move all ENABLE_* macros definitions in FeatureDefines.h
https://bugs.webkit.org/show_bug.cgi?id=206139

Reviewed by Anders Carlsson.

  • Moves all remaining ENABLE_* defines out of Platform.h and into FeatureDefines.h
  • Moves most, USE_UDIS86 and USE_ARM64_DISASSEMBLER are tangled up in the JIT definitions still, HAVE_* and USE_* defines out of FeatureDefines.h and into Platform.h
  • Where straigthforward, convert macro definitions into a canonical 3 line entry of the form:


#if !defined(MACRO_NAME) && (<CONDITIONS HERE>)
#define MACRO_NAME 1
#endif

There is rarely (if ever) a resone to undefine or define one of these platform related
macros to 0 as the usage macros (e.g. HAVE(...), ENABLE(...), etc.) handle undefined as 0.

  • Added a guard so that FeatureDefines.h can't be included directly, and must be included via Platform.h. This is necessary as it depends heavily on macros defined in Platform.h
  • Added numerous FIXMEs detailing follow up cleaning.
  • wtf/FeatureDefines.h:
  • wtf/Platform.h:
Location:
trunk/Source/WTF
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r254417 r254452  
     12020-01-13  Sam Weinig  <weinig@apple.com>
     2
     3        Platform.h is out of control Part 3: Move all ENABLE_* macros definitions in FeatureDefines.h
     4        https://bugs.webkit.org/show_bug.cgi?id=206139
     5
     6        Reviewed by Anders Carlsson.
     7
     8        - Moves all remaining ENABLE_* defines out of Platform.h and into FeatureDefines.h
     9        - Moves most, USE_UDIS86 and USE_ARM64_DISASSEMBLER are tangled up in the JIT definitions
     10          still, HAVE_* and USE_* defines out of FeatureDefines.h and into Platform.h
     11        - Where straigthforward, convert macro definitions into a canonical 3 line entry of the
     12          form:
     13         
     14              #if !defined(MACRO_NAME) && (<CONDITIONS HERE>)
     15              #define MACRO_NAME 1
     16              #endif
     17
     18          There is rarely (if ever) a resone to undefine or define one of these platform related
     19          macros to 0 as the usage macros (e.g. HAVE(...), ENABLE(...), etc.) handle undefined as 0.
     20        - Added a guard so that FeatureDefines.h can't be included directly, and must be included via
     21          Platform.h. This is necessary as it depends heavily on macros defined in Platform.h
     22        - Added numerous FIXMEs detailing follow up cleaning.
     23
     24        * wtf/FeatureDefines.h:
     25        * wtf/Platform.h:
     26
    1272020-01-12  Sam Weinig  <weinig@apple.com>
    228
  • trunk/Source/WTF/wtf/FeatureDefines.h

    r254384 r254452  
    2929#pragma once
    3030
     31#ifndef __PLATFORM_INDIRECT__
     32#error "Please #include <wtf/Platform.h> instead of this file directly."
     33#endif
     34
    3135/* Use this file to list _all_ ENABLE() macros. Define the macros to be one of the following values:
    3236 *  - "0" disables the feature by default. The feature can still be enabled for a specific port or environment.
     
    184188#endif
    185189
    186 #if !defined(HAVE_PDFHOSTVIEWCONTROLLER_SNAPSHOTTING)
    187 #if PLATFORM(IOS)
    188 #define HAVE_PDFHOSTVIEWCONTROLLER_SNAPSHOTTING 1
    189 #endif
    190 #endif
    191 
    192 #if PLATFORM(MACCATALYST) || PLATFORM(IOS)
    193 #if !defined(USE_UIKIT_KEYBOARD_ADDITIONS)
    194 #define USE_UIKIT_KEYBOARD_ADDITIONS 1
    195 #endif
    196 #endif
    197 
    198 #if !defined(HAVE_VISIBILITY_PROPAGATION_VIEW)
    199 #define HAVE_VISIBILITY_PROPAGATION_VIEW 1
    200 #endif
    201 
    202 #if !defined(HAVE_UISCENE)
    203 #define HAVE_UISCENE 1
    204 #endif
    205 
    206 #if !defined(HAVE_AVSTREAMSESSION)
    207 #define HAVE_AVSTREAMSESSION 0
    208 #endif
    209 
    210190#if !defined(ENABLE_MEDIA_SOURCE)
    211191#define ENABLE_MEDIA_SOURCE 0
    212 #endif
    213 
    214 #if !defined(HAVE_PASSKIT_API_TYPE)
    215 #define HAVE_PASSKIT_API_TYPE 1
    216 #endif
    217 
    218 #if !defined(HAVE_PASSKIT_BOUND_INTERFACE_IDENTIFIER)
    219 #if PLATFORM(IOS)
    220 #define HAVE_PASSKIT_BOUND_INTERFACE_IDENTIFIER 1
    221 #endif
    222192#endif
    223193
     
    232202#endif
    233203
     204/* FIXME: This seems unused. If so, it should be removed. */
     205#if CPU(ARM64)
     206#define ENABLE_JIT_CONSTANT_BLINDING 0
     207#endif
     208
    234209#endif /* PLATFORM(IOS_FAMILY) */
    235210
     
    300275#endif
    301276
    302 #if !defined(HAVE_AVSTREAMSESSION)
    303 #define HAVE_AVSTREAMSESSION 1
    304 #endif
    305 
    306277#if !defined(ENABLE_MEDIA_SOURCE)
    307278#define ENABLE_MEDIA_SOURCE 1
    308 #endif
    309 
    310 #if !defined(HAVE_PASSKIT_API_TYPE)
    311 #define HAVE_PASSKIT_API_TYPE 1
    312 #endif
    313 
    314 #if !defined(HAVE_PASSKIT_BOUND_INTERFACE_IDENTIFIER)
    315 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
    316 #define HAVE_PASSKIT_BOUND_INTERFACE_IDENTIFIER 1
    317 #endif
    318279#endif
    319280
     
    753714#endif
    754715
     716
     717/* JIT Features */
     718
     719/* The JIT is enabled by default on all x86-64 & ARM64 platforms. */
     720#if !defined(ENABLE_JIT) &&  (CPU(X86_64) || CPU(ARM64)) && !CPU(APPLE_ARMV7K)
     721#define ENABLE_JIT 1
     722#endif
     723
     724#if USE(JSVALUE32_64)
     725#if (CPU(ARM_THUMB2) || CPU(MIPS)) && OS(LINUX)
     726/* On ARMv7 and MIPS on Linux the JIT is enabled unless explicitly disabled. */
     727#if !defined(ENABLE_JIT)
     728#define ENABLE_JIT 1
     729#endif
     730#else
     731/* Disable JIT and force C_LOOP on all other 32bit architectures. */
     732#undef ENABLE_JIT
     733#define ENABLE_JIT 0
     734#undef ENABLE_C_LOOP
     735#define ENABLE_C_LOOP 1
     736#endif
     737#endif
     738
     739#if !defined(ENABLE_C_LOOP)
     740#if ENABLE(JIT) || CPU(X86_64) || (CPU(ARM64) && !defined(__ILP32__))
     741#define ENABLE_C_LOOP 0
     742#else
     743#define ENABLE_C_LOOP 1
     744#endif
     745#endif
     746
     747/* FIXME: This should be turned into an #error invariant */
     748/* The FTL *does not* work on 32-bit platforms. Disable it even if someone asked us to enable it. */
     749#if USE(JSVALUE32_64)
     750#undef ENABLE_FTL_JIT
     751#define ENABLE_FTL_JIT 0
     752#endif
     753
     754/* FIXME: This should be turned into an #error invariant */
     755/* The FTL is disabled on the iOS simulator, mostly for simplicity. */
     756#if PLATFORM(IOS_FAMILY_SIMULATOR)
     757#undef ENABLE_FTL_JIT
     758#define ENABLE_FTL_JIT 0
     759#endif
     760
     761/* FIXME: This is used to "turn on a specific feature of WebKit", so should be converted to an ENABLE macro. */
     762/* If possible, try to enable a disassembler. This is optional. We proceed in two
     763   steps: first we try to find some disassembler that we can use, and then we
     764   decide if the high-level disassembler API can be enabled. */
     765#if !defined(USE_UDIS86) && ENABLE(JIT) && CPU(X86_64) && !USE(CAPSTONE)
     766#define USE_UDIS86 1
     767#endif
     768
     769/* FIXME: This is used to "turn on a specific feature of WebKit", so should be converted to an ENABLE macro. */
     770#if !defined(USE_ARM64_DISASSEMBLER) && ENABLE(JIT) && CPU(ARM64) && !USE(CAPSTONE)
     771#define USE_ARM64_DISASSEMBLER 1
     772#endif
     773
     774#if !defined(ENABLE_DISASSEMBLER) && (USE(UDIS86) || USE(ARM64_DISASSEMBLER) || (ENABLE(JIT) && USE(CAPSTONE)))
     775#define ENABLE_DISASSEMBLER 1
     776#endif
     777
     778#if !defined(ENABLE_DFG_JIT) && ENABLE(JIT)
     779
     780/* Enable the DFG JIT on X86 and X86_64. */
     781#if CPU(X86_64) && (OS(DARWIN) || OS(LINUX) || OS(FREEBSD) || OS(HURD) || OS(WINDOWS))
     782#define ENABLE_DFG_JIT 1
     783#endif
     784
     785/* Enable the DFG JIT on ARMv7.  Only tested on iOS, Linux, and FreeBSD. */
     786#if (CPU(ARM_THUMB2) || CPU(ARM64)) && (PLATFORM(IOS_FAMILY) || OS(LINUX) || OS(FREEBSD))
     787#define ENABLE_DFG_JIT 1
     788#endif
     789/* Enable the DFG JIT on MIPS. */
     790#if CPU(MIPS)
     791#define ENABLE_DFG_JIT 1
     792#endif
     793
     794#endif /* !defined(ENABLE_DFG_JIT) && ENABLE(JIT) */
     795
     796/* Concurrent JS only works on 64-bit platforms because it requires that
     797   values get stored to atomically. This is trivially true on 64-bit platforms,
     798   but not true at all on 32-bit platforms where values are composed of two
     799   separate sub-values. */
     800#if ENABLE(JIT) && USE(JSVALUE64)
     801#define ENABLE_CONCURRENT_JS 1
     802#endif
     803
     804#if (CPU(X86_64) || CPU(ARM64)) && HAVE(FAST_TLS)
     805#define ENABLE_FAST_TLS_JIT 1
     806#endif
     807
     808#if ENABLE(JIT) && (CPU(X86) || CPU(X86_64) || CPU(ARM_THUMB2) || CPU(ARM64) || CPU(MIPS))
     809#define ENABLE_MASM_PROBE 1
     810#endif
     811
     812/* FIXME: This should be turned into an #error invariant */
     813/* If the baseline jit is not available, then disable upper tiers as well.
     814   The MacroAssembler::probe() is also required for supporting the upper tiers. */
     815#if !ENABLE(JIT) || !ENABLE(MASM_PROBE)
     816#undef ENABLE_DFG_JIT
     817#undef ENABLE_FTL_JIT
     818#define ENABLE_DFG_JIT 0
     819#define ENABLE_FTL_JIT 0
     820#endif
     821
     822/* FIXME: This should be turned into an #error invariant */
     823/* If the DFG jit is not available, then disable upper tiers as well: */
     824#if !ENABLE(DFG_JIT)
     825#undef ENABLE_FTL_JIT
     826#define ENABLE_FTL_JIT 0
     827#endif
     828
     829/* This controls whether B3 is built. B3 is needed for FTL JIT and WebAssembly */
     830#if ENABLE(FTL_JIT)
     831#define ENABLE_B3_JIT 1
     832#endif
     833
     834#if !defined(ENABLE_WEBASSEMBLY) && (ENABLE(B3_JIT) && PLATFORM(COCOA) && CPU(ADDRESS64))
     835#define ENABLE_WEBASSEMBLY 1
     836#endif
     837
     838/* The SamplingProfiler is the probabilistic and low-overhead profiler used by
     839 * JSC to measure where time is spent inside a JavaScript program.
     840 * In configurations other than Windows and Darwin, because layout of mcontext_t depends on standard libraries (like glibc),
     841 * sampling profiler is enabled if WebKit uses pthreads and glibc. */
     842#if !defined(ENABLE_SAMPLING_PROFILER) && (!ENABLE(C_LOOP) && (OS(WINDOWS) || HAVE(MACHINE_CONTEXT)))
     843#define ENABLE_SAMPLING_PROFILER 1
     844#endif
     845
     846#if ENABLE(WEBASSEMBLY) && HAVE(MACHINE_CONTEXT)
     847#define ENABLE_WEBASSEMBLY_FAST_MEMORY 1
     848#endif
     849
     850/* Counts uses of write barriers using sampling counters. Be sure to also
     851   set ENABLE_SAMPLING_COUNTERS to 1. */
     852#if !defined(ENABLE_WRITE_BARRIER_PROFILING)
     853#define ENABLE_WRITE_BARRIER_PROFILING 0
     854#endif
     855
     856/* Logs all allocation-related activity that goes through fastMalloc or the
     857   JSC GC (both cells and butterflies). Also logs marking. Note that this
     858   isn't a completely accurate view of the heap since it doesn't include all
     859   butterfly resize operations, doesn't tell you what is going on with weak
     860   references (other than to tell you when they're marked), and doesn't
     861   track direct mmap() allocations or things like JIT allocation. */
     862#if !defined(ENABLE_ALLOCATION_LOGGING)
     863#define ENABLE_ALLOCATION_LOGGING 0
     864#endif
     865
     866/* Enable verification that that register allocations are not made within generated control flow.
     867   Turned on for debug builds. */
     868#if !defined(ENABLE_DFG_REGISTER_ALLOCATION_VALIDATION) && ENABLE(DFG_JIT) && !defined(NDEBUG)
     869#define ENABLE_DFG_REGISTER_ALLOCATION_VALIDATION 1
     870#endif
     871
     872#if !defined(ENABLE_SEPARATED_WX_HEAP) && PLATFORM(IOS_FAMILY) && CPU(ARM64) && (!ENABLE(FAST_JIT_PERMISSIONS) || !CPU(ARM64E))
     873#define ENABLE_SEPARATED_WX_HEAP 1
     874#endif
     875
     876/* Determine if we need to enable Computed Goto Opcodes or not: */
     877#if HAVE(COMPUTED_GOTO) || !ENABLE(C_LOOP)
     878#define ENABLE_COMPUTED_GOTO_OPCODES 1
     879#endif
     880
     881/* Regular Expression Tracing - Set to 1 to trace RegExp's in jsc.  Results dumped at exit */
     882#if !defined(ENABLE_REGEXP_TRACING)
     883#define ENABLE_REGEXP_TRACING 0
     884#endif
     885
     886/* Yet Another Regex Runtime - turned on by default for JIT enabled ports. */
     887#if !defined(ENABLE_YARR_JIT) && ENABLE(JIT)
     888#define ENABLE_YARR_JIT 1
     889#endif
     890
     891/* Setting this flag compares JIT results with interpreter results. */
     892#if !defined(ENABLE_YARR_JIT) && ENABLE(JIT)
     893#define ENABLE_YARR_JIT_DEBUG 0
     894#endif
     895
     896/* Enable JIT'ing Regular Expressions that have nested parenthesis . */
     897#if ENABLE(YARR_JIT) && (CPU(ARM64) || (CPU(X86_64) && !OS(WINDOWS)))
     898#define ENABLE_YARR_JIT_ALL_PARENS_EXPRESSIONS 1
     899#endif
     900
     901/* Enable JIT'ing Regular Expressions that have nested back references. */
     902#if ENABLE(YARR_JIT) && (CPU(ARM64) || (CPU(X86_64) && !OS(WINDOWS)))
     903#define ENABLE_YARR_JIT_BACKREFERENCES 1
     904#endif
     905
     906/* If either the JIT or the RegExp JIT is enabled, then the Assembler must be
     907   enabled as well: */
     908#if ENABLE(JIT) || ENABLE(YARR_JIT) || !ENABLE(C_LOOP)
     909#if defined(ENABLE_ASSEMBLER) && !ENABLE_ASSEMBLER
     910#error "Cannot enable the JIT or RegExp JIT without enabling the Assembler"
     911#else
     912#undef ENABLE_ASSEMBLER
     913#define ENABLE_ASSEMBLER 1
     914#endif
     915#endif
     916
     917/* If the Disassembler is enabled, then the Assembler must be enabled as well: */
     918#if ENABLE(DISASSEMBLER)
     919#if defined(ENABLE_ASSEMBLER) && !ENABLE_ASSEMBLER
     920#error "Cannot enable the Disassembler without enabling the Assembler"
     921#else
     922#undef ENABLE_ASSEMBLER
     923#define ENABLE_ASSEMBLER 1
     924#endif
     925#endif
     926
     927#if !defined(ENABLE_EXCEPTION_SCOPE_VERIFICATION)
     928#define ENABLE_EXCEPTION_SCOPE_VERIFICATION ASSERT_ENABLED
     929#endif
     930
     931#if ENABLE(DFG_JIT) && HAVE(MACHINE_CONTEXT) && (CPU(X86_64) || CPU(ARM64))
     932#define ENABLE_SIGNAL_BASED_VM_TRAPS 1
     933#endif
     934
     935/* CSS Selector JIT Compiler */
     936#if !defined(ENABLE_CSS_SELECTOR_JIT) && ((CPU(X86_64) || CPU(ARM64) || (CPU(ARM_THUMB2) && PLATFORM(IOS_FAMILY))) && ENABLE(JIT) && (OS(DARWIN) || PLATFORM(GTK) || PLATFORM(WPE)))
     937#define ENABLE_CSS_SELECTOR_JIT 1
     938#endif
     939
     940#if PLATFORM(COCOA) && !PLATFORM(WATCHOS) && !PLATFORM(APPLETV) && !PLATFORM(MACCATALYST)
     941#define ENABLE_DATA_DETECTION 1
     942#endif
     943
     944#if CPU(ARM_THUMB2) || CPU(ARM64)
     945#define ENABLE_BRANCH_COMPACTION 1
     946#endif
     947
     948#if !defined(ENABLE_THREADING_LIBDISPATCH) && HAVE(DISPATCH_H)
     949#define ENABLE_THREADING_LIBDISPATCH 1
     950#elif !defined(ENABLE_THREADING_OPENMP) && defined(_OPENMP)
     951#define ENABLE_THREADING_OPENMP 1
     952#elif !defined(THREADING_GENERIC)
     953#define ENABLE_THREADING_GENERIC 1
     954#endif
     955
     956#if !defined(ENABLE_GC_VALIDATION) && !defined(NDEBUG)
     957#define ENABLE_GC_VALIDATION 1
     958#endif
     959
     960#if !defined(ENABLE_BINDING_INTEGRITY) && !OS(WINDOWS)
     961#define ENABLE_BINDING_INTEGRITY 1
     962#endif
     963
     964#if !defined(ENABLE_TREE_DEBUGGING) && !defined(NDEBUG)
     965#define ENABLE_TREE_DEBUGGING 1
     966#endif
     967
     968#if PLATFORM(COCOA)
     969#define ENABLE_RESOURCE_USAGE 1
     970#endif
     971
     972/* FIXME: Document or remove explicit undef. */
     973#if PLATFORM(GTK) || PLATFORM(WPE)
     974#undef ENABLE_OPENTYPE_VERTICAL
     975#define ENABLE_OPENTYPE_VERTICAL 1
     976#endif
     977
     978/* FIXME: Document or remove explicit undef. */
     979#if (OS(DARWIN) && USE(CG)) || (USE(FREETYPE) && !PLATFORM(GTK)) || (PLATFORM(WIN) && (USE(CG) || USE(CAIRO)))
     980#undef ENABLE_OPENTYPE_MATH
     981#define ENABLE_OPENTYPE_MATH 1
     982#endif
     983
     984/*
     985 * Enable this to put each IsoHeap and other allocation categories into their own malloc heaps, so that tools like vmmap can show how big each heap is.
     986 * Turn BENABLE_MALLOC_HEAP_BREAKDOWN on in bmalloc together when using this.
     987 */
     988#if !defined(ENABLE_MALLOC_HEAP_BREAKDOWN)
     989#define ENABLE_MALLOC_HEAP_BREAKDOWN 0
     990#endif
     991
     992/* Disable SharedArrayBuffers until Spectre security concerns are mitigated. */
     993#define ENABLE_SHARED_ARRAY_BUFFER 0
     994
     995/* FIXME: __LP64__ can probably be removed now that 32-bit macOS is no longer supported. */
     996#if PLATFORM(MAC) && defined(__LP64__)
     997#define ENABLE_WEB_PLAYBACK_CONTROLS_MANAGER 1
     998#endif
     999
     1000#if PLATFORM(COCOA)
     1001/* FIXME: This is a USE style macro, as it triggers the use of CFURLConnection framework stubs. */
     1002/* FIXME: Is this still necessary? CFURLConnection isn't used on Cocoa platforms any more. */
     1003#define ENABLE_SEC_ITEM_SHIM 1
     1004#endif
     1005
     1006#if PLATFORM(MAC)
     1007#define ENABLE_FULL_KEYBOARD_ACCESS 1
     1008#endif
     1009
     1010#if ((PLATFORM(COCOA) || PLATFORM(PLAYSTATION) || PLATFORM(WPE)) && ENABLE(ASYNC_SCROLLING)) || PLATFORM(GTK)
     1011#define ENABLE_KINETIC_SCROLLING 1
     1012#endif
     1013
     1014#if !defined(ENABLE_MONOSPACE_FONT_EXCEPTION) && ((PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101500) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED < 130000))
     1015#define ENABLE_MONOSPACE_FONT_EXCEPTION 1
     1016#endif
     1017
     1018#if !defined(ENABLE_PLATFORM_DRIVEN_TEXT_CHECKING) && PLATFORM(MACCATALYST)
     1019#define ENABLE_PLATFORM_DRIVEN_TEXT_CHECKING 1
     1020#endif
     1021
     1022
    7551023/* Asserts, invariants for macro definitions */
    7561024
  • trunk/Source/WTF/wtf/Platform.h

    r254417 r254452  
    173173#endif
    174174
    175 /* Graphics engines */
    176 
    177 /* USE(CG) and PLATFORM(CI) */
    178 #if PLATFORM(COCOA)
    179 #define USE_CG 1
    180 #define USE_CA 1
    181 #endif
    182 
    183 #if PLATFORM(GTK) || PLATFORM(WPE)
    184 #define USE_GLIB 1
    185 #define USE_FREETYPE 1
    186 #define USE_HARFBUZZ 1
    187 #define USE_SOUP 1
    188 #define USE_WEBP 1
    189 #define USE_FILE_LOCK 1
    190 #endif
    191 
    192 #if PLATFORM(GTK)
    193 #define GLIB_VERSION_MIN_REQUIRED GLIB_VERSION_2_36
    194 #define GDK_VERSION_MIN_REQUIRED GDK_VERSION_3_6
    195 #endif
    196 
    197 #if PLATFORM(WPE)
    198 #define GLIB_VERSION_MIN_REQUIRED GLIB_VERSION_2_40
    199 #endif
    200 
    201 #if USE(SOUP)
    202 #define SOUP_VERSION_MIN_REQUIRED SOUP_VERSION_2_42
    203 #endif
    204 
    205 /* On Windows, use QueryPerformanceCounter by default */
    206 #if OS(WINDOWS)
    207 #define USE_QUERY_PERFORMANCE_COUNTER  1
    208 #endif
    209 
    210 #if PLATFORM(COCOA)
    211 
    212 #define HAVE_OUT_OF_PROCESS_LAYER_HOSTING 1
    213 #define USE_CF 1
    214 #define USE_FILE_LOCK 1
    215 #define USE_FOUNDATION 1
    216 #define USE_NETWORK_CFDATA_ARRAY_CALLBACK 1
    217 
    218 /* Cocoa defines a series of platform macros for debugging. */
    219 /* Some of them are really annoying because they use common names (e.g. check()). */
    220 /* Disable those macros so that we are not limited in how we name methods and functions. */
    221 #undef __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES
    222 #define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
    223 
    224 #endif
    225 
    226 #if PLATFORM(MAC)
    227 
    228 #define HAVE_RUNLOOP_TIMER 1
    229 #define HAVE_SEC_KEYCHAIN 1
    230 #define HAVE_HISERVICES 1
    231 #define USE_APPKIT 1
    232 #define USE_PASSKIT 1
    233 
    234 #if CPU(X86_64)
    235 #define HAVE_NETWORK_EXTENSION 1
    236 #define USE_PLUGIN_HOST_PROCESS 1
    237 #endif
    238 #endif /* PLATFORM(MAC) */
    239 
    240 #if PLATFORM(IOS_FAMILY)
    241 
    242 #define HAVE_NETWORK_EXTENSION 1
    243 #define HAVE_READLINE 1
    244 #define USE_UIKIT_EDITING 1
    245 #define USE_WEB_THREAD 1
    246 
    247 #if CPU(ARM64)
    248 #define ENABLE_JIT_CONSTANT_BLINDING 0
    249 #endif
    250 
    251 #if CPU(ARM_NEON)
    252 #undef HAVE_ARM_NEON_INTRINSICS
    253 #define HAVE_ARM_NEON_INTRINSICS 0
    254 #endif
    255 
    256 #endif /* PLATFORM(IOS_FAMILY) */
    257 
    258 #if !defined(HAVE_ACCESSIBILITY)
    259 #if PLATFORM(COCOA) || PLATFORM(WIN) || PLATFORM(GTK) || PLATFORM(WPE)
    260 #define HAVE_ACCESSIBILITY 1
    261 #endif
    262 #endif /* !defined(HAVE_ACCESSIBILITY) */
    263 
    264 /* FIXME: Remove after CMake build enabled on Darwin */
    265 #if OS(DARWIN)
    266 #define HAVE_ERRNO_H 1
    267 #define HAVE_LANGINFO_H 1
    268 #define HAVE_LOCALTIME_R 1
    269 #define HAVE_MMAP 1
    270 #define HAVE_REGEX_H 1
    271 #define HAVE_SIGNAL_H 1
    272 #define HAVE_STAT_BIRTHTIME 1
    273 #define HAVE_STRINGS_H 1
    274 #define HAVE_STRNSTR 1
    275 #define HAVE_SYS_PARAM_H 1
    276 #define HAVE_SYS_TIME_H 1
    277 #define HAVE_TM_GMTOFF 1
    278 #define HAVE_TM_ZONE 1
    279 #define HAVE_TIMEGM 1
    280 #define HAVE_PTHREAD_MAIN_NP 1
    281 
    282 #if CPU(X86_64) || CPU(ARM64)
    283 #define HAVE_INT128_T 1
    284 #endif
    285 #endif /* OS(DARWIN) */
    286 
    287 #if OS(UNIX)
    288 #define USE_PTHREADS 1
    289 #endif /* OS(UNIX) */
    290 
    291 #if OS(UNIX) && !OS(FUCHSIA)
    292 #define HAVE_RESOURCE_H 1
    293 #define HAVE_PTHREAD_SETSCHEDPARAM 1
    294 #endif
    295 
    296 #if OS(DARWIN)
    297 #define HAVE_DISPATCH_H 1
    298 #define HAVE_MADV_FREE 1
    299 #define HAVE_MADV_FREE_REUSE 1
    300 #define HAVE_MADV_DONTNEED 1
    301 #define HAVE_MERGESORT 1
    302 #define HAVE_PTHREAD_SETNAME_NP 1
    303 #define HAVE_READLINE 1
    304 #define HAVE_SYS_TIMEB_H 1
    305 #define HAVE_AUDIT_TOKEN 1
    306 
    307 #if __has_include(<mach/mach_exc.defs>) && !PLATFORM(GTK)
    308 #define HAVE_MACH_EXCEPTIONS 1
    309 #endif
    310 
    311 #if !PLATFORM(GTK)
    312 #define USE_ACCELERATE 1
    313 #endif
    314 #if !PLATFORM(IOS_FAMILY)
    315 #define HAVE_HOSTED_CORE_ANIMATION 1
    316 #endif
    317 
    318 #endif /* OS(DARWIN) */
    319 
    320 #if OS(DARWIN) || OS(FUCHSIA) || ((OS(FREEBSD) || defined(__GLIBC__) || defined(__BIONIC__)) && (CPU(X86) || CPU(X86_64) || CPU(ARM) || CPU(ARM64) || CPU(MIPS)))
    321 #define HAVE_MACHINE_CONTEXT 1
    322 #endif
    323 
    324 #if OS(DARWIN) || (OS(LINUX) && defined(__GLIBC__) && !defined(__UCLIBC__) && !CPU(MIPS))
    325 #define HAVE_BACKTRACE 1
    326 #endif
    327 
    328 #if OS(DARWIN) || OS(LINUX)
    329 #if PLATFORM(GTK)
    330 #if defined(__GLIBC__) && !defined(__UCLIBC__) && !CPU(MIPS)
    331 #define HAVE_BACKTRACE_SYMBOLS 1
    332 #endif
    333 #endif /* PLATFORM(GTK) */
    334 #define HAVE_DLADDR 1
    335 #endif /* OS(DARWIN) || OS(LINUX) */
    336 
    337 
    338 /* ENABLE macro defaults */
    339 
    340 /* FIXME: move out all ENABLE() defines from here to FeatureDefines.h */
    341 
    342 #if USE(APPLE_INTERNAL_SDK) && __has_include(<WebKitAdditions/AdditionalPlatform.h>)
    343 #include <WebKitAdditions/AdditionalPlatform.h>
    344 #endif
    345 
    346 #if USE(APPLE_INTERNAL_SDK) && __has_include(<WebKitAdditions/AdditionalFeatureDefines.h>)
    347 #include <WebKitAdditions/AdditionalFeatureDefines.h>
    348 #endif
    349 
    350 /* Include feature macros */
    351 #include <wtf/FeatureDefines.h>
    352 
    353 #if OS(WINDOWS)
    354 #define USE_SYSTEM_MALLOC 1
    355 #endif
    356 
    357 
    358 #if !defined(USE_JSVALUE64) && !defined(USE_JSVALUE32_64)
    359 #if CPU(ADDRESS64) || CPU(ARM64)
    360 #define USE_JSVALUE64 1
    361 #else
    362 #define USE_JSVALUE32_64 1
    363 #endif
    364 #endif /* !defined(USE_JSVALUE64) && !defined(USE_JSVALUE32_64) */
    365 
    366 /* The JIT is enabled by default on all x86-64 & ARM64 platforms. */
    367 #if !defined(ENABLE_JIT) \
    368     && (CPU(X86_64) || CPU(ARM64)) \
    369     && !CPU(APPLE_ARMV7K)
    370 #define ENABLE_JIT 1
    371 #endif
    372 
    373 #if USE(JSVALUE32_64)
    374 #if (CPU(ARM_THUMB2) || CPU(MIPS)) && OS(LINUX)
    375 /* On ARMv7 and MIPS on Linux the JIT is enabled unless explicitly disabled. */
    376 #if !defined(ENABLE_JIT)
    377 #define ENABLE_JIT 1
    378 #endif
    379 #else
    380 /* Disable JIT and force C_LOOP on all other 32bit architectures. */
    381 #undef ENABLE_JIT
    382 #define ENABLE_JIT 0
    383 #undef ENABLE_C_LOOP
    384 #define ENABLE_C_LOOP 1
    385 #endif
    386 #endif
    387 
    388 #if !defined(ENABLE_C_LOOP)
    389 #if ENABLE(JIT) \
    390     || CPU(X86_64) || (CPU(ARM64) && !defined(__ILP32__))
    391 #define ENABLE_C_LOOP 0
    392 #else
    393 #define ENABLE_C_LOOP 1
    394 #endif
    395 #endif
    396 
    397 /* The FTL *does not* work on 32-bit platforms. Disable it even if someone asked us to enable it. */
    398 #if USE(JSVALUE32_64)
    399 #undef ENABLE_FTL_JIT
    400 #define ENABLE_FTL_JIT 0
    401 #endif
    402 
    403 /* The FTL is disabled on the iOS simulator, mostly for simplicity. */
    404 #if PLATFORM(IOS_FAMILY_SIMULATOR)
    405 #undef ENABLE_FTL_JIT
    406 #define ENABLE_FTL_JIT 0
    407 #endif
    408 
    409 /* If possible, try to enable a disassembler. This is optional. We proceed in two
    410    steps: first we try to find some disassembler that we can use, and then we
    411    decide if the high-level disassembler API can be enabled. */
    412 #if !defined(USE_UDIS86) && ENABLE(JIT) && CPU(X86_64) && !USE(CAPSTONE)
    413 #define USE_UDIS86 1
    414 #endif
    415 
    416 #if !defined(USE_ARM64_DISASSEMBLER) && ENABLE(JIT) && CPU(ARM64) && !USE(CAPSTONE)
    417 #define USE_ARM64_DISASSEMBLER 1
    418 #endif
    419 
    420 #if !defined(ENABLE_DISASSEMBLER) && (USE(UDIS86) || USE(ARM64_DISASSEMBLER) || (ENABLE(JIT) && USE(CAPSTONE)))
    421 #define ENABLE_DISASSEMBLER 1
    422 #endif
    423 
    424 #if !defined(ENABLE_DFG_JIT) && ENABLE(JIT)
    425 /* Enable the DFG JIT on X86 and X86_64. */
    426 #if CPU(X86_64) && (OS(DARWIN) || OS(LINUX) || OS(FREEBSD) || OS(HURD) || OS(WINDOWS))
    427 #define ENABLE_DFG_JIT 1
    428 #endif
    429 /* Enable the DFG JIT on ARMv7.  Only tested on iOS, Linux, and FreeBSD. */
    430 #if (CPU(ARM_THUMB2) || CPU(ARM64)) && (PLATFORM(IOS_FAMILY) || OS(LINUX) || OS(FREEBSD))
    431 #define ENABLE_DFG_JIT 1
    432 #endif
    433 /* Enable the DFG JIT on MIPS. */
    434 #if CPU(MIPS)
    435 #define ENABLE_DFG_JIT 1
    436 #endif
    437 #endif
    438 
    439 /* Concurrent JS only works on 64-bit platforms because it requires that
    440    values get stored to atomically. This is trivially true on 64-bit platforms,
    441    but not true at all on 32-bit platforms where values are composed of two
    442    separate sub-values. */
    443 #if ENABLE(JIT) && USE(JSVALUE64)
    444 #define ENABLE_CONCURRENT_JS 1
    445 #endif
    446 
    447 #if __has_include(<System/pthread_machdep.h>)
    448 #define HAVE_FAST_TLS 1
    449 #endif
    450 
    451 #if (CPU(X86_64) || CPU(ARM64)) && HAVE(FAST_TLS)
    452 #define ENABLE_FAST_TLS_JIT 1
    453 #endif
    454 
    455 #if CPU(X86) || CPU(X86_64) || CPU(ARM_THUMB2) || CPU(ARM64) || CPU(MIPS)
    456 #define ENABLE_MASM_PROBE 1
    457 #else
    458 #define ENABLE_MASM_PROBE 0
    459 #endif
    460 
    461 #if !ENABLE(JIT)
    462 #undef ENABLE_MASM_PROBE
    463 #define ENABLE_MASM_PROBE 0
    464 #endif
    465 
    466 /* If the baseline jit is not available, then disable upper tiers as well.
    467    The MacroAssembler::probe() is also required for supporting the upper tiers. */
    468 #if !ENABLE(JIT) || !ENABLE(MASM_PROBE)
    469 #undef ENABLE_DFG_JIT
    470 #undef ENABLE_FTL_JIT
    471 #define ENABLE_DFG_JIT 0
    472 #define ENABLE_FTL_JIT 0
    473 #endif
    474 
    475 /* If the DFG jit is not available, then disable upper tiers as well: */
    476 #if !ENABLE(DFG_JIT)
    477 #undef ENABLE_FTL_JIT
    478 #define ENABLE_FTL_JIT 0
    479 #endif
    480 
    481 /* This controls whether B3 is built. B3 is needed for FTL JIT and WebAssembly */
    482 #if ENABLE(FTL_JIT)
    483 #define ENABLE_B3_JIT 1
    484 #endif
    485 
    486 #if !defined(ENABLE_WEBASSEMBLY)
    487 #if ENABLE(B3_JIT) && PLATFORM(COCOA) && CPU(ADDRESS64)
    488 #define ENABLE_WEBASSEMBLY 1
    489 #else
    490 #define ENABLE_WEBASSEMBLY 0
    491 #endif
    492 #endif
    493 
    494 /* The SamplingProfiler is the probabilistic and low-overhead profiler used by
    495  * JSC to measure where time is spent inside a JavaScript program.
    496  * In configurations other than Windows and Darwin, because layout of mcontext_t depends on standard libraries (like glibc),
    497  * sampling profiler is enabled if WebKit uses pthreads and glibc. */
    498 #if !defined(ENABLE_SAMPLING_PROFILER)
    499 #if !ENABLE(C_LOOP) && (OS(WINDOWS) || HAVE(MACHINE_CONTEXT))
    500 #define ENABLE_SAMPLING_PROFILER 1
    501 #else
    502 #define ENABLE_SAMPLING_PROFILER 0
    503 #endif
    504 #endif
    505 
    506 #if ENABLE(WEBASSEMBLY) && HAVE(MACHINE_CONTEXT)
    507 #define ENABLE_WEBASSEMBLY_FAST_MEMORY 1
    508 #endif
    509 
    510 /* Counts uses of write barriers using sampling counters. Be sure to also
    511    set ENABLE_SAMPLING_COUNTERS to 1. */
    512 #if !defined(ENABLE_WRITE_BARRIER_PROFILING)
    513 #define ENABLE_WRITE_BARRIER_PROFILING 0
    514 #endif
    515 
    516 /* Logs all allocation-related activity that goes through fastMalloc or the
    517    JSC GC (both cells and butterflies). Also logs marking. Note that this
    518    isn't a completely accurate view of the heap since it doesn't include all
    519    butterfly resize operations, doesn't tell you what is going on with weak
    520    references (other than to tell you when they're marked), and doesn't
    521    track direct mmap() allocations or things like JIT allocation. */
    522 #if !defined(ENABLE_ALLOCATION_LOGGING)
    523 #define ENABLE_ALLOCATION_LOGGING 0
    524 #endif
    525 
    526 /* Enable verification that that register allocations are not made within generated control flow.
    527    Turned on for debug builds. */
    528 #if !defined(ENABLE_DFG_REGISTER_ALLOCATION_VALIDATION) && ENABLE(DFG_JIT)
    529 #if !defined(NDEBUG)
    530 #define ENABLE_DFG_REGISTER_ALLOCATION_VALIDATION 1
    531 #else
    532 #define ENABLE_DFG_REGISTER_ALLOCATION_VALIDATION 0
    533 #endif
    534 #endif
    535 
    536 /* Configure the JIT */
    537 #if CPU(X86) && COMPILER(MSVC)
    538 #define JSC_HOST_CALL __fastcall
    539 #elif CPU(X86) && COMPILER(GCC_COMPATIBLE)
    540 #define JSC_HOST_CALL __attribute__ ((fastcall))
    541 #else
    542 #define JSC_HOST_CALL
    543 #endif
    544 
    545 #if CPU(X86) && OS(WINDOWS)
    546 #define CALLING_CONVENTION_IS_STDCALL 1
    547 #ifndef CDECL
    548 #if COMPILER(MSVC)
    549 #define CDECL __cdecl
    550 #else
    551 #define CDECL __attribute__ ((__cdecl))
    552 #endif
    553 #endif
    554 #else
    555 #define CALLING_CONVENTION_IS_STDCALL 0
    556 #endif
    557 
    558 #if CPU(X86)
    559 #define WTF_COMPILER_SUPPORTS_FASTCALL_CALLING_CONVENTION 1
    560 #ifndef FASTCALL
    561 #if COMPILER(MSVC)
    562 #define FASTCALL __fastcall
    563 #else
    564 #define FASTCALL  __attribute__ ((fastcall))
    565 #endif
    566 #endif
    567 #else
    568 #define WTF_COMPILER_SUPPORTS_FASTCALL_CALLING_CONVENTION 0
    569 #endif
    570 
    571 #if ENABLE(JIT) && CALLING_CONVENTION_IS_STDCALL
    572 #define JIT_OPERATION CDECL
    573 #else
    574 #define JIT_OPERATION
    575 #endif
    576 
    577 #if PLATFORM(IOS_FAMILY) && CPU(ARM64) && (!ENABLE(FAST_JIT_PERMISSIONS) || !CPU(ARM64E))
    578 #define ENABLE_SEPARATED_WX_HEAP 1
    579 #else
    580 #define ENABLE_SEPARATED_WX_HEAP 0
    581 #endif
    582 
    583 /* Configure the interpreter */
    584 #if COMPILER(GCC_COMPATIBLE)
    585 #define HAVE_COMPUTED_GOTO 1
    586 #endif
    587 
    588 /* Determine if we need to enable Computed Goto Opcodes or not: */
    589 #if HAVE(COMPUTED_GOTO) || !ENABLE(C_LOOP)
    590 #define ENABLE_COMPUTED_GOTO_OPCODES 1
    591 #endif
    592 
    593 #if !defined(USE_LLINT_EMBEDDED_OPCODE_ID) && !ENABLE(C_LOOP) && !COMPILER(MSVC) && \
    594     (CPU(X86) || CPU(X86_64) || CPU(ARM64) || (CPU(ARM_THUMB2) && OS(DARWIN)))
    595 /* This feature works by embedding the OpcodeID in the 32 bit just before the generated LLint code
    596    that executes each opcode. It cannot be supported by the CLoop since there's no way to embed the
    597    OpcodeID word in the CLoop's switch statement cases. It is also currently not implemented for MSVC.
    598 */
    599 #define USE_LLINT_EMBEDDED_OPCODE_ID 1
    600 #endif
    601 
    602 /* Use __builtin_frame_address(1) to get CallFrame* */
    603 #if COMPILER(GCC_COMPATIBLE) && (CPU(ARM64) || CPU(X86_64))
    604 #define USE_BUILTIN_FRAME_ADDRESS 1
    605 #endif
    606 
    607 /* Regular Expression Tracing - Set to 1 to trace RegExp's in jsc.  Results dumped at exit */
    608 #define ENABLE_REGEXP_TRACING 0
    609 
    610 /* Yet Another Regex Runtime - turned on by default for JIT enabled ports. */
    611 #if !defined(ENABLE_YARR_JIT) && ENABLE(JIT)
    612 #define ENABLE_YARR_JIT 1
    613 
    614 /* Setting this flag compares JIT results with interpreter results. */
    615 #define ENABLE_YARR_JIT_DEBUG 0
    616 #endif
    617 
    618 #if ENABLE(YARR_JIT)
    619 #if CPU(ARM64) || (CPU(X86_64) && !OS(WINDOWS))
    620 /* Enable JIT'ing Regular Expressions that have nested parenthesis and back references. */
    621 #define ENABLE_YARR_JIT_ALL_PARENS_EXPRESSIONS 1
    622 #define ENABLE_YARR_JIT_BACKREFERENCES 1
    623 #endif
    624 #endif
    625 
    626 /* If either the JIT or the RegExp JIT is enabled, then the Assembler must be
    627    enabled as well: */
    628 #if ENABLE(JIT) || ENABLE(YARR_JIT) || !ENABLE(C_LOOP)
    629 #if defined(ENABLE_ASSEMBLER) && !ENABLE_ASSEMBLER
    630 #error "Cannot enable the JIT or RegExp JIT without enabling the Assembler"
    631 #else
    632 #undef ENABLE_ASSEMBLER
    633 #define ENABLE_ASSEMBLER 1
    634 #endif
    635 #endif
    636 
    637 /* If the Disassembler is enabled, then the Assembler must be enabled as well: */
    638 #if ENABLE(DISASSEMBLER)
    639 #if defined(ENABLE_ASSEMBLER) && !ENABLE_ASSEMBLER
    640 #error "Cannot enable the Disassembler without enabling the Assembler"
    641 #else
    642 #undef ENABLE_ASSEMBLER
    643 #define ENABLE_ASSEMBLER 1
    644 #endif
    645 #endif
    646 
     175/* FIXME: ASSERT_ENABLED should defined in different, perhaps its own, file. */
    647176/* ASSERT_ENABLED should be true if we want the current compilation unit to
    648177   do debug assertion checks unconditionally (e.g. treat a debug ASSERT
     
    657186#endif
    658187
    659 #ifndef ENABLE_EXCEPTION_SCOPE_VERIFICATION
    660 #define ENABLE_EXCEPTION_SCOPE_VERIFICATION ASSERT_ENABLED
    661 #endif
    662 
    663 #if ENABLE(DFG_JIT) && HAVE(MACHINE_CONTEXT) && (CPU(X86_64) || CPU(ARM64))
    664 #define ENABLE_SIGNAL_BASED_VM_TRAPS 1
    665 #endif
    666 
    667 /* CSS Selector JIT Compiler */
    668 #if !defined(ENABLE_CSS_SELECTOR_JIT)
    669 #if (CPU(X86_64) || CPU(ARM64) || (CPU(ARM_THUMB2) && PLATFORM(IOS_FAMILY))) && ENABLE(JIT) && (OS(DARWIN) || PLATFORM(GTK) || PLATFORM(WPE))
    670 #define ENABLE_CSS_SELECTOR_JIT 1
    671 #else
    672 #define ENABLE_CSS_SELECTOR_JIT 0
    673 #endif
     188
     189
     190#if PLATFORM(COCOA)
     191#define USE_CG 1
     192#endif
     193
     194#if PLATFORM(COCOA)
     195#define USE_CA 1
     196#endif
     197
     198#if PLATFORM(GTK) || PLATFORM(WPE)
     199#define USE_GLIB 1
     200#endif
     201
     202#if PLATFORM(GTK) || PLATFORM(WPE)
     203#define USE_FREETYPE 1
     204#endif
     205
     206#if PLATFORM(GTK) || PLATFORM(WPE)
     207#define USE_HARFBUZZ 1
     208#endif
     209
     210#if PLATFORM(GTK) || PLATFORM(WPE)
     211#define USE_SOUP 1
     212#endif
     213
     214#if PLATFORM(GTK) || PLATFORM(WPE)
     215#define USE_WEBP 1
     216#endif
     217
     218#if PLATFORM(GTK)
     219#define GLIB_VERSION_MIN_REQUIRED GLIB_VERSION_2_36
     220#define GDK_VERSION_MIN_REQUIRED GDK_VERSION_3_6
     221#endif
     222
     223#if PLATFORM(WPE)
     224#define GLIB_VERSION_MIN_REQUIRED GLIB_VERSION_2_40
     225#endif
     226
     227#if USE(SOUP)
     228#define SOUP_VERSION_MIN_REQUIRED SOUP_VERSION_2_42
     229#endif
     230
     231/* On Windows, use QueryPerformanceCounter by default */
     232#if OS(WINDOWS)
     233#define USE_QUERY_PERFORMANCE_COUNTER  1
     234#endif
     235
     236#if PLATFORM(COCOA)
     237#define HAVE_OUT_OF_PROCESS_LAYER_HOSTING 1
     238#endif
     239
     240#if PLATFORM(COCOA)
     241#define USE_CF 1
     242#endif
     243
     244#if PLATFORM(COCOA) || (PLATFORM(GTK) || PLATFORM(WPE))
     245#define USE_FILE_LOCK 1
     246#endif
     247
     248#if PLATFORM(COCOA)
     249#define USE_FOUNDATION 1
     250#endif
     251
     252#if PLATFORM(COCOA)
     253#define USE_NETWORK_CFDATA_ARRAY_CALLBACK 1
     254#endif
     255
     256
     257#if PLATFORM(COCOA)
     258/* Cocoa defines a series of platform macros for debugging. */
     259/* Some of them are really annoying because they use common names (e.g. check()). */
     260/* Disable those macros so that we are not limited in how we name methods and functions. */
     261#undef __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES
     262#define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
     263#endif
     264
     265#if PLATFORM(MAC)
     266#define HAVE_RUNLOOP_TIMER 1
     267#endif
     268
     269#if PLATFORM(MAC)
     270#define HAVE_SEC_KEYCHAIN 1
     271#endif
     272
     273#if PLATFORM(MAC)
     274#define HAVE_HISERVICES 1
     275#endif
     276
     277#if PLATFORM(MAC)
     278#define USE_APPKIT 1
     279#endif
     280
     281#if PLATFORM(MAC)
     282#define USE_PASSKIT 1
     283#endif
     284
     285#if PLATFORM(MAC)
     286#define HAVE_NETWORK_EXTENSION 1
     287#endif
     288
     289#if PLATFORM(MAC)
     290#define USE_PLUGIN_HOST_PROCESS 1
     291#endif
     292
     293#if PLATFORM(IOS_FAMILY)
     294#define HAVE_NETWORK_EXTENSION 1
     295#endif
     296
     297#if PLATFORM(IOS_FAMILY)
     298#define HAVE_READLINE 1
     299#endif
     300
     301#if PLATFORM(IOS_FAMILY)
     302#define USE_UIKIT_EDITING 1
     303#endif
     304
     305#if PLATFORM(IOS_FAMILY)
     306#define USE_WEB_THREAD 1
     307#endif
     308
     309#if PLATFORM(IOS_FAMILY) && CPU(ARM_NEON)
     310#undef HAVE_ARM_NEON_INTRINSICS
     311#define HAVE_ARM_NEON_INTRINSICS 0
     312#endif
     313
     314#if !defined(HAVE_PDFHOSTVIEWCONTROLLER_SNAPSHOTTING) && PLATFORM(IOS)
     315#define HAVE_PDFHOSTVIEWCONTROLLER_SNAPSHOTTING 1
     316#endif
     317
     318#if !defined(HAVE_VISIBILITY_PROPAGATION_VIEW) && PLATFORM(IOS_FAMILY)
     319#define HAVE_VISIBILITY_PROPAGATION_VIEW 1
     320#endif
     321
     322#if !defined(HAVE_UISCENE) && PLATFORM(IOS_FAMILY)
     323#define HAVE_UISCENE 1
     324#endif
     325
     326#if !defined(HAVE_AVSTREAMSESSION) && PLATFORM(MAC)
     327#define HAVE_AVSTREAMSESSION 1
     328#endif
     329
     330#if !defined(HAVE_PASSKIT_API_TYPE) && (PLATFORM(IOS_FAMILY) || PLATFORM(MAC))
     331#define HAVE_PASSKIT_API_TYPE 1
     332#endif
     333
     334#if !defined(HAVE_PASSKIT_BOUND_INTERFACE_IDENTIFIER) && (PLATFORM(IOS) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400))
     335#define HAVE_PASSKIT_BOUND_INTERFACE_IDENTIFIER 1
     336#endif
     337
     338#if !defined(USE_UIKIT_KEYBOARD_ADDITIONS) && (PLATFORM(IOS) || PLATFORM(MACCATALYST))
     339#define USE_UIKIT_KEYBOARD_ADDITIONS 1
     340#endif
     341
     342
     343#if !defined(HAVE_ACCESSIBILITY) && (PLATFORM(COCOA) || PLATFORM(WIN) || PLATFORM(GTK) || PLATFORM(WPE))
     344#define HAVE_ACCESSIBILITY 1
     345#endif
     346
     347/* FIXME: Remove after CMake build enabled on Darwin */
     348#if OS(DARWIN)
     349#define HAVE_ERRNO_H 1
     350#endif
     351
     352#if OS(DARWIN)
     353#define HAVE_LANGINFO_H 1
     354#endif
     355
     356#if OS(DARWIN)
     357#define HAVE_LOCALTIME_R 1
     358#endif
     359
     360#if OS(DARWIN)
     361#define HAVE_MMAP 1
     362#endif
     363
     364#if OS(DARWIN)
     365#define HAVE_REGEX_H 1
     366#endif
     367
     368#if OS(DARWIN)
     369#define HAVE_SIGNAL_H 1
     370#endif
     371
     372#if OS(DARWIN)
     373#define HAVE_STAT_BIRTHTIME 1
     374#endif
     375
     376#if OS(DARWIN)
     377#define HAVE_STRINGS_H 1
     378#endif
     379
     380#if OS(DARWIN)
     381#define HAVE_STRNSTR 1
     382#endif
     383
     384#if OS(DARWIN)
     385#define HAVE_SYS_PARAM_H 1
     386#endif
     387
     388#if OS(DARWIN)
     389#define HAVE_SYS_TIME_H 1
     390#endif
     391
     392#if OS(DARWIN)
     393#define HAVE_TM_GMTOFF 1
     394#endif
     395
     396#if OS(DARWIN)
     397#define HAVE_TM_ZONE 1
     398#endif
     399
     400#if OS(DARWIN)
     401#define HAVE_TIMEGM 1
     402#endif
     403
     404#if OS(DARWIN)
     405#define HAVE_PTHREAD_MAIN_NP 1
     406#endif
     407
     408#if OS(DARWIN) && (CPU(X86_64) || CPU(ARM64))
     409#define HAVE_INT128_T 1
     410#endif
     411
     412#if OS(UNIX)
     413#define USE_PTHREADS 1
     414#endif
     415
     416#if OS(UNIX) && !OS(FUCHSIA)
     417#define HAVE_RESOURCE_H 1
     418#endif
     419
     420#if OS(UNIX) && !OS(FUCHSIA)
     421#define HAVE_PTHREAD_SETSCHEDPARAM 1
     422#endif
     423
     424#if OS(DARWIN)
     425#define HAVE_DISPATCH_H 1
     426#endif
     427
     428#if OS(DARWIN)
     429#define HAVE_MADV_FREE 1
     430#endif
     431
     432#if OS(DARWIN)
     433#define HAVE_MADV_FREE_REUSE 1
     434#endif
     435
     436#if OS(DARWIN)
     437#define HAVE_MADV_DONTNEED 1
     438#endif
     439
     440#if OS(DARWIN)
     441#define HAVE_MERGESORT 1
     442#endif
     443
     444#if OS(DARWIN)
     445#define HAVE_PTHREAD_SETNAME_NP 1
     446#endif
     447
     448#if OS(DARWIN)
     449#define HAVE_READLINE 1
     450#endif
     451
     452#if OS(DARWIN)
     453#define HAVE_SYS_TIMEB_H 1
     454#endif
     455
     456#if OS(DARWIN)
     457#define HAVE_AUDIT_TOKEN 1
     458#endif
     459
     460#if OS(DARWIN) && __has_include(<mach/mach_exc.defs>) && !PLATFORM(GTK)
     461#define HAVE_MACH_EXCEPTIONS 1
     462#endif
     463
     464#if OS(DARWIN) && !PLATFORM(GTK)
     465#define USE_ACCELERATE 1
     466#endif
     467
     468#if OS(DARWIN) && !PLATFORM(IOS_FAMILY)
     469#define HAVE_HOSTED_CORE_ANIMATION 1
     470#endif
     471
     472
     473#if OS(DARWIN) || OS(FUCHSIA) || ((OS(FREEBSD) || defined(__GLIBC__) || defined(__BIONIC__)) && (CPU(X86) || CPU(X86_64) || CPU(ARM) || CPU(ARM64) || CPU(MIPS)))
     474#define HAVE_MACHINE_CONTEXT 1
     475#endif
     476
     477#if OS(DARWIN) || (OS(LINUX) && defined(__GLIBC__) && !defined(__UCLIBC__) && !CPU(MIPS))
     478#define HAVE_BACKTRACE 1
     479#endif
     480
     481#if OS(DARWIN) || OS(LINUX)
     482#if PLATFORM(GTK)
     483#if defined(__GLIBC__) && !defined(__UCLIBC__) && !CPU(MIPS)
     484#define HAVE_BACKTRACE_SYMBOLS 1
     485#endif
     486#endif /* PLATFORM(GTK) */
     487#define HAVE_DLADDR 1
     488#endif /* OS(DARWIN) || OS(LINUX) */
     489
     490
     491#if OS(WINDOWS)
     492#define USE_SYSTEM_MALLOC 1
     493#endif
     494
     495#if !defined(USE_JSVALUE64) && !defined(USE_JSVALUE32_64)
     496#if CPU(ADDRESS64) || CPU(ARM64)
     497#define USE_JSVALUE64 1
     498#else
     499#define USE_JSVALUE32_64 1
     500#endif
     501#endif /* !defined(USE_JSVALUE64) && !defined(USE_JSVALUE32_64) */
     502
     503#if __has_include(<System/pthread_machdep.h>)
     504#define HAVE_FAST_TLS 1
     505#endif
     506
     507#if COMPILER(GCC_COMPATIBLE)
     508#define HAVE_COMPUTED_GOTO 1
     509#endif
     510
     511/* FIXME: This name should be more specific if it is only for use with CallFrame* */
     512/* Use __builtin_frame_address(1) to get CallFrame* */
     513#if COMPILER(GCC_COMPATIBLE) && (CPU(ARM64) || CPU(X86_64))
     514#define USE_BUILTIN_FRAME_ADDRESS 1
    674515#endif
    675516
     
    680521#if PLATFORM(IOS)
    681522#define HAVE_APP_LINKS 1
     523#endif
     524
     525#if PLATFORM(IOS)
    682526#define USE_PASSKIT 1
     527#endif
     528
     529#if PLATFORM(IOS)
    683530#define USE_QUICK_LOOK 1
     531#endif
     532
     533#if PLATFORM(IOS)
    684534#define USE_SYSTEM_PREVIEW 1
    685535#endif
     
    687537#if PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST)
    688538#define HAVE_CELESTIAL 1
     539#endif
     540
     541#if PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST)
    689542#define HAVE_CORE_ANIMATION_RENDER_SERVER 1
    690543#endif
     
    695548
    696549#if PLATFORM(COCOA)
    697 
    698550#define USE_AVFOUNDATION 1
     551#endif
     552
     553#if PLATFORM(COCOA)
    699554#define USE_PROTECTION_SPACE_AUTH_CALLBACK 1
    700 
    701 #if !PLATFORM(WATCHOS) && !PLATFORM(APPLETV) && !PLATFORM(MACCATALYST)
    702 #define ENABLE_DATA_DETECTION 1
    703555#endif
    704556
    705557/* FIXME: Enable HAVE_PARENTAL_CONTROLS for watchOS Simulator once rdar://problem/54608386 is resolved */
    706 #if !PLATFORM(APPLETV) && (!PLATFORM(WATCHOS) || !PLATFORM(IOS_FAMILY_SIMULATOR))
     558#if PLATFORM(COCOA) && (!PLATFORM(APPLETV) && (!PLATFORM(WATCHOS) || !PLATFORM(IOS_FAMILY_SIMULATOR)))
    707559#define HAVE_PARENTAL_CONTROLS 1
    708560#endif
    709561
    710 #if !PLATFORM(APPLETV)
     562#if PLATFORM(COCOA) && !PLATFORM(APPLETV)
    711563#define HAVE_AVKIT 1
    712564#endif
    713565
    714 #if ENABLE(WEBGL)
    715 /* USE_ANGLE=1 uses ANGLE for the WebGL backend.
    716    It replaces USE_OPENGL, USE_OPENGL_ES and USE_EGL. */
    717 #if PLATFORM(MAC) || (PLATFORM(MACCATALYST) && __has_include(<OpenGL/OpenGL.h>))
    718 #define USE_OPENGL 1
    719 #define USE_OPENGL_ES 0
    720 #define USE_ANGLE 0
    721 #else
    722 #define USE_OPENGL 0
    723 #define USE_OPENGL_ES 1
    724 #define USE_ANGLE 0
    725 #endif
    726 #if PLATFORM(COCOA)
    727 #ifndef GL_SILENCE_DEPRECATION
    728 #define GL_SILENCE_DEPRECATION 1
    729 #endif
    730 #if USE(OPENGL) && !defined(HAVE_OPENGL_4)
    731 #define HAVE_OPENGL_4 1
    732 #endif
    733 #if USE(OPENGL_ES) && !defined(HAVE_OPENGL_ES_3)
    734 #define HAVE_OPENGL_ES_3 1
    735 #endif
    736 #endif
    737 #if USE_ANGLE && (USE_OPENGL || USE_OPENGL_ES)
    738 #error USE_ANGLE is incompatible with USE_OPENGL and USE_OPENGL_ES
    739 #endif
    740 #endif
    741 
     566#if PLATFORM(COCOA)
    742567#define USE_METAL 1
    743 
    744 #if ENABLE(ACCESSIBILITY)
    745 #define USE_ACCESSIBILITY_CONTEXT_MENUS 1
    746 #endif
    747 
    748 #endif
    749 
    750 #if ENABLE(WEBGL)
    751 #if !defined(USE_ANGLE)
    752 #define USE_ANGLE 0
    753 #endif
    754 
    755 #if (USE_ANGLE && (USE_OPENGL || USE_OPENGL_ES || (defined(USE_EGL) && USE_EGL))) && !USE(TEXTURE_MAPPER)
    756 #error USE_ANGLE is incompatible with USE_OPENGL, USE_OPENGL_ES and USE_EGL
    757 #endif
    758 #endif
    759 
    760 #if USE(TEXTURE_MAPPER) && ENABLE(GRAPHICS_CONTEXT_GL) && !defined(USE_TEXTURE_MAPPER_GL)
    761 #define USE_TEXTURE_MAPPER_GL 1
    762 #endif
    763 
    764 #if CPU(ARM_THUMB2) || CPU(ARM64)
    765 #define ENABLE_BRANCH_COMPACTION 1
    766 #endif
    767 
    768 #if !defined(ENABLE_THREADING_LIBDISPATCH) && HAVE(DISPATCH_H)
    769 #define ENABLE_THREADING_LIBDISPATCH 1
    770 #elif !defined(ENABLE_THREADING_OPENMP) && defined(_OPENMP)
    771 #define ENABLE_THREADING_OPENMP 1
    772 #elif !defined(THREADING_GENERIC)
    773 #define ENABLE_THREADING_GENERIC 1
    774 #endif
     568#endif
     569
    775570
    776571#if USE(GLIB)
     
    790585#endif
    791586
    792 #if !defined(ENABLE_GC_VALIDATION) && !defined(NDEBUG)
    793 #define ENABLE_GC_VALIDATION 1
    794 #endif
    795 
    796 #if !defined(ENABLE_BINDING_INTEGRITY) && !OS(WINDOWS)
    797 #define ENABLE_BINDING_INTEGRITY 1
    798 #endif
    799 
    800 #if !defined(ENABLE_TREE_DEBUGGING)
    801 #if !defined(NDEBUG)
    802 #define ENABLE_TREE_DEBUGGING 1
    803 #else
    804 #define ENABLE_TREE_DEBUGGING 0
    805 #endif
    806 #endif
    807 
    808 /*
    809  * Enable this to put each IsoHeap and other allocation categories into their own malloc heaps, so that tools like vmmap can show how big each heap is.
    810  * Turn BENABLE_MALLOC_HEAP_BREAKDOWN on in bmalloc together when using this.
    811  */
    812 #if !defined(ENABLE_MALLOC_HEAP_BREAKDOWN)
    813 #define ENABLE_MALLOC_HEAP_BREAKDOWN 0
    814 #endif
    815 
    816587#if PLATFORM(COCOA)
    817588#define USE_COREMEDIA 1
     589#endif
     590
     591#if PLATFORM(COCOA)
    818592#define USE_VIDEOTOOLBOX 1
     593#endif
     594
     595#if PLATFORM(COCOA)
    819596#define HAVE_AVFOUNDATION_VIDEO_OUTPUT 1
     597#endif
     598
     599#if PLATFORM(COCOA)
    820600#define HAVE_CORE_VIDEO 1
     601#endif
     602
     603#if PLATFORM(COCOA)
    821604#define HAVE_MEDIA_PLAYER 1
    822605#endif
     
    828611#if PLATFORM(COCOA)
    829612#define HAVE_AVFOUNDATION_LEGIBLE_OUTPUT_SUPPORT 1
     613#endif
     614
     615#if PLATFORM(COCOA)
    830616#define HAVE_MEDIA_ACCESSIBILITY_FRAMEWORK 1
    831617#endif
     
    841627#if PLATFORM(MAC) || PLATFORM(MACCATALYST)
    842628#define HAVE_APPLE_GRAPHICS_CONTROL 1
     629#endif
     630
     631#if PLATFORM(MAC) || PLATFORM(MACCATALYST)
    843632#define HAVE_NSCURSOR 1
    844633#endif
     
    852641#endif
    853642
    854 #ifndef HAVE_QOS_CLASSES
    855 #if PLATFORM(COCOA)
     643#if !defined(HAVE_QOS_CLASSES) && PLATFORM(COCOA)
    856644#define HAVE_QOS_CLASSES 1
    857645#endif
    858 #endif
    859 
    860 #ifndef HAVE_VOUCHERS
    861 #if PLATFORM(COCOA)
     646
     647#if !defined(HAVE_VOUCHERS) && PLATFORM(COCOA)
    862648#define HAVE_VOUCHERS 1
    863 #endif
    864649#endif
    865650
     
    869654#define USE_UNIFIED_TEXT_CHECKING 1
    870655#endif
     656
    871657#if PLATFORM(MAC)
    872658#define USE_AUTOMATIC_TEXT_REPLACEMENT 1
     
    905691#if PLATFORM(IOS_FAMILY) && !PLATFORM(IOS_FAMILY_SIMULATOR) && !PLATFORM(MACCATALYST)
    906692#define HAVE_IOSURFACE_ACCELERATOR 1
    907 #endif
    908 
    909 #if PLATFORM(COCOA)
    910 #define ENABLE_RESOURCE_USAGE 1
    911 #endif
    912 
    913 #if PLATFORM(GTK) || PLATFORM(WPE)
    914 #undef ENABLE_OPENTYPE_VERTICAL
    915 #define ENABLE_OPENTYPE_VERTICAL 1
    916693#endif
    917694
     
    927704#endif
    928705
    929 /* Disable SharedArrayBuffers until Spectre security concerns are mitigated. */
    930 #define ENABLE_SHARED_ARRAY_BUFFER 0
    931 
    932 #if (OS(DARWIN) && USE(CG)) || (USE(FREETYPE) && !PLATFORM(GTK)) || (PLATFORM(WIN) && (USE(CG) || USE(CAIRO)))
    933 #undef ENABLE_OPENTYPE_MATH
    934 #define ENABLE_OPENTYPE_MATH 1
    935 #endif
    936706
    937707/* Set TARGET_OS_IPHONE to 0 by default to allow using it as a guard
     
    947717#if PLATFORM(COCOA)
    948718#define USE_OS_LOG 1
    949 #if USE(APPLE_INTERNAL_SDK)
     719#endif
     720
     721#if PLATFORM(COCOA) && USE(APPLE_INTERNAL_SDK)
    950722#define USE_OS_STATE 1
    951 #endif
    952723#endif
    953724
     
    991762#if PLATFORM(MAC)
    992763#define HAVE_TOUCH_BAR 1
     764#endif
     765
     766#if PLATFORM(MAC)
    993767#define USE_DICTATION_ALTERNATIVES 1
    994 
    995 #if defined(__LP64__)
    996 #define ENABLE_WEB_PLAYBACK_CONTROLS_MANAGER 1
    997 #endif
    998 #endif /* PLATFORM(MAC) */
    999 
    1000 #if PLATFORM(COCOA) && ENABLE(WEB_RTC)
    1001 #define USE_LIBWEBRTC 1
    1002 #endif
     768#endif
     769
    1003770
    1004771#if PLATFORM(MAC) || PLATFORM(IOS) || PLATFORM(MACCATALYST) || USE(GCRYPT)
     
    1099866#endif
    1100867
    1101 #if PLATFORM(COCOA)
    1102 /* FIXME: This is a USE style macro, as it triggers the use of CFURLConnection framework stubs. */
    1103 /* FIXME: Is this still necessary? CFURLConnection isn't used on Cocoa platforms any more. */
    1104 #define ENABLE_SEC_ITEM_SHIM 1
    1105 #endif
    1106 
    1107868#if (PLATFORM(IOS_FAMILY) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400))
    1108869#define HAVE_ACCESSIBILITY_SUPPORT 1
     
    1113874#endif
    1114875
    1115 #if PLATFORM(MAC)
    1116 #define ENABLE_FULL_KEYBOARD_ACCESS 1
    1117 #endif
    1118 
    1119 #if ((PLATFORM(COCOA) || PLATFORM(PLAYSTATION) || PLATFORM(WPE)) && ENABLE(ASYNC_SCROLLING)) || PLATFORM(GTK)
    1120 #define ENABLE_KINETIC_SCROLLING 1
    1121 #endif
    1122 
    1123876#if PLATFORM(IOS_FAMILY) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400)
    1124877#define HAVE_AUTHORIZATION_STATUS_FOR_MEDIA_TYPE 1
     
    1157910#endif
    1158911
    1159 #if PLATFORM(MAC)
    1160 #define ENABLE_MONOSPACE_FONT_EXCEPTION (__MAC_OS_X_VERSION_MIN_REQUIRED < 101500)
    1161 #elif PLATFORM(IOS_FAMILY)
    1162 #define ENABLE_MONOSPACE_FONT_EXCEPTION (__IPHONE_OS_VERSION_MIN_REQUIRED < 130000)
    1163 #endif
    1164 
    1165912#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) || PLATFORM(IOS_FAMILY)
    1166913#define HAVE_DISALLOWABLE_USER_INSTALLED_FONTS 1
     
    1180927
    1181928#if PLATFORM(MACCATALYST)
    1182 #define ENABLE_PLATFORM_DRIVEN_TEXT_CHECKING 1
    1183929#define HAVE_HOVER_GESTURE_RECOGNIZER 1
     930#endif
     931
     932#if PLATFORM(MACCATALYST)
    1184933#define HAVE_UI_PARALLAX_TRANSITION_GESTURE_RECOGNIZER 1
    1185934#endif
     
    12841033#define HAVE_OS_SIGNPOST 1
    12851034#endif
     1035
     1036
     1037
     1038#if USE(APPLE_INTERNAL_SDK) && __has_include(<WebKitAdditions/AdditionalPlatform.h>)
     1039#include <WebKitAdditions/AdditionalPlatform.h>
     1040#endif
     1041
     1042#if USE(APPLE_INTERNAL_SDK) && __has_include(<WebKitAdditions/AdditionalFeatureDefines.h>)
     1043#include <WebKitAdditions/AdditionalFeatureDefines.h>
     1044#endif
     1045
     1046/* __PLATFORM_INDIRECT__ ensures that users #include <wtf/Platform.h> rather than wtf/FeatureDefines.h directly. */
     1047#define __PLATFORM_INDIRECT__
     1048
     1049/* Include feature macros */
     1050#include <wtf/FeatureDefines.h>
     1051
     1052#undef __PLATFORM_INDIRECT__
     1053
     1054
     1055
     1056/* FIXME: The following are currenly positioned at the bottom of this file as they are currently dependent on ENABLE macros. */
     1057
     1058/* FIXME: Remove dependence on ENABLE(WEB_RTC). */
     1059#if PLATFORM(COCOA) && ENABLE(WEB_RTC)
     1060#define USE_LIBWEBRTC 1
     1061#endif
     1062
     1063/* FIXME: This is used to "turn on a specific feature of WebKit", so should be converted to an ENABLE macro. */
     1064/* This feature works by embedding the OpcodeID in the 32 bit just before the generated LLint code
     1065   that executes each opcode. It cannot be supported by the CLoop since there's no way to embed the
     1066   OpcodeID word in the CLoop's switch statement cases. It is also currently not implemented for MSVC.
     1067*/
     1068#if !defined(USE_LLINT_EMBEDDED_OPCODE_ID) && !ENABLE(C_LOOP) && !COMPILER(MSVC) && \
     1069    (CPU(X86) || CPU(X86_64) || CPU(ARM64) || (CPU(ARM_THUMB2) && OS(DARWIN)))
     1070#define USE_LLINT_EMBEDDED_OPCODE_ID 1
     1071#endif
     1072
     1073
     1074#if PLATFORM(COCOA)
     1075#if ENABLE(WEBGL)
     1076
     1077/* USE_ANGLE=1 uses ANGLE for the WebGL backend.
     1078   It replaces USE_OPENGL, USE_OPENGL_ES and USE_EGL. */
     1079#if PLATFORM(MAC) || (PLATFORM(MACCATALYST) && __has_include(<OpenGL/OpenGL.h>))
     1080#define USE_OPENGL 1
     1081#define USE_OPENGL_ES 0
     1082#define USE_ANGLE 0
     1083#else
     1084#define USE_OPENGL 0
     1085#define USE_OPENGL_ES 1
     1086#define USE_ANGLE 0
     1087#endif
     1088
     1089#ifndef GL_SILENCE_DEPRECATION
     1090#define GL_SILENCE_DEPRECATION 1
     1091#endif
     1092
     1093#if USE(OPENGL) && !defined(HAVE_OPENGL_4)
     1094#define HAVE_OPENGL_4 1
     1095#endif
     1096
     1097#if USE(OPENGL_ES) && !defined(HAVE_OPENGL_ES_3)
     1098#define HAVE_OPENGL_ES_3 1
     1099#endif
     1100
     1101#if USE_ANGLE && (USE_OPENGL || USE_OPENGL_ES)
     1102#error USE_ANGLE is incompatible with USE_OPENGL and USE_OPENGL_ES
     1103#endif
     1104
     1105#endif /* ENABLE(WEBGL) */
     1106#endif /* PLATFORM(COCOA) */
     1107
     1108#if ENABLE(WEBGL)
     1109#if !defined(USE_ANGLE)
     1110#define USE_ANGLE 0
     1111#endif
     1112
     1113#if (USE_ANGLE && (USE_OPENGL || USE_OPENGL_ES || (defined(USE_EGL) && USE_EGL))) && !USE(TEXTURE_MAPPER)
     1114#error USE_ANGLE is incompatible with USE_OPENGL, USE_OPENGL_ES and USE_EGL
     1115#endif
     1116#endif
     1117
     1118#if USE(TEXTURE_MAPPER) && ENABLE(GRAPHICS_CONTEXT_GL) && !defined(USE_TEXTURE_MAPPER_GL)
     1119#define USE_TEXTURE_MAPPER_GL 1
     1120#endif
     1121
     1122/* FIXME: This is used to "turn on a specific feature of WebKit", so should be converted to an ENABLE macro. */
     1123#if PLATFORM(COCOA) && ENABLE(ACCESSIBILITY)
     1124#define USE_ACCESSIBILITY_CONTEXT_MENUS 1
     1125#endif
     1126
     1127
     1128/* FIXME: These calling convention macros should move to their own file. They are at the bottom currently because they depend on FeatureDefines.h */
     1129
     1130#if CPU(X86) && COMPILER(MSVC)
     1131#define JSC_HOST_CALL __fastcall
     1132#elif CPU(X86) && COMPILER(GCC_COMPATIBLE)
     1133#define JSC_HOST_CALL __attribute__ ((fastcall))
     1134#else
     1135#define JSC_HOST_CALL
     1136#endif
     1137
     1138#if CPU(X86) && OS(WINDOWS)
     1139#define CALLING_CONVENTION_IS_STDCALL 1
     1140#ifndef CDECL
     1141#if COMPILER(MSVC)
     1142#define CDECL __cdecl
     1143#else
     1144#define CDECL __attribute__ ((__cdecl))
     1145#endif
     1146#endif
     1147#else
     1148#define CALLING_CONVENTION_IS_STDCALL 0
     1149#endif
     1150
     1151#if CPU(X86)
     1152#define WTF_COMPILER_SUPPORTS_FASTCALL_CALLING_CONVENTION 1
     1153#ifndef FASTCALL
     1154#if COMPILER(MSVC)
     1155#define FASTCALL __fastcall
     1156#else
     1157#define FASTCALL  __attribute__ ((fastcall))
     1158#endif
     1159#endif
     1160#else
     1161#define WTF_COMPILER_SUPPORTS_FASTCALL_CALLING_CONVENTION 0
     1162#endif
     1163
     1164#if ENABLE(JIT) && CALLING_CONVENTION_IS_STDCALL
     1165#define JIT_OPERATION CDECL
     1166#else
     1167#define JIT_OPERATION
     1168#endif
Note: See TracChangeset for help on using the changeset viewer.