From 85e79c248df4dc5045be2c483ba14e5120951539 Mon Sep 17 00:00:00 2001 From: Andrew Willmott Date: Tue, 24 Jul 2018 16:22:00 +0100 Subject: [PATCH] Windows build fixes --- 3rdparty/astc/astc_weight_align.cpp | 2 ++ 3rdparty/astc/mathlib.cpp | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/3rdparty/astc/astc_weight_align.cpp b/3rdparty/astc/astc_weight_align.cpp index 39d1e94..789438f 100644 --- a/3rdparty/astc/astc_weight_align.cpp +++ b/3rdparty/astc/astc_weight_align.cpp @@ -37,6 +37,8 @@ */ /*----------------------------------------------------------------------------*/ +#define _USE_MATH_DEFINES // for M_PI on windows + #include #include "astc_codec_internals.h" diff --git a/3rdparty/astc/mathlib.cpp b/3rdparty/astc/mathlib.cpp index 3c41a0a..faaad3a 100644 --- a/3rdparty/astc/mathlib.cpp +++ b/3rdparty/astc/mathlib.cpp @@ -13,12 +13,21 @@ */ /*----------------------------------------------------------------------------*/ +#define _USE_MATH_DEFINES // for M_PI on windows + #include #include #include #include #include "mathlib.h" +#ifdef WIN32 + double cbrt(double n) + { + return n < 0 ? -pow(-n, 1.0 / 3.0) : pow(n, 1.0 / 3.0); + } +#endif + /************************** basic OpenCL functions **************************/