Common.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  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. typedef _Return_type_success_(return >= 0) LONG NTSTATUS;
  8. #define NT_SUCCESS(Status) (((NTSTATUS)(Status)) >= 0)
  9. #include <wchar.h>
  10. // === C Runtime Header Files ===
  11. #include <stdarg.h>
  12. #include <float.h>
  13. #include <limits.h>
  14. #if defined(_UCRT)
  15. #include <cmath>
  16. #else
  17. #include <math.h>
  18. #endif
  19. #include <time.h>
  20. #include <io.h>
  21. #include <malloc.h>
  22. extern "C" void * _AddressOfReturnAddress(void);
  23. #include "Common/GetCurrentFrameId.h"
  24. namespace Js
  25. {
  26. typedef int32 PropertyId;
  27. typedef unsigned long ModuleID;
  28. }
  29. #define IsTrueOrFalse(value) ((value) ? _u("True") : _u("False"))
  30. // Header files
  31. #include "Core/BinaryFeatureControl.h"
  32. #include "TemplateParameter.h"
  33. #include "Common/vtinfo.h"
  34. #include "EnumClassHelp.h"
  35. #include "Common/Tick.h"
  36. #include "Common/Int16Math.h"
  37. #include "Common/Int32Math.h"
  38. #include "Common/UInt16Math.h"
  39. #include "Common/UInt32Math.h"
  40. #include "Common/Int64Math.h"
  41. template<typename T> struct IntMath { using Type = void; };
  42. template<> struct IntMath<int16> { using Type = Int16Math; };
  43. template<> struct IntMath<int32> { using Type = Int32Math; };
  44. template<> struct IntMath<uint16> { using Type = UInt16Math; };
  45. template<> struct IntMath<uint32> { using Type = UInt32Math; };
  46. template<> struct IntMath<int64> { using Type = Int64Math; };
  47. #include "Common/DaylightTimeHelper.h"
  48. #include "Common/DateUtilities.h"
  49. #include "Common/NumberUtilitiesBase.h"
  50. #include "Common/NumberUtilities.h"
  51. #include <Codex/Utf8Codex.h>
  52. #include "Core/DelayLoadLibrary.h"
  53. #include "Core/EtwTraceCore.h"
  54. #include "Common/RejitReason.h"
  55. #include "Common/ThreadService.h"
  56. // Exceptions
  57. #include "Exceptions/ExceptionBase.h"
  58. #include "Exceptions/InternalErrorException.h"
  59. #include "Exceptions/OutOfMemoryException.h"
  60. #include "Exceptions/OperationAbortedException.h"
  61. #include "Exceptions/RejitException.h"
  62. #include "Exceptions/ScriptAbortException.h"
  63. #include "Exceptions/StackOverflowException.h"
  64. #include "Exceptions/NotImplementedException.h"
  65. #include "Exceptions/AsmJsParseException.h"
  66. #include "Memory/AutoPtr.h"
  67. #include "Memory/AutoAllocatorObjectPtr.h"
  68. #include "Memory/LeakReport.h"
  69. #include "DataStructures/DoublyLinkedListElement.h"
  70. #include "DataStructures/DoublyLinkedList.h"
  71. #include "DataStructures/SimpleHashTable.h"
  72. #include "Memory/XDataAllocator.h"
  73. #include "Memory/CustomHeap.h"
  74. #include "Core/FinalizableObject.h"
  75. #include "Memory/RecyclerRootPtr.h"
  76. #include "Memory/RecyclerFastAllocator.h"
  77. #include "Memory/RecyclerPointers.h"
  78. #include "Util/Pinned.h"
  79. // Data Structures 2
  80. #include "DataStructures/StringBuilder.h"
  81. #include "DataStructures/WeakReferenceDictionary.h"
  82. #include "DataStructures/LeafValueDictionary.h"
  83. #include "DataStructures/Dictionary.h"
  84. #include "DataStructures/List.h"
  85. #include "DataStructures/Stack.h"
  86. #include "DataStructures/Queue.h"
  87. #include "DataStructures/CharacterBuffer.h"
  88. #include "DataStructures/InternalString.h"
  89. #include "DataStructures/Interval.h"
  90. #include "DataStructures/InternalStringNoCaseComparer.h"
  91. #include "DataStructures/SparseArray.h"
  92. #include "DataStructures/GrowingArray.h"
  93. #include "DataStructures/EvalMapString.h"
  94. #include "DataStructures/RegexKey.h"
  95. #include "DataStructures/LineOffsetCache.h"
  96. #include "Core/ICustomConfigFlags.h"
  97. #include "Core/CmdParser.h"
  98. #include "Core/ProfileInstrument.h"
  99. #include "Core/ProfileMemory.h"
  100. #include "Core/StackBackTrace.h"
  101. #include "Common/Event.h"
  102. #include "Common/Jobs.h"
  103. #include "Common/vtregistry.h" // Depends on SimpleHashTable.h
  104. #include "DataStructures/Cache.h" // Depends on config flags
  105. #include "DataStructures/MruDictionary.h" // Depends on DoublyLinkedListElement
  106. #include "Common/SmartFpuControl.h"
  107. // This class is only used by AutoExp.dat
  108. class AutoExpDummyClass
  109. {
  110. };
  111. #pragma warning(push)
  112. #if defined(PROFILE_RECYCLER_ALLOC) || defined(HEAP_TRACK_ALLOC) || defined(ENABLE_DEBUG_CONFIG_OPTIONS)
  113. #include <typeinfo.h>
  114. #endif
  115. #pragma warning(pop)