Sfoglia il codice sorgente

Windows build fixes

Andrew Willmott 7 anni fa
parent
commit
85e79c248d
2 ha cambiato i file con 11 aggiunte e 0 eliminazioni
  1. 2 0
      3rdparty/astc/astc_weight_align.cpp
  2. 9 0
      3rdparty/astc/mathlib.cpp

+ 2 - 0
3rdparty/astc/astc_weight_align.cpp

@@ -37,6 +37,8 @@
  */
 /*----------------------------------------------------------------------------*/
 
+#define _USE_MATH_DEFINES    // for M_PI on windows
+
 #include <math.h>
 #include "astc_codec_internals.h"
 

+ 9 - 0
3rdparty/astc/mathlib.cpp

@@ -13,12 +13,21 @@
  */ 
 /*----------------------------------------------------------------------------*/ 
 
+#define _USE_MATH_DEFINES    // for M_PI on windows
+
 #include <time.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <math.h>
 #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
 **************************/