From 80bb7835a816fd4ec184a75b46fa9791e0731ed9 Mon Sep 17 00:00:00 2001 From: xorstream Date: Sat, 21 Jan 2017 22:33:11 +1100 Subject: [PATCH] Changed some MSVC compatibility defines based on MSVC version. --- include/unicorn/platform.h | 4 +++- qemu/include/qemu/compiler.h | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/unicorn/platform.h b/include/unicorn/platform.h index 6f36c4fb..ffdc5646 100644 --- a/include/unicorn/platform.h +++ b/include/unicorn/platform.h @@ -199,8 +199,10 @@ static void usleep(const int64_t &t) // misc support #if defined(_MSC_VER) #define va_copy(d,s) ((d) = (s)) -#define snprintf _snprintf #define strcasecmp _stricmp +#if (_MSC_VER < MSC_VER_VS2015) +#define snprintf _snprintf +#endif #if (_MSC_VER <= MSC_VER_VS2013) #define strtoll _strtoi64 #endif diff --git a/qemu/include/qemu/compiler.h b/qemu/include/qemu/compiler.h index acfb2d33..e74e7119 100644 --- a/qemu/include/qemu/compiler.h +++ b/qemu/include/qemu/compiler.h @@ -4,6 +4,7 @@ #define COMPILER_H #include "config-host.h" +#include "unicorn/platform.h" #ifdef _MSC_VER // MSVC support @@ -13,7 +14,10 @@ #include #include + +#if _MSC_VER < MSC_VER_VS2013 #define isinf(x) (!_finite(x)) +#endif static double rint( double x ) {