message: Cherry picked commit 'Fixes for cmake build with visual studio' from
diff: @@ -61,8 +61,17 @@ struct randomx_cache {
  //A pointer to a standard-layout struct object points to its initial member
  static_assert(std::is_standard_layout<randomx_dataset>(), "randomx_dataset must be a standard-layout struct");
  +
  //the following assert fails when compiling Debug in Visual Studio (JIT mode will crash in Debug)
  +#if defined(_MSC_VER) && !defined(__INTEL_COMPILER) && defined(_DEBUG)
  +#define TO_STR(x) #x
  +#define STR(x) TO_STR(x)
  +#pragma message ( __FILE__ "(" STR(__LINE__) ") warning: check std::is_standard_layout<randomx_cache>() is disabled for Debug configuration. JIT mode will crash." )
  +#undef STR
  +#undef TO_STR
  +#else
  static_assert(std::is_standard_layout<randomx_cache>(), "randomx_cache must be a standard-layout struct");
  +#endif
  namespace randomx {
  