Chromium Code Reviews| Index: src/globals.h |
| diff --git a/src/globals.h b/src/globals.h |
| index bb9d0a8e8bb5578ddb0b6819b7bfc939f538c00e..6c6966aee53194b1c85b8a9a2d7822a16b235860 100644 |
| --- a/src/globals.h |
| +++ b/src/globals.h |
| @@ -28,6 +28,35 @@ |
| #ifndef V8_GLOBALS_H_ |
| #define V8_GLOBALS_H_ |
| +// Define V8_INFINITY |
| +#define V8_INFINITY INFINITY |
| + |
| +// GCC specific stuff |
| +#ifdef __GNUC__ |
| + |
| +#define __GNUC_VERSION_FOR_INFTY__ (__GNUC__ * 10000 + __GNUC_MINOR__ * 100) |
| + |
| +// Unfortunately, the INFINITY macro cannot be used with the '-pedantic' |
| +// warning flag and certain versions of GCC due to a bug: |
| +// http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11931 |
| +// For now, we use the more involved template-based version from <limits>, but |
| +// only when compiling with GCC versions affected by the bug (2.96.x - 4.0.x) |
| +// __GNUC_PREREQ is not defined in GCC for Mac OS X, so we define our own macro |
| +#if __GNUC_VERSION_FOR_INFTY__ >= 29600 && __GNUC_VERSION_FOR_INFTY__ < 40100 |
|
Rico
2011/09/07 11:51:31
Chromium requires GCC 4.2 can't we remove this and
Lasse Reichstein
2011/09/07 11:59:14
We probably could, but I'd say that's an executive
|
| +#include <limits> |
| +#undef V8_INFINITY |
| +#define V8_INFINITY std::numeric_limits<double>::infinity() |
| +#endif |
| +#undef __GNUC_VERSION_FOR_INFTY__ |
| + |
| +#endif // __GNUC__ |
| + |
| +#ifdef _MSC_VER |
| +#undef V8_INFINITY |
| +#define V8_INFINITY HUGE_VAL |
| +#endif |
| + |
| + |
| #include "../include/v8stdint.h" |
| namespace v8 { |