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 PLATFORM_C99_SUPPORT_WIN_H_ | 5 #ifndef PLATFORM_C99_SUPPORT_WIN_H_ |
6 #define PLATFORM_C99_SUPPORT_WIN_H_ | 6 #define 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 | 21 |
22 #ifndef va_copy | 22 #ifndef va_copy |
23 #define va_copy(dst, src) (memmove(&(dst), &(src), sizeof(dst))) | 23 #define va_copy(dst, src) (memmove(&(dst), &(src), sizeof(dst))) |
24 #endif /* va_copy */ | 24 #endif /* va_copy */ |
25 | 25 |
26 | 26 |
27 #define INFINITY HUGE_VAL | |
28 #define NAN \ | 27 #define NAN \ |
29 *reinterpret_cast<const double*>(&kQuietNaNMask) | 28 *reinterpret_cast<const double*>(&kQuietNaNMask) |
30 | 29 |
31 namespace std { | 30 namespace std { |
32 | 31 |
33 static inline int isinf(double x) { | 32 static inline int isinf(double x) { |
34 return (_fpclass(x) & (_FPCLASS_PINF | _FPCLASS_NINF)) != 0; | 33 return (_fpclass(x) & (_FPCLASS_PINF | _FPCLASS_NINF)) != 0; |
35 } | 34 } |
36 | 35 |
37 static inline int isnan(double x) { | 36 static inline int isnan(double x) { |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 } | 73 } |
75 | 74 |
76 // Windows does not have strtoll defined. | 75 // Windows does not have strtoll defined. |
77 #if defined(_MSC_VER) | 76 #if defined(_MSC_VER) |
78 #define strtoll _strtoi64 | 77 #define strtoll _strtoi64 |
79 #endif | 78 #endif |
80 | 79 |
81 #endif | 80 #endif |
82 | 81 |
83 #endif // PLATFORM_C99_SUPPORT_WIN_H_ | 82 #endif // PLATFORM_C99_SUPPORT_WIN_H_ |
OLD | NEW |