OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #ifndef RUNTIME_PLATFORM_C99_SUPPORT_WIN_H_ | 5 #ifndef RUNTIME_PLATFORM_C99_SUPPORT_WIN_H_ |
6 #define RUNTIME_PLATFORM_C99_SUPPORT_WIN_H_ | 6 #define RUNTIME_PLATFORM_C99_SUPPORT_WIN_H_ |
7 | 7 |
8 #if defined(_MSC_VER) && (_MSC_VER < 1800) | 8 #if defined(_MSC_VER) && (_MSC_VER < 1800) |
9 | 9 |
10 // Before Visual Studio 2013 Visual C++ was missing a bunch of C99 math macros | 10 // Before Visual Studio 2013 Visual C++ was missing a bunch of C99 math macros |
11 // and functions. Define them here. | 11 // and functions. Define them here. |
12 | 12 |
13 #include <float.h> | 13 #include <float.h> |
14 #include <string.h> | 14 #include <string.h> |
15 | 15 |
16 #include <cmath> | 16 #include <cmath> |
17 | 17 |
18 static const unsigned __int64 kQuietNaNMask = | 18 static const unsigned __int64 kQuietNaNMask = |
19 static_cast<unsigned __int64>(0xfff) << 51; | 19 static_cast<unsigned __int64>(0xfff) << 51; |
20 | 20 |
21 | |
22 #ifndef va_copy | 21 #ifndef va_copy |
23 #define va_copy(dst, src) (memmove(&(dst), &(src), sizeof(dst))) | 22 #define va_copy(dst, src) (memmove(&(dst), &(src), sizeof(dst))) |
24 #endif /* va_copy */ | 23 #endif /* va_copy */ |
25 | 24 |
26 | |
27 #define NAN *reinterpret_cast<const double*>(&kQuietNaNMask) | 25 #define NAN *reinterpret_cast<const double*>(&kQuietNaNMask) |
28 | 26 |
29 namespace std { | 27 namespace std { |
30 | 28 |
31 static inline int isinf(double x) { | 29 static inline int isinf(double x) { |
32 return (_fpclass(x) & (_FPCLASS_PINF | _FPCLASS_NINF)) != 0; | 30 return (_fpclass(x) & (_FPCLASS_PINF | _FPCLASS_NINF)) != 0; |
33 } | 31 } |
34 | 32 |
35 static inline int isnan(double x) { | 33 static inline int isnan(double x) { |
36 return _isnan(x); | 34 return _isnan(x); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 } | 70 } |
73 | 71 |
74 // Windows does not have strtoll defined. | 72 // Windows does not have strtoll defined. |
75 #if defined(_MSC_VER) | 73 #if defined(_MSC_VER) |
76 #define strtoll _strtoi64 | 74 #define strtoll _strtoi64 |
77 #endif | 75 #endif |
78 | 76 |
79 #endif | 77 #endif |
80 | 78 |
81 #endif // RUNTIME_PLATFORM_C99_SUPPORT_WIN_H_ | 79 #endif // RUNTIME_PLATFORM_C99_SUPPORT_WIN_H_ |
OLD | NEW |