From a91566d6dbad65d650f7e2a6bd00f3019a00f728 Mon Sep 17 00:00:00 2001 From: Pierre Renaux Date: Sat, 9 May 2015 17:30:03 +0800 Subject: [PATCH] [src/Layout.c & Layout-test-utils.c]: Don't define fmaxf/fminf if we're building with VC12+, its already declared from then on ; --- src/Layout-test-utils.c | 4 ++++ src/Layout.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/Layout-test-utils.c b/src/Layout-test-utils.c index 0f89339a..30ea312b 100644 --- a/src/Layout-test-utils.c +++ b/src/Layout-test-utils.c @@ -13,12 +13,16 @@ #ifdef _MSC_VER #include #define isnan _isnan + +/* define fmaxf & fminf if < VC12 */ +#if _MSC_VER < 1800 __forceinline const float fmaxf(const float a, const float b) { return (a > b) ? a : b; } __forceinline const float fminf(const float a, const float b) { return (a < b) ? a : b; } +#endif #endif /** START_GENERATED **/ diff --git a/src/Layout.c b/src/Layout.c index bc39dc0c..8f0c14a1 100644 --- a/src/Layout.c +++ b/src/Layout.c @@ -17,10 +17,14 @@ #ifdef _MSC_VER #include #define isnan _isnan + +/* define fmaxf if < VC12 */ +#if _MSC_VER < 1800 __forceinline const float fmaxf(const float a, const float b) { return (a > b) ? a : b; } #endif +#endif bool isUndefined(float value) { return isnan(value);