From 1a9ebbecdef9c4cc61b448b33f4d3c3b36dba0f3 Mon Sep 17 00:00:00 2001 From: xorstream Date: Sun, 22 Jan 2017 19:14:05 +1100 Subject: [PATCH] isnan() fix for msvc2013 onwards (#729) * Changed some MSVC compatibility defines based on MSVC version. * Added prebuild_script.bat to remove leftover configure generated files before building. Also added project files and MSVC copies of configure generated files for all supported CPUs. * Moved ./bindings/msvc_native into ./msvc * Remove old project dir. * isnan() fix for msvc2013 onwards --- qemu/include/qemu/compiler.h | 6 ++++++ qemu/include/qemu/host-utils.h | 9 --------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/qemu/include/qemu/compiler.h b/qemu/include/qemu/compiler.h index e74e7119..20909ea0 100644 --- a/qemu/include/qemu/compiler.h +++ b/qemu/include/qemu/compiler.h @@ -17,7 +17,13 @@ #if _MSC_VER < MSC_VER_VS2013 #define isinf(x) (!_finite(x)) +#if defined(_WIN64) +#define isnan _isnanf +#else +#define isnan _isnan #endif +#endif + static double rint( double x ) { diff --git a/qemu/include/qemu/host-utils.h b/qemu/include/qemu/host-utils.h index d8707451..f6157cfd 100644 --- a/qemu/include/qemu/host-utils.h +++ b/qemu/include/qemu/host-utils.h @@ -379,13 +379,4 @@ static inline int ctpop64(uint64_t val) # error Unknown sizeof long #endif -#ifdef _MSC_VER -#include -#if defined(_WIN64) -#define isnan _isnanf -#else -#define isnan _isnan -#endif -#endif - #endif