some winprefix.h cleanups (nw)

This commit is contained in:
Oliver Stöneberg 2015-01-31 23:54:38 +01:00
parent 78bacb07c2
commit 6b75e786a3

View File

@ -13,22 +13,18 @@
#ifdef _MSC_VER #ifdef _MSC_VER
#include <assert.h> #include <assert.h>
#include <malloc.h> #include <malloc.h>
#if _MSC_VER < 1800 #if _MSC_VER < 1500 // < VS2008
#define vsnprintf _vsnprintf
#elif _MSC_VER < 1800 // < VS2013
#define alloca _alloca #define alloca _alloca
#define round(x) floor((x) + 0.5) #define round(x) floor((x) + 0.5)
#endif #define strtoll _strtoi64
#if _MSC_VER < 1500
#define vsnprintf _vsnprintf
#endif
#if _MSC_VER < 1800
#define _USE_MATH_DEFINES #define _USE_MATH_DEFINES
#include <math.h> #include <math.h>
static __inline double fmin(double x, double y){ return (x < y) ? x : y; } static __inline double fmin(double x, double y){ return (x < y) ? x : y; }
static __inline double fmax(double x, double y){ return (x > y) ? x : y; } static __inline double fmax(double x, double y){ return (x > y) ? x : y; }
static __inline double log2(double x) { return log(x) * M_LOG2E; } static __inline double log2(double x) { return log(x) * M_LOG2E; }
#define strtoll _strtoi64 #elif _MSC_VER < 1900 // < VS2015
#endif
#if _MSC_VER < 1900
#define snprintf _snprintf #define snprintf _snprintf
#else #else
#pragma warning (disable: 4091) #pragma warning (disable: 4091)