replace "asm nop" with an intrinsic in msvc

MS is deprecating inline assembly, and has completely removed it from
the x64 compiler. The solution is to use compiler intrinsics. This will
hopefully make building for x64 easier in the future. (I might even
spend some time attempting to build it for x64).
This commit is contained in:
Tracy Ward
2019-10-01 15:04:16 +08:00
committed by Prcuvu
parent 67ebec3320
commit 60d6ebce92
+4 -1
View File
@@ -10,6 +10,9 @@
# include "windows.h"
# include "archutils/Win32/Crash.h"
# endif
# if defined(_MSC_VER)
# include <intrin.h>
# endif
#elif defined(MACOSX)
# include "archutils/Darwin/Crash.h"
# include <stdlib.h>
@@ -46,7 +49,7 @@ void NORETURN sm_crash( const char *reason )
/* Do something after the above, so the call/return isn't optimized to a jmp; that
* way, this function will appear in backtrace stack traces. */
#if defined(_MSC_VER)
_asm nop;
__nop();
#elif defined(__GNUC__) // MinGW or similar
asm("nop");
#endif