2
0

Common.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. #pragma once
  6. #include "CommonMinMemory.h"
  7. #ifdef _WIN32
  8. typedef _Return_type_success_(return >= 0) LONG NTSTATUS;
  9. #define NT_SUCCESS(Status) (((NTSTATUS)(Status)) >= 0)
  10. #endif
  11. #define MAKE_HR(errnum) (MAKE_HRESULT(SEVERITY_ERROR, FACILITY_CONTROL, errnum))
  12. // If we're using the PAL for C++ standard library compat,
  13. // we don't need to include wchar for string handling
  14. #ifndef USING_PAL_STDLIB
  15. // === C Runtime Header Files ===
  16. #include <wchar.h>
  17. #include <stdarg.h>
  18. #include <float.h>
  19. #include <limits.h>
  20. #if defined(_UCRT)
  21. #include <cmath>
  22. #else
  23. #include <math.h>
  24. #endif
  25. #include <time.h>
  26. #include <io.h>
  27. #include <malloc.h>
  28. #endif
  29. #include "Common/GetCurrentFrameId.h"
  30. namespace Js
  31. {
  32. typedef int32 PropertyId;
  33. typedef uint32 ModuleID;
  34. }
  35. #define IsTrueOrFalse(value) ((value) ? _u("True") : _u("False"))
  36. // Header files
  37. #include "Core/BinaryFeatureControl.h"
  38. #include "TemplateParameter.h"
  39. #include "Common/vtinfo.h"
  40. #include "EnumClassHelp.h"
  41. #include "Common/Tick.h"
  42. #include "Common/IntMathCommon.h"
  43. #include "Common/Int16Math.h"
  44. #include "Common/Int32Math.h"
  45. #include "Common/UInt16Math.h"
  46. #include "Common/UInt32Math.h"
  47. #include "Common/Int64Math.h"
  48. template<typename T> struct IntMath { using Type = void; };
  49. template<> struct IntMath<int16> { using Type = Int16Math; };
  50. template<> struct IntMath<int32> { using Type = Int32Math; };
  51. template<> struct IntMath<uint16> { using Type = UInt16Math; };
  52. template<> struct IntMath<uint32> { using Type = UInt32Math; };
  53. template<> struct IntMath<int64> { using Type = Int64Math; };
  54. #include "Common/DateUtilities.h"
  55. #include "Common/NumberUtilitiesBase.h"
  56. #include "Common/NumberUtilities.h"
  57. #include <Codex/Utf8Codex.h>
  58. #include "Core/DelayLoadLibrary.h"
  59. #include "Core/EtwTraceCore.h"
  60. #include "Common/RejitReason.h"
  61. #include "Common/ThreadService.h"
  62. // Exceptions
  63. #include "Exceptions/ExceptionBase.h"
  64. #include "Exceptions/JavascriptException.h"
  65. #include "Exceptions/OutOfMemoryException.h"
  66. #include "Exceptions/OperationAbortedException.h"
  67. #include "Exceptions/RejitException.h"
  68. #include "Exceptions/ScriptAbortException.h"
  69. #include "Exceptions/StackOverflowException.h"
  70. #include "Exceptions/NotImplementedException.h"
  71. #include "Exceptions/AsmJsParseException.h"
  72. #include "Memory/AutoPtr.h"
  73. #include "Memory/AutoAllocatorObjectPtr.h"
  74. #include "Memory/LeakReport.h"
  75. #include "DataStructures/DoublyLinkedListElement.h"
  76. #include "DataStructures/DoublyLinkedList.h"
  77. #include "DataStructures/SimpleHashTable.h"
  78. #include "Memory/XDataAllocator.h"
  79. #include "Memory/CustomHeap.h"
  80. #include "Core/FinalizableObject.h"
  81. #include "Memory/RecyclerRootPtr.h"
  82. #include "Memory/RecyclerFastAllocator.h"
  83. #include "Util/Pinned.h"
  84. // Data Structures 2
  85. #include "DataStructures/QuickSort.h"
  86. #include "DataStructures/StringBuilder.h"
  87. #include "DataStructures/WeakReferenceDictionary.h"
  88. #include "DataStructures/LeafValueDictionary.h"
  89. #include "DataStructures/Dictionary.h"
  90. #include "DataStructures/List.h"
  91. #include "DataStructures/Stack.h"
  92. #include "DataStructures/Queue.h"
  93. #include "DataStructures/CharacterBuffer.h"
  94. #include "DataStructures/InternalString.h"
  95. #include "DataStructures/Interval.h"
  96. #include "DataStructures/InternalStringNoCaseComparer.h"
  97. #include "DataStructures/SparseArray.h"
  98. #include "DataStructures/GrowingArray.h"
  99. #include "DataStructures/EvalMapString.h"
  100. #include "DataStructures/RegexKey.h"
  101. #include "Core/ICustomConfigFlags.h"
  102. #include "Core/CmdParser.h"
  103. #include "Core/ProfileInstrument.h"
  104. #include "Core/ProfileMemory.h"
  105. #include "Core/StackBackTrace.h"
  106. #include "Common/Event.h"
  107. #include "Common/Jobs.h"
  108. #include "Common/vtregistry.h" // Depends on SimpleHashTable.h
  109. #include "DataStructures/Cache.h" // Depends on config flags
  110. #include "DataStructures/MruDictionary.h" // Depends on DoublyLinkedListElement
  111. #include "Common/SmartFpuControl.h"
  112. // This class is only used by AutoExp.dat
  113. class AutoExpDummyClass
  114. {
  115. };
  116. #pragma warning(push)
  117. #if defined(PROFILE_RECYCLER_ALLOC) || defined(HEAP_TRACK_ALLOC) || defined(ENABLE_DEBUG_CONFIG_OPTIONS)
  118. #ifdef _MSC_VER
  119. #ifdef _UCRT
  120. #include <typeinfo>
  121. #else
  122. #include <typeinfo.h>
  123. #endif
  124. #endif
  125. #endif
  126. #pragma warning(pop)