stdafx.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. #pragma warning(disable: 4127) // constant expression for Trace/Assert
  7. #include <map>
  8. #define IfFailedReturn(EXPR) do { hr = (EXPR); if (FAILED(hr)) { return hr; }} while(FALSE)
  9. #define IfFailedGoLabel(expr, label) do { hr = (expr); if (FAILED(hr)) { goto label; } } while (FALSE)
  10. #define IfFailGo(expr) IfFailedGoLabel(hr = (expr), Error)
  11. #define IfFalseGo(expr) do { if(!(expr)) { hr = E_FAIL; goto Error; } } while(0)
  12. #ifdef Assert
  13. #undef Assert
  14. #endif
  15. #ifdef AssertMsg
  16. #undef AssertMsg
  17. #endif
  18. #if defined(DBG)
  19. #define AssertMsg(exp, comment) \
  20. do { \
  21. if (!(exp)) \
  22. { \
  23. fprintf(stderr, "ASSERTION (%s, line %d) %s %s\n", __FILE__, __LINE__, _STRINGIZE(exp), comment); \
  24. fflush(stderr); \
  25. DebugBreak(); \
  26. } \
  27. } while (0)
  28. #else
  29. #define AssertMsg(exp, comment) ((void)0)
  30. #endif //defined(DBG)
  31. #define Assert(exp) AssertMsg(exp, #exp)
  32. #define _JSRT_
  33. #include "chakracore.h"
  34. #include "Core/CommonTypedefs.h"
  35. #include <FileLoadHelpers.h>