-
Notifications
You must be signed in to change notification settings - Fork 1.4k
/
PlatformEnable.h
1022 lines (801 loc) · 28 KB
/
PlatformEnable.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* Copyright (C) 2006-2023 Apple Inc. All rights reserved.
* Copyright (C) 2007-2009 Torch Mobile, Inc.
* Copyright (C) 2010, 2011 Research In Motion Limited. All rights reserved.
* Copyright (C) 2013 Samsung Electronics. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#pragma once
#ifndef WTF_PLATFORM_GUARD_AGAINST_INDIRECT_INCLUSION
#error "Please #include <wtf/Platform.h> instead of this file directly."
#endif
#define ENABLE(WTF_FEATURE) (defined ENABLE_##WTF_FEATURE && ENABLE_##WTF_FEATURE)
/* Use this file to list _all_ ENABLE() macros. Define the macros to be one of the following values:
* - "0" disables the feature by default. The feature can still be enabled for a specific port or environment.
* - "1" enables the feature by default. The feature can still be disabled for a specific port or environment.
*
* The feature defaults in this file are only taken into account if the (port specific) build system
* has not enabled or disabled a particular feature.
*
* Use this file to define ENABLE() macros only. Do not use this file to define USE() or macros !
*
* Only define a macro if it was not defined before - always check for !defined first.
*
* Keep the file sorted by the name of the defines. As an exception you can change the order
* to allow interdependencies between the default values.
*
* Below are a few potential commands to take advantage of this file running from the Source/WTF directory
*
* Get the list of feature defines: grep -o "ENABLE_\(\w\+\)" wtf/PlatformEnable.h | sort | uniq
* Get the list of features enabled by default for a PLATFORM(XXX): gcc -E -dM -I. -DWTF_PLATFORM_XXX "wtf/Platform.h" | grep "ENABLE_\w\+ 1" | cut -d' ' -f2 | sort
*/
/* FIXME: This should be renamed to ENABLE_ASSERTS for consistency and so it can be used as ENABLE(ASSERTS). */
/* ASSERT_ENABLED should be true if we want the current compilation unit to
do debug assertion checks unconditionally (e.g. treat a debug ASSERT
like a RELEASE_ASSERT.
*/
#ifndef ASSERT_ENABLED
#ifdef NDEBUG
#define ASSERT_ENABLED 0
#else
#define ASSERT_ENABLED 1
#endif
#endif
/* ==== Platform additions: additions to PlatformEnable.h from outside the main repository ==== */
#if USE(APPLE_INTERNAL_SDK) && __has_include(<WebKitAdditions/AdditionalFeatureDefines.h>)
#include <WebKitAdditions/AdditionalFeatureDefines.h>
#endif
/* ==== Platform specific defaults ==== */
/* --------- Apple Cocoa platforms --------- */
#if PLATFORM(COCOA)
#include <wtf/PlatformEnableCocoa.h>
#endif
/* --------- Windows port --------- */
#if PLATFORM(WIN)
#include <wtf/PlatformEnableWin.h>
#endif
/* --------- PlayStation port --------- */
#if PLATFORM(PLAYSTATION)
#include <wtf/PlatformEnablePlayStation.h>
#endif
/* --------- GTK/WPE port --------- */
#if PLATFORM(GTK) || PLATFORM(WPE)
#include <wtf/PlatformEnableGlib.h>
#endif
/* --------- ENABLE macro defaults --------- */
/* Do not use PLATFORM() tests in this section ! */
#if !defined(ENABLE_CONJECTURE_ASSERT)
#define ENABLE_CONJECTURE_ASSERT 0
#endif
#if !defined(ENABLE_ACCESSIBILITY_ANIMATION_CONTROL)
#define ENABLE_ACCESSIBILITY_ANIMATION_CONTROL 0
#endif
#if !defined(ENABLE_ACCESSIBILITY_NON_BLINKING_CURSOR)
#define ENABLE_ACCESSIBILITY_NON_BLINKING_CURSOR 0
#endif
#if !defined(ENABLE_ADVANCED_PRIVACY_PROTECTIONS)
#define ENABLE_ADVANCED_PRIVACY_PROTECTIONS 0
#endif
#if !defined(ENABLE_AIRPLAY_PICKER)
#define ENABLE_AIRPLAY_PICKER 0
#endif
#if !defined(ENABLE_ALTERNATIVE_TEXT_REQUIRES_AUTOMATIC_SPELLING_CORRECTION)
#define ENABLE_ALTERNATIVE_TEXT_REQUIRES_AUTOMATIC_SPELLING_CORRECTION 0
#endif
#if !defined(ENABLE_ALTERNATE_WEBM_PLAYER)
#define ENABLE_ALTERNATE_WEBM_PLAYER 0
#endif
#if !defined(ENABLE_APP_HIGHLIGHTS)
#define ENABLE_APP_HIGHLIGHTS 0
#endif
#if !defined(ENABLE_APPLE_PAY_REMOTE_UI)
#define ENABLE_APPLE_PAY_REMOTE_UI 0
#endif
#if !defined(ENABLE_ASYNC_SCROLLING)
#define ENABLE_ASYNC_SCROLLING 0
#endif
#if !defined(ENABLE_AUTOCORRECT)
#define ENABLE_AUTOCORRECT 0
#endif
#if !defined(ENABLE_AUTOCAPITALIZE)
#define ENABLE_AUTOCAPITALIZE 0
#endif
#if !defined(ENABLE_CONTENT_CHANGE_OBSERVER)
#define ENABLE_CONTENT_CHANGE_OBSERVER 0
#endif
#if !defined(ENABLE_CONTENT_EXTENSIONS)
#define ENABLE_CONTENT_EXTENSIONS 0
#endif
#if !defined(ENABLE_CONTEXT_MENUS)
#define ENABLE_CONTEXT_MENUS 1
#endif
#if !defined(ENABLE_CONTEXT_MENU_EVENT)
#define ENABLE_CONTEXT_MENU_EVENT 1
#endif
#if !defined(ENABLE_CUSTOM_CURSOR_SUPPORT)
#define ENABLE_CUSTOM_CURSOR_SUPPORT 1
#endif
#if !defined(ENABLE_CURSOR_VISIBILITY)
#define ENABLE_CURSOR_VISIBILITY 0
#endif
#if !defined(ENABLE_DARK_MODE_CSS)
#define ENABLE_DARK_MODE_CSS 0
#endif
#if !defined(ENABLE_DATA_DETECTION)
#define ENABLE_DATA_DETECTION 0
#endif
#if !defined(ENABLE_DATACUE_VALUE)
#define ENABLE_DATACUE_VALUE 0
#endif
#if !defined(ENABLE_DATALIST_ELEMENT)
#define ENABLE_DATALIST_ELEMENT 0
#endif
#if !defined(ENABLE_DATE_AND_TIME_INPUT_TYPES)
#define ENABLE_DATE_AND_TIME_INPUT_TYPES 0
#endif
#if !defined(ENABLE_DECLARATIVE_WEB_PUSH)
#define ENABLE_DECLARATIVE_WEB_PUSH 0
#endif
#if !defined(ENABLE_DEVICE_ORIENTATION)
#define ENABLE_DEVICE_ORIENTATION 0
#endif
#if !defined(ENABLE_DESTINATION_COLOR_SPACE_DISPLAY_P3)
#define ENABLE_DESTINATION_COLOR_SPACE_DISPLAY_P3 0
#endif
#if !defined(ENABLE_DRAG_SUPPORT)
#define ENABLE_DRAG_SUPPORT 1
#endif
#if !defined(ENABLE_ENCRYPTED_MEDIA)
#define ENABLE_ENCRYPTED_MEDIA 0
#endif
#if !defined(ENABLE_FILE_REPLACEMENT)
#define ENABLE_FILE_REPLACEMENT 0
#endif
#if !defined(ENABLE_FTPDIR)
#define ENABLE_FTPDIR 1
#endif
#if !defined(ENABLE_FULL_KEYBOARD_ACCESS)
#define ENABLE_FULL_KEYBOARD_ACCESS 0
#endif
#if !defined(ENABLE_FULLSCREEN_API)
#define ENABLE_FULLSCREEN_API 0
#endif
#if !defined(ENABLE_GAMEPAD)
#define ENABLE_GAMEPAD 0
#endif
#if !defined(ENABLE_GEOLOCATION)
#define ENABLE_GEOLOCATION 0
#endif
#if !defined(ENABLE_GPU_PROCESS_DOM_RENDERING_BY_DEFAULT)
#define ENABLE_GPU_PROCESS_DOM_RENDERING_BY_DEFAULT 0
#endif
#if !defined(ENABLE_GPU_PROCESS_WEBGL_BY_DEFAULT)
#define ENABLE_GPU_PROCESS_WEBGL_BY_DEFAULT 0
#endif
#if !defined(ENABLE_IMAGE_ANALYSIS)
#define ENABLE_IMAGE_ANALYSIS 0
#endif
#if !defined(ENABLE_IMAGE_ANALYSIS_ENHANCEMENTS)
#define ENABLE_IMAGE_ANALYSIS_ENHANCEMENTS 0
#endif
#if !defined(ENABLE_IMAGE_ANALYSIS_FOR_MACHINE_READABLE_CODES)
#define ENABLE_IMAGE_ANALYSIS_FOR_MACHINE_READABLE_CODES 0
#endif
#if !defined(ENABLE_INLINE_PATH_DATA)
#define ENABLE_INLINE_PATH_DATA 0
#endif
#if !defined(ENABLE_INPUT_TYPE_COLOR)
#define ENABLE_INPUT_TYPE_COLOR 1
#endif
#if !defined(ENABLE_INPUT_TYPE_DATE)
#define ENABLE_INPUT_TYPE_DATE 0
#endif
#if !defined(ENABLE_INPUT_TYPE_DATETIMELOCAL)
#define ENABLE_INPUT_TYPE_DATETIMELOCAL 0
#endif
#if !defined(ENABLE_INPUT_TYPE_MONTH)
#define ENABLE_INPUT_TYPE_MONTH 0
#endif
#if !defined(ENABLE_INPUT_TYPE_TIME)
#define ENABLE_INPUT_TYPE_TIME 0
#endif
#if !defined(ENABLE_INPUT_TYPE_WEEK)
#define ENABLE_INPUT_TYPE_WEEK 0
#endif
#if !defined(ENABLE_INPUT_TYPE_WEEK_PICKER)
#define ENABLE_INPUT_TYPE_WEEK_PICKER 0
#endif
#if !defined(ENABLE_IOS_GESTURE_EVENTS)
#define ENABLE_IOS_GESTURE_EVENTS 0
#endif
#if !defined(ENABLE_IOS_TOUCH_EVENTS)
#define ENABLE_IOS_TOUCH_EVENTS 0
#endif
#if !defined(ENABLE_IPC_TESTING_API)
/* Enable IPC testing on all ASAN builds and debug builds. */
#if (ASAN_ENABLED || !defined(NDEBUG)) && PLATFORM(COCOA)
#define ENABLE_IPC_TESTING_API 1
#endif
#endif
#if !defined(ENABLE_INSPECTOR_ALTERNATE_DISPATCHERS)
#define ENABLE_INSPECTOR_ALTERNATE_DISPATCHERS 0
#endif
#if !defined(ENABLE_INSPECTOR_EXTENSIONS)
#define ENABLE_INSPECTOR_EXTENSIONS 0
#endif
#if !defined(ENABLE_INSPECTOR_TELEMETRY)
#define ENABLE_INSPECTOR_TELEMETRY 0
#endif
#if !defined(ENABLE_KINETIC_SCROLLING)
#define ENABLE_KINETIC_SCROLLING 0
#endif
#if !defined(ENABLE_LLVM_PROFILE_GENERATION)
#define ENABLE_LLVM_PROFILE_GENERATION 0
#endif
#if !defined(ENABLE_MAC_GESTURE_EVENTS)
#define ENABLE_MAC_GESTURE_EVENTS 0
#endif
#if !defined(ENABLE_MATHML)
#define ENABLE_MATHML 1
#endif
#if !defined(ENABLE_MEDIA_CAPTURE)
#define ENABLE_MEDIA_CAPTURE 0
#endif
#if !defined(ENABLE_MEDIA_RECORDER)
#define ENABLE_MEDIA_RECORDER 0
#endif
#if !defined(ENABLE_MEDIA_RECORDER_WEBM)
#define ENABLE_MEDIA_RECORDER_WEBM 0
#endif
#if !defined(ENABLE_MEDIA_SOURCE)
#define ENABLE_MEDIA_SOURCE 0
#endif
#if !defined(ENABLE_MEDIA_SOURCE_IN_WORKERS)
#define ENABLE_MEDIA_SOURCE_IN_WORKERS 0
#endif
#if !defined(ENABLE_MEDIA_STATISTICS)
#define ENABLE_MEDIA_STATISTICS 0
#endif
#if !defined(ENABLE_MEDIA_STREAM)
#define ENABLE_MEDIA_STREAM 0
#endif
#if !defined(ENABLE_META_VIEWPORT)
#define ENABLE_META_VIEWPORT 0
#endif
#if !defined(ENABLE_MHTML)
#define ENABLE_MHTML 0
#endif
#if !defined(ENABLE_MODERN_MEDIA_CONTROLS)
#define ENABLE_MODERN_MEDIA_CONTROLS 0
#endif
#if !defined(ENABLE_MONOSPACE_FONT_EXCEPTION)
#define ENABLE_MONOSPACE_FONT_EXCEPTION 0
#endif
#if !defined(ENABLE_MOUSE_CURSOR_SCALE)
#define ENABLE_MOUSE_CURSOR_SCALE 0
#endif
#if !defined(ENABLE_NOTIFICATION_EVENT)
#define ENABLE_NOTIFICATION_EVENT 0
#endif
#if !defined(ENABLE_NOTIFICATIONS)
#define ENABLE_NOTIFICATIONS 0
#endif
#if !defined(ENABLE_OFFSCREEN_CANVAS)
#define ENABLE_OFFSCREEN_CANVAS 1
#endif
#if !defined(ENABLE_OFFSCREEN_CANVAS_IN_WORKERS)
#define ENABLE_OFFSCREEN_CANVAS_IN_WORKERS 1
#endif
#if !defined(ENABLE_OPENTYPE_MATH)
#define ENABLE_OPENTYPE_MATH 0
#endif
#if !defined(ENABLE_OPENTYPE_VERTICAL)
#define ENABLE_OPENTYPE_VERTICAL 0
#endif
// ORIENTATION_EVENTS should never get enabled on Desktop, only Mobile.
#if !defined(ENABLE_ORIENTATION_EVENTS)
#define ENABLE_ORIENTATION_EVENTS 0
#endif
#if !defined(ENABLE_OVERFLOW_SCROLLING_TOUCH)
#define ENABLE_OVERFLOW_SCROLLING_TOUCH 0
#endif
#if OS(WINDOWS)
#if !defined(ENABLE_PAN_SCROLLING)
#define ENABLE_PAN_SCROLLING 1
#endif
#endif
#if !defined(ENABLE_PAYMENT_REQUEST)
#define ENABLE_PAYMENT_REQUEST 0
#endif
#if !defined(ENABLE_PDFJS)
#define ENABLE_PDFJS 0
#endif
#if !defined(ENABLE_PENCIL_HOVER)
#define ENABLE_PENCIL_HOVER 0
#endif
#if !defined(ENABLE_PERIODIC_MEMORY_MONITOR)
#define ENABLE_PERIODIC_MEMORY_MONITOR 0
#endif
#if !defined(ENABLE_PLATFORM_DRIVEN_TEXT_CHECKING)
#define ENABLE_PLATFORM_DRIVEN_TEXT_CHECKING 0
#endif
#if !defined(ENABLE_POINTER_LOCK)
#define ENABLE_POINTER_LOCK 1
#endif
#if !defined(ENABLE_PREDEFINED_COLOR_SPACE_DISPLAY_P3)
#define ENABLE_PREDEFINED_COLOR_SPACE_DISPLAY_P3 0
#endif
#if !defined(ENABLE_PREVIEW_CONVERTER)
#define ENABLE_PREVIEW_CONVERTER 0
#endif
#if !defined(ENABLE_REMOTE_INSPECTOR)
#define ENABLE_REMOTE_INSPECTOR 0
#endif
#if !defined(ENABLE_REMOTE_LAYER_TREE_ON_MAC_BY_DEFAULT)
#define ENABLE_REMOTE_LAYER_TREE_ON_MAC_BY_DEFAULT 0
#endif
#if !defined(ENABLE_RESOURCE_USAGE)
#define ENABLE_RESOURCE_USAGE 0
#endif
#if !defined(ENABLE_SCROLLING_THREAD)
#define ENABLE_SCROLLING_THREAD 0
#endif
#if !defined(ENABLE_SEC_ITEM_SHIM)
#define ENABLE_SEC_ITEM_SHIM 0
#endif
#if !defined(ENABLE_SECURITY_ASSERTIONS)
/* Enable security assertions on all ASAN builds and debug builds. */
#if ASAN_ENABLED || !defined(NDEBUG)
#define ENABLE_SECURITY_ASSERTIONS 1
#endif
#endif
#if !defined(ENABLE_SEPARATED_WX_HEAP)
#define ENABLE_SEPARATED_WX_HEAP 0
#endif
#if !defined(ENABLE_SPEECH_SYNTHESIS)
#define ENABLE_SPEECH_SYNTHESIS 0
#endif
#if !defined(ENABLE_SPELLCHECK)
#define ENABLE_SPELLCHECK 0
#endif
#if !defined(ENABLE_STATIC_IPAD_USER_AGENT_VALUE)
#define ENABLE_STATIC_IPAD_USER_AGENT_VALUE 0
#endif
#if !defined(ENABLE_TEXT_AUTOSIZING)
#define ENABLE_TEXT_AUTOSIZING 0
#endif
#if !defined(ENABLE_TEXT_CARET)
#define ENABLE_TEXT_CARET 1
#endif
#if !defined(ENABLE_TEXT_SELECTION)
#define ENABLE_TEXT_SELECTION 1
#endif
#if !defined(ENABLE_THUNDER)
#define ENABLE_THUNDER 0
#endif
#if !defined(ENABLE_TOUCH_EVENTS)
#define ENABLE_TOUCH_EVENTS 0
#endif
#if !defined(ENABLE_TOUCH_ACTION_REGIONS)
#define ENABLE_TOUCH_ACTION_REGIONS 0
#endif
#if !defined(ENABLE_UI_SIDE_COMPOSITING)
#define ENABLE_UI_SIDE_COMPOSITING 0
#endif
#if !defined(ENABLE_VIDEO)
#define ENABLE_VIDEO 0
#endif
#if !defined(ENABLE_VIDEO_PRESENTATION_MODE)
#define ENABLE_VIDEO_PRESENTATION_MODE 0
#endif
#if !defined(ENABLE_WEBGL)
#define ENABLE_WEBGL 0
#endif
#if !defined(ENABLE_WEBPROCESS_NSRUNLOOP)
#define ENABLE_WEBPROCESS_NSRUNLOOP 0
#endif
#if !defined(ENABLE_WEB_ARCHIVE)
#define ENABLE_WEB_ARCHIVE 0
#endif
#if !defined(ENABLE_WEB_AUDIO)
#define ENABLE_WEB_AUDIO 0
#endif
#if !defined(ENABLE_WEB_PLAYBACK_CONTROLS_MANAGER)
#define ENABLE_WEB_PLAYBACK_CONTROLS_MANAGER 0
#endif
#if !defined(ENABLE_WEBXR)
#define ENABLE_WEBXR 0
#endif
#if !defined(ENABLE_WEBXR_HANDS)
#define ENABLE_WEBXR_HANDS 0
#endif
#if !defined(ENABLE_WEBXR_WEBGPU_BY_DEFAULT)
#define ENABLE_WEBXR_WEBGPU_BY_DEFAULT 0
#endif
#if !defined(ENABLE_WEBXR_LAYERS)
#define ENABLE_WEBXR_LAYERS (PLATFORM(VISION) && __VISION_OS_VERSION_MAX_ALLOWED >= 20200)
#endif
#if !defined(ENABLE_WHEEL_EVENT_LATCHING)
#define ENABLE_WHEEL_EVENT_LATCHING 0
#endif
#if !defined(ENABLE_WHEEL_EVENT_REGIONS)
#define ENABLE_WHEEL_EVENT_REGIONS 0
#endif
#if !defined(ENABLE_WRITING_TOOLS)
#define ENABLE_WRITING_TOOLS 0
#endif
#if !defined(ENABLE_WKPDFVIEW)
#define ENABLE_WKPDFVIEW 0
#endif
#if !defined(ENABLE_WK_WEB_EXTENSIONS)
#define ENABLE_WK_WEB_EXTENSIONS 0
#endif
#if !defined(ENABLE_XSLT)
#define ENABLE_XSLT 1
#endif
/*
* 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.
* Turn BENABLE_MALLOC_HEAP_BREAKDOWN on in bmalloc together when using this.
*/
#if !defined(ENABLE_MALLOC_HEAP_BREAKDOWN)
#define ENABLE_MALLOC_HEAP_BREAKDOWN 0
#endif
// See RefTrackerMixin.h
#if ASSERT_ENABLED
#undef ENABLE_REFTRACKER
#define ENABLE_REFTRACKER 1
#endif
#if !defined(ENABLE_REFTRACKER)
#define ENABLE_REFTRACKER 0
#endif
#if !defined(ENABLE_CFPREFS_DIRECT_MODE)
#define ENABLE_CFPREFS_DIRECT_MODE 0
#endif
#if !defined(ENABLE_UNPREFIXED_BACKDROP_FILTER)
#define ENABLE_UNPREFIXED_BACKDROP_FILTER 0
#endif
/* FIXME: This section of the file has not been cleaned up yet and needs major work. */
/* FIXME: JSC_OBJC_API_ENABLED does not match the normal ENABLE naming convention. */
#if !PLATFORM(COCOA)
#if !defined(JSC_OBJC_API_ENABLED)
#define JSC_OBJC_API_ENABLED 0
#endif
#endif
/* wyhash-based StringHasher */
#if !defined(ENABLE_WYHASH_STRING_HASHER) && PLATFORM(MAC)
#define ENABLE_WYHASH_STRING_HASHER 1
#endif
/* The JIT is enabled by default on all x86-64 & ARM64 platforms. */
#if !defined(ENABLE_JIT) && (CPU(X86_64) || (CPU(ARM64) && CPU(ADDRESS64)))
#define ENABLE_JIT 1
#endif
#if USE(JSVALUE32_64)
#if CPU(ARM_THUMB2) && CPU(ARM_HARDFP) && OS(LINUX)
/* On ARMv7 Linux the JIT is enabled unless explicitly disabled. */
#if !defined(ENABLE_JIT)
#define ENABLE_JIT 1
#endif
#else
/* Disable JIT on all other 32bit architectures. */
#undef ENABLE_JIT
#define ENABLE_JIT 0
#endif
#endif
#if CPU(RISCV64)
#undef ENABLE_WEBASSEMBLY
#define ENABLE_WEBASSEMBLY 1
#undef ENABLE_WEBASSEMBLY_OMGJIT
#define ENABLE_WEBASSEMBLY_OMGJIT 0
#undef ENABLE_WEBASSEMBLY_BBQJIT
#define ENABLE_WEBASSEMBLY_BBQJIT 0
#endif
#if !defined(ENABLE_C_LOOP)
#if ENABLE(JIT) || CPU(X86_64) || CPU(ARM64)
#define ENABLE_C_LOOP 0
#else
#define ENABLE_C_LOOP 1
#endif
#endif
#if !defined(ENABLE_JUMP_ISLANDS) && ENABLE(JIT)
#if (CPU(ARM64) && CPU(ADDRESS64)) || CPU(ARM_THUMB2)
#define ENABLE_JUMP_ISLANDS 1
#endif
#endif
/* FIXME: This should be turned into an #error invariant */
/* The FTL *does not* work on 32-bit platforms. Disable it even if someone asked us to enable it. */
#if USE(JSVALUE32_64)
#undef ENABLE_FTL_JIT
#define ENABLE_FTL_JIT 0
#endif
/* If possible, try to enable a disassembler. This is optional. We proceed in two
steps: first we try to find some disassembler that we can use, and then we
decide if the high-level disassembler API can be enabled. */
#if !defined(ENABLE_ZYDIS) && ENABLE(JIT) && CPU(X86_64) && !USE(CAPSTONE)
#define ENABLE_ZYDIS 1
#endif
#if !defined(ENABLE_ARM64_DISASSEMBLER) && ENABLE(JIT) && CPU(ARM64) && !USE(CAPSTONE)
#define ENABLE_ARM64_DISASSEMBLER 1
#endif
#if !defined(ENABLE_RISCV64_DISASSEMBLER) && ENABLE(JIT) && CPU(RISCV64) && !USE(CAPSTONE)
#define ENABLE_RISCV64_DISASSEMBLER 1
#endif
#if !defined(ENABLE_DISASSEMBLER) && (ENABLE(ZYDIS) || ENABLE(ARM64_DISASSEMBLER) || ENABLE(RISCV64_DISASSEMBLER) || (ENABLE(JIT) && USE(CAPSTONE)))
#define ENABLE_DISASSEMBLER 1
#endif
#if !defined(ENABLE_DFG_JIT) && ENABLE(JIT)
/* Enable the DFG JIT on X86 and X86_64. */
#if CPU(X86_64) && (OS(DARWIN) || OS(LINUX) || OS(FREEBSD) || OS(HAIKU) || OS(HURD) || OS(WINDOWS))
#define ENABLE_DFG_JIT 1
#endif
/* Enable the DFG JIT on ARMv7. Only tested on iOS, Linux, and FreeBSD. */
#if (CPU(ARM_THUMB2) || CPU(ARM64)) && (OS(DARWIN) || OS(LINUX) || OS(FREEBSD))
#define ENABLE_DFG_JIT 1
#endif
/* Enable the DFG JIT on MIPS. */
#if CPU(MIPS)
#define ENABLE_DFG_JIT 1
#endif
#endif /* !defined(ENABLE_DFG_JIT) && ENABLE(JIT) */
#if ENABLE(DFG_JIT) && ASSERT_ENABLED
#define ENABLE_DFG_DOES_GC_VALIDATION 1
#else
#define ENABLE_DFG_DOES_GC_VALIDATION 0
#endif
#if ENABLE(JIT)
#define ENABLE_CONCURRENT_JS 1
#endif
#if (CPU(X86_64) || CPU(ARM64)) && HAVE(FAST_TLS)
#define ENABLE_FAST_TLS_JIT 1
#endif
/* Ensure that upper tiers are disabled if baseline JIT is not available */
#if !ENABLE(JIT) && (ENABLE(DFG_JIT) || ENABLE(FTL_JIT))
#error "DFG and FTL JIT require baseline JIT to be enabled"
#endif
/* Ensure that FTL JIT is disabled if DFG JIT is not available */
#if !ENABLE(DFG_JIT) && ENABLE(FTL_JIT)
#error "FTL JIT requires DFG JIT to be enabled"
#endif
/* This controls whether B3 is built. B3 is needed for FTL JIT and WebAssembly */
#if ENABLE(FTL_JIT)
#define ENABLE_B3_JIT 1
#endif
#if ENABLE(WEBASSEMBLY) && ENABLE(JIT) && CPU(ARM)
#undef ENABLE_B3_JIT
#define ENABLE_B3_JIT 1
#undef ENABLE_WEBASSEMBLY_OMGJIT
#define ENABLE_WEBASSEMBLY_OMGJIT 1
#undef ENABLE_WEBASSEMBLY_BBQJIT
#define ENABLE_WEBASSEMBLY_BBQJIT 1
#endif
#if !defined(ENABLE_WEBASSEMBLY) && (ENABLE(B3_JIT) && PLATFORM(COCOA) && CPU(ADDRESS64))
#define ENABLE_WEBASSEMBLY 1
#define ENABLE_WEBASSEMBLY_OMGJIT 1
#define ENABLE_WEBASSEMBLY_BBQJIT 1
#endif
#if !defined(ENABLE_WEBASSEMBLY) && CPU(ADDRESS64) && PLATFORM(COCOA) && !ENABLE(C_LOOP)
#define ENABLE_WEBASSEMBLY 1
#endif
/* The SamplingProfiler is the probabilistic and low-overhead profiler used by
* JSC to measure where time is spent inside a JavaScript program.
* In configurations other than Windows and Darwin, because layout of mcontext_t depends on standard libraries (like glibc),
* sampling profiler is enabled if WebKit uses pthreads and glibc. */
#if !defined(ENABLE_SAMPLING_PROFILER) && (!ENABLE(C_LOOP) && (OS(WINDOWS) || HAVE(MACHINE_CONTEXT)))
#define ENABLE_SAMPLING_PROFILER 1
#endif
/* Counts uses of write barriers using sampling counters. Be sure to also
set ENABLE_SAMPLING_COUNTERS to 1. */
#if !defined(ENABLE_WRITE_BARRIER_PROFILING)
#define ENABLE_WRITE_BARRIER_PROFILING 0
#endif
/* Logs all allocation-related activity that goes through fastMalloc or the
JSC GC (both cells and butterflies). Also logs marking. Note that this
isn't a completely accurate view of the heap since it doesn't include all
butterfly resize operations, doesn't tell you what is going on with weak
references (other than to tell you when they're marked), and doesn't
track direct mmap() allocations or things like JIT allocation. */
#if !defined(ENABLE_ALLOCATION_LOGGING)
#define ENABLE_ALLOCATION_LOGGING 0
#endif
/* Enable verification that that register allocations are not made within generated control flow.
Turned on for debug builds. */
#if !defined(ENABLE_DFG_REGISTER_ALLOCATION_VALIDATION) && ENABLE(DFG_JIT) && !defined(NDEBUG)
#define ENABLE_DFG_REGISTER_ALLOCATION_VALIDATION 1
#endif
/* Determine if we need to enable Computed Goto Opcodes or not: */
#if HAVE(COMPUTED_GOTO) || !ENABLE(C_LOOP)
#define ENABLE_COMPUTED_GOTO_OPCODES 1
#endif
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 150000) \
|| (PLATFORM(MACCATALYST) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 180000) \
|| (PLATFORM(IOS) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 180000) \
|| (PLATFORM(APPLETV) && __TV_OS_VERSION_MAX_ALLOWED >= 180000) \
|| (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MAX_ALLOWED >= 110000) \
|| (PLATFORM(VISION) && __VISION_OS_VERSION_MAX_ALLOWED >= 20000)
// Linkers from older SDKs causes wrong linking. ref: rdar://96556827
#define ENABLE_OFFLINE_ASM_ALT_ENTRY 1
#endif
/* Regular Expression Tracing - Set to 1 to trace RegExp's in jsc. Results dumped at exit */
#if !defined(ENABLE_REGEXP_TRACING)
#define ENABLE_REGEXP_TRACING 0
#endif
/* Yet Another Regex Runtime - turned on by default for JIT enabled ports. */
#if !defined(ENABLE_YARR_JIT) && ENABLE(JIT)
#define ENABLE_YARR_JIT 1
#endif
/* Setting this flag compares JIT results with interpreter results. */
#if !defined(ENABLE_YARR_JIT) && ENABLE(JIT)
#define ENABLE_YARR_JIT_DEBUG 0
#endif
/* Enable JIT'ing Regular Expressions that have nested parenthesis . */
#if ENABLE(YARR_JIT) && (CPU(ARM64) || CPU(X86_64) || CPU(RISCV64))
#define ENABLE_YARR_JIT_ALL_PARENS_EXPRESSIONS 1
#define ENABLE_YARR_JIT_REGEXP_TEST_INLINE 1
#endif
/* Enable JIT'ing Regular Expressions that have back references. */
#if ENABLE(YARR_JIT) && (CPU(ARM64) || CPU(X86_64) || CPU(RISCV64))
#define ENABLE_YARR_JIT_BACKREFERENCES 1
#if CPU(ARM64) || CPU(X86_64)
#define ENABLE_YARR_JIT_BACKREFERENCES_FOR_16BIT_EXPRS 1
#else
#define ENABLE_YARR_JIT_BACKREFERENCES_FOR_16BIT_EXPRS 0
#endif
#endif
#if ENABLE(YARR_JIT) && (CPU(ARM64) || CPU(X86_64) || CPU(RISCV64))
#define ENABLE_YARR_JIT_UNICODE_EXPRESSIONS 1
#endif
/* Enables an optimiztion to advance two codepoints when we fail to match a non-BMP character */
#if ENABLE(YARR_JIT) && CPU(ARM64)
#define ENABLE_YARR_JIT_UNICODE_CAN_INCREMENT_INDEX_FOR_NON_BMP 1
#endif
/* If either the JIT or the RegExp JIT is enabled, then the Assembler must be
enabled as well: */
#if ENABLE(JIT) || ENABLE(YARR_JIT) || !ENABLE(C_LOOP)
#if defined(ENABLE_ASSEMBLER) && !ENABLE_ASSEMBLER
#error "Cannot enable the JIT or RegExp JIT without enabling the Assembler"
#else
#undef ENABLE_ASSEMBLER
#define ENABLE_ASSEMBLER 1
#endif
#endif
/* If the Disassembler is enabled, then the Assembler must be enabled as well: */
#if ENABLE(DISASSEMBLER)
#if defined(ENABLE_ASSEMBLER) && !ENABLE_ASSEMBLER
#error "Cannot enable the Disassembler without enabling the Assembler"
#else
#undef ENABLE_ASSEMBLER
#define ENABLE_ASSEMBLER 1
#endif
#endif
#if !defined(ENABLE_EXCEPTION_SCOPE_VERIFICATION)
#define ENABLE_EXCEPTION_SCOPE_VERIFICATION ASSERT_ENABLED
#endif
#if ENABLE(DFG_JIT) && HAVE(MACHINE_CONTEXT) && (CPU(X86_64) || CPU(ARM64) || CPU(RISCV64))
#define ENABLE_SIGNAL_BASED_VM_TRAPS 1
#endif
#if !defined(ENABLE_MPROTECT_RX_TO_RWX)
#define ENABLE_MPROTECT_RX_TO_RWX 0
#endif
/* CSS Selector JIT Compiler */
#if !defined(ENABLE_CSS_SELECTOR_JIT) && ((CPU(X86_64) || CPU(ARM64)) && ENABLE(JIT))
#define ENABLE_CSS_SELECTOR_JIT 1
#endif
#if ENABLE(JIT)
#if CPU(ARM_THUMB2) || CPU(ARM64)
#define ENABLE_BRANCH_COMPACTION 1
#endif
#endif
#if !defined(ENABLE_THREADING_LIBDISPATCH) && HAVE(DISPATCH_H)
#define ENABLE_THREADING_LIBDISPATCH 1
#elif !defined(ENABLE_THREADING_OPENMP) && defined(_OPENMP)
#define ENABLE_THREADING_OPENMP 1
#elif !defined(THREADING_GENERIC)
#define ENABLE_THREADING_GENERIC 1
#endif
#if !defined(ENABLE_GC_VALIDATION) && !defined(NDEBUG)
#define ENABLE_GC_VALIDATION 1
#endif
#if OS(DARWIN) && ENABLE(JIT) && USE(APPLE_INTERNAL_SDK) && CPU(ARM64E) && HAVE(JIT_CAGE) && !PLATFORM(MAC)
#define ENABLE_JIT_CAGE 1
#endif
#if OS(DARWIN) && CPU(ADDRESS64) && ENABLE(JIT) && (ENABLE(JIT_CAGE) || ASSERT_ENABLED)
#define ENABLE_JIT_OPERATION_VALIDATION 1
#endif
#if USE(APPLE_INTERNAL_SDK) && ENABLE(DISASSEMBLER) && CPU(ARM64E) && HAVE(DLADDR)
#define ENABLE_JIT_OPERATION_DISASSEMBLY 1
#endif
#if CPU(ARM64E)
#define ENABLE_JIT_SIGN_ASSEMBLER_BUFFER 1
#endif
#if !defined(ENABLE_JIT_SCAN_ASSEMBLER_BUFFER_FOR_ZEROES) && CPU(X86_64) && PLATFORM(MAC)
#define ENABLE_JIT_SCAN_ASSEMBLER_BUFFER_FOR_ZEROES 1
#endif
#if !defined(ENABLE_BINDING_INTEGRITY) && !OS(WINDOWS)
#define ENABLE_BINDING_INTEGRITY 1
#endif
#if !defined(ENABLE_TREE_DEBUGGING) && !defined(NDEBUG)
#define ENABLE_TREE_DEBUGGING 1
#endif
/* This feature works by embedding the OpcodeID in the 32 bit just before the generated LLint code
that executes each opcode. It cannot be supported by the CLoop since there's no way to embed the
OpcodeID word in the CLoop's switch statement cases. It is also currently not implemented for MSVC.
*/
#if !defined(ENABLE_LLINT_EMBEDDED_OPCODE_ID) && !ENABLE(C_LOOP) && (CPU(X86) || CPU(X86_64) || CPU(ARM64) || (CPU(ARM_THUMB2) && OS(DARWIN)) || CPU(RISCV64))
#define ENABLE_LLINT_EMBEDDED_OPCODE_ID 1
#endif
/* Asserts, invariants for macro definitions */
#if ENABLE(ALTERNATE_WEBM_PLAYER) && !ENABLE(MEDIA_SOURCE)
#error "ENABLE(ALTERNATE_WEBM_PLAYER) requires ENABLE(MEDIA_SOURCE)"
#endif
#if ENABLE(DECLARATIVE_WEB_PUSH) && !ENABLE(NOTIFICATION_EVENT)
#error "ENABLE(DECLARATIVE_WEB_PUSH) requires ENABLE(NOTIFICATION_EVENT)"
#endif
#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) && !ENABLE(REMOTE_INSPECTOR)
#error "ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS) requires ENABLE(REMOTE_INSPECTOR)"
#endif
#if ENABLE(IOS_TOUCH_EVENTS) && !ENABLE(TOUCH_EVENTS)
#error "ENABLE(IOS_TOUCH_EVENTS) requires ENABLE(TOUCH_EVENTS)"
#endif
#if ENABLE(OFFSCREEN_CANVAS_IN_WORKERS) && !ENABLE(OFFSCREEN_CANVAS)
#error "ENABLE(OFFSCREEN_CANVAS_IN_WORKERS) requires ENABLE(OFFSCREEN_CANVAS)"
#endif
#if ENABLE(MEDIA_RECORDER) && !ENABLE(MEDIA_STREAM)
#error "ENABLE(MEDIA_RECORDER) requires ENABLE(MEDIA_STREAM)"
#endif
#if ENABLE(NOTIFICATION_EVENT) && !ENABLE(NOTIFICATIONS)
#error "ENABLE(NOTIFICATION_EVENT) requires ENABLE(NOTIFICATIONS)"
#endif
#if USE(CG)
#if ENABLE(DESTINATION_COLOR_SPACE_DISPLAY_P3) && !HAVE(CORE_GRAPHICS_DISPLAY_P3_COLOR_SPACE)
#error "ENABLE(DESTINATION_COLOR_SPACE_DISPLAY_P3) requires HAVE(CORE_GRAPHICS_DISPLAY_P3_COLOR_SPACE) on platforms using CoreGraphics"
#endif
#endif
#if ENABLE(PREDEFINED_COLOR_SPACE_DISPLAY_P3) && !ENABLE(DESTINATION_COLOR_SPACE_DISPLAY_P3)
#error "ENABLE(PREDEFINED_COLOR_SPACE_DISPLAY_P3) requires ENABLE(DESTINATION_COLOR_SPACE_DISPLAY_P3)"
#endif
#if ENABLE(WEBXR_HANDS) && !ENABLE(WEBXR)
#error "ENABLE(WEBXR_HANDS) requires ENABLE(WEBXR)"
#endif
#if ENABLE(WEBXR_LAYERS) && !ENABLE(WEBXR)
#error "ENABLE(WEBXR_LAYERS) requires ENABLE(WEBXR)"
#endif
#if !defined(ENABLE_WEBPROCESS_CACHE)
#define ENABLE_WEBPROCESS_CACHE 0
#endif