OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Extra POSIX/ANSI routines for Win32 when using Visual Studio C++. Please | 5 // Extra POSIX/ANSI routines for Win32 when using Visual Studio C++. Please |
6 // refer to The Open Group Base Specification for specification of the correct | 6 // refer to The Open Group Base Specification for specification of the correct |
7 // semantics for these functions. | 7 // semantics for these functions. |
8 // (http://www.opengroup.org/onlinepubs/000095399/) | 8 // (http://www.opengroup.org/onlinepubs/000095399/) |
9 #if defined(_MSC_VER) && (_MSC_VER < 1800) | 9 #if defined(_MSC_VER) && (_MSC_VER < 1800) |
10 | 10 |
11 #include "src/base/win32-headers.h" | 11 #include "src/base/win32-headers.h" |
12 #include <float.h> // Required for DBL_MAX and on Win32 for finite() | 12 #include <float.h> // Required for DBL_MAX and on Win32 for finite() |
13 #include <limits.h> // Required for INT_MAX etc. | 13 #include <limits.h> // Required for INT_MAX etc. |
14 #include <cmath> | 14 #include <cmath> |
15 #include "src/win32-math.h" | 15 #include "src/base/win32-math.h" |
16 | 16 |
17 #include "src/checks.h" | 17 #include "src/base/logging.h" |
18 | 18 |
19 | 19 |
20 namespace std { | 20 namespace std { |
21 | 21 |
22 // Test for a NaN (not a number) value - usually defined in math.h | 22 // Test for a NaN (not a number) value - usually defined in math.h |
23 int isnan(double x) { | 23 int isnan(double x) { |
24 return _isnan(x); | 24 return _isnan(x); |
25 } | 25 } |
26 | 26 |
27 | 27 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 // and negative versions of zero. | 73 // and negative versions of zero. |
74 if (x == 0) | 74 if (x == 0) |
75 return _fpclass(x) & _FPCLASS_NZ; | 75 return _fpclass(x) & _FPCLASS_NZ; |
76 else | 76 else |
77 return x < 0; | 77 return x < 0; |
78 } | 78 } |
79 | 79 |
80 } // namespace std | 80 } // namespace std |
81 | 81 |
82 #endif // _MSC_VER | 82 #endif // _MSC_VER |
OLD | NEW |