RuntimePlatformAgnosticPch.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Copyright (c) ChakraCore Project Contributors. All rights reserved.
  4. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  5. //-------------------------------------------------------------------------------------------------------
  6. #pragma once
  7. #ifdef _WIN32
  8. #include "CommonMin.h"
  9. #else
  10. #include "pal.h"
  11. #endif
  12. #ifdef _MSC_VER
  13. #pragma warning(push)
  14. #if defined(PROFILE_RECYCLER_ALLOC) || defined(HEAP_TRACK_ALLOC) || defined(ENABLE_DEBUG_CONFIG_OPTIONS)
  15. #ifdef _UCRT
  16. #include <typeinfo>
  17. #else
  18. #include <typeinfo.h>
  19. #endif
  20. #endif
  21. #pragma warning(pop)
  22. #endif
  23. // Minimal definitions to use AssertMsg in the PAL
  24. #ifndef _WIN32
  25. #define DbgRaiseAssertionFailure() __builtin_trap()
  26. #define __analysis_assume(x)
  27. #define _In_
  28. #define __inout
  29. #ifndef USE_ICU
  30. #ifndef TRUE
  31. #define TRUE 1
  32. #endif
  33. #ifndef FALSE
  34. #define FALSE 0
  35. #endif
  36. #else
  37. #define U_USING_ICU_NAMESPACE 0
  38. #include <unicode/umachine.h>
  39. #endif
  40. namespace Js
  41. {
  42. class Throw
  43. {
  44. public:
  45. static bool ReportAssert(const char* fileName, unsigned int lineNumber, const char* error, const char* message);
  46. static void LogAssert();
  47. static void __declspec(noreturn) FatalInternalError();
  48. };
  49. }
  50. #include <Core/Assertions.h>
  51. #endif