Add std::isnan and std::isinf wrappers for VS2010 that doesn't have them
authorbaldurk <baldurk@baldurk.org>
Thu, 13 Oct 2016 17:28:54 +0000 (19:28 +0200)
committerbaldurk <baldurk@baldurk.org>
Thu, 13 Oct 2016 17:28:54 +0000 (19:28 +0200)
SPIRV/hex_float.h

index ea403a7..24a2607 100644 (file)
 #include <limits>
 #include <sstream>
 
+#if defined(_MSC_VER) && _MSC_VER < 1700
+namespace std {
+bool isnan(double f)
+{
+  return ::_isnan(f) != 0;
+}
+bool isinf(double f)
+{
+  return ::_finite(f) == 0;
+}
+}
+#endif
+
 #include "bitutils.h"
 
 namespace spvutils {