aboutsummaryrefslogtreecommitdiff
path: root/src/google/protobuf/stubs/mathutil.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/google/protobuf/stubs/mathutil.h')
-rw-r--r--src/google/protobuf/stubs/mathutil.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/google/protobuf/stubs/mathutil.h b/src/google/protobuf/stubs/mathutil.h
index 99c4d452..3a1ef8a8 100644
--- a/src/google/protobuf/stubs/mathutil.h
+++ b/src/google/protobuf/stubs/mathutil.h
@@ -45,9 +45,21 @@ bool IsNan(T value) {
return false;
}
template<>
-inline bool IsNan(float value) { return isnan(value); }
+inline bool IsNan(float value) {
+#ifdef _MSC_VER
+ return _isnan(value);
+#else
+ return isnan(value);
+#endif
+}
template<>
-inline bool IsNan(double value) { return isnan(value); }
+inline bool IsNan(double value) {
+#ifdef _MSC_VER
+ return _isnan(value);
+#else
+ return isnan(value);
+#endif
+}
template<typename T>
bool AlmostEquals(T a, T b) {