gallium/swr: Fix Windows build
authorJan Zielinski <jan.zielinski@intel.com>
Thu, 12 Dec 2019 13:07:20 +0000 (14:07 +0100)
committerJan Zielinski <jan.zielinski@intel.com>
Thu, 12 Dec 2019 13:35:23 +0000 (14:35 +0100)
Tessellator defines own fmin/fmax functions that conflict
with those defined in cmath header. Need to use legacy math.h
which was originally used in MS code.

Reviewed-by: Krzysztof Raszkowski <krzysztof.raszkowski@intel.com>
src/gallium/drivers/swr/rasterizer/core/tessellator.cpp

index 6e12b6910375248820a8c848d144fa1c86997f3a..e0464c360fa3459cb379c228c11d55b120e987af 100644 (file)
 */
 
 #include "tessellator.hpp"
-// #include <math.h> // ceil
+#if defined(_WIN32) || defined(_WIN64)
+#include <math.h> // ceil
+#else
 #include <cmath>
+#endif
 //#include <windows.h> // Just used for some commented out debug stat printing.
 //#include <strsafe.h> // Ditto.
 #define min(x,y) (x < y ? x : y)