| Differences between
and this patch
- a/Source/WTF/ChangeLog +14 lines
Lines 1-3 a/Source/WTF/ChangeLog_sec1
1
2012-05-21  Allan Sandfeld Jensen  <allan.jensen@nokia.com>
2
3
        Colliding isinf/isnan between C99 and C++11 with GCC >=4.6
4
        https://bugs.webkit.org/show_bug.cgi?id=59249
5
6
        Reviewed by Darin Adler.
7
8
        Workaround the isinf and isnan conflict in GCC C++11.
9
10
        * wtf/Compiler.h:
11
        * wtf/MathExtras.h:
12
        (std::wtf_isinf):
13
        (std::wtf_isnan):
14
1
2012-05-21  Andreas Kling  <kling@webkit.org>
15
2012-05-21  Andreas Kling  <kling@webkit.org>
2
16
3
        REGRESSION(r117501): IconDatabase asserts on startup in synchronousIconForPageURL().
17
        REGRESSION(r117501): IconDatabase asserts on startup in synchronousIconForPageURL().
- a/Source/WTF/wtf/Compiler.h -5 / +13 lines
Lines 32-37 a/Source/WTF/wtf/Compiler.h_sec1
32
/* COMPILER_SUPPORTS() - whether the compiler being used to build the project supports the given feature. */
32
/* COMPILER_SUPPORTS() - whether the compiler being used to build the project supports the given feature. */
33
#define COMPILER_SUPPORTS(WTF_COMPILER_FEATURE) (defined WTF_COMPILER_SUPPORTS_##WTF_COMPILER_FEATURE  && WTF_COMPILER_SUPPORTS_##WTF_COMPILER_FEATURE)
33
#define COMPILER_SUPPORTS(WTF_COMPILER_FEATURE) (defined WTF_COMPILER_SUPPORTS_##WTF_COMPILER_FEATURE  && WTF_COMPILER_SUPPORTS_##WTF_COMPILER_FEATURE)
34
34
35
/* COMPILER_QUIRK() - whether the compiler being used to build the project requires a given quirks. */
36
#define COMPILER_QUIRK(WTF_COMPILER_QUIRK) (defined WTF_COMPILER_QUIRK##WTF_COMPILER_QUIRK  && WTF_COMPILER_QUIRK_##WTF_COMPILER_QUIRK)
37
35
/* ==== COMPILER() - the compiler being used to build the project ==== */
38
/* ==== COMPILER() - the compiler being used to build the project ==== */
36
39
37
/* COMPILER(CLANG) - Clang  */
40
/* COMPILER(CLANG) - Clang  */
Lines 95-109 a/Source/WTF/wtf/Compiler.h_sec2
95
#define WTF_COMPILER_GCC 1
98
#define WTF_COMPILER_GCC 1
96
#define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
99
#define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
97
#define GCC_VERSION_AT_LEAST(major, minor, patch) (GCC_VERSION >= (major * 10000 + minor * 100 + patch))
100
#define GCC_VERSION_AT_LEAST(major, minor, patch) (GCC_VERSION >= (major * 10000 + minor * 100 + patch))
101
#else
102
/* Define this for !GCC compilers, just so we can write things like GCC_VERSION_AT_LEAST(4, 1, 0). */
103
#define GCC_VERSION_AT_LEAST(major, minor, patch) 0
104
#endif
98
105
99
/* Specific compiler features */
106
/* Specific compiler features */
100
#if !COMPILER(CLANG) && GCC_VERSION_AT_LEAST(4, 6, 0) && defined(__GXX_EXPERIMENTAL_CXX0X__)
107
#if COMPILER(GCC) && !COMPILER(CLANG)
108
#if GCC_VERSION_AT_LEAST(4, 7, 0) && __cplusplus >= 201103L
109
#define WTF_COMPILER_SUPPORTS_CXX_NULLPTR 1
110
#define WTF_COMPILER_QUIRK_GCC11_GLOBAL_ISINF_ISNAN 1
111
#elif GCC_VERSION_AT_LEAST(4, 6, 0) && defined(__GXX_EXPERIMENTAL_CXX0X__)
101
#define WTF_COMPILER_SUPPORTS_CXX_NULLPTR 1 
112
#define WTF_COMPILER_SUPPORTS_CXX_NULLPTR 1 
113
#define WTF_COMPILER_QUIRK_GCC11_GLOBAL_ISINF_ISNAN 1
102
#endif
114
#endif
103
104
#else
105
/* Define this for !GCC compilers, just so we can write things like GCC_VERSION_AT_LEAST(4, 1, 0). */
106
#define GCC_VERSION_AT_LEAST(major, minor, patch) 0
107
#endif
115
#endif
108
116
109
/* COMPILER(MINGW) - MinGW GCC */
117
/* COMPILER(MINGW) - MinGW GCC */
- a/Source/WTF/wtf/MathExtras.h +19 lines
Lines 279-289 inline bool isWithinIntRange(float x) a/Source/WTF/wtf/MathExtras.h_sec1
279
279
280
#if !COMPILER(MSVC) && !COMPILER(RVCT) && !OS(SOLARIS)
280
#if !COMPILER(MSVC) && !COMPILER(RVCT) && !OS(SOLARIS)
281
using std::isfinite;
281
using std::isfinite;
282
#if !COMPILER_QUIRK(GCC11_GLOBAL_ISINF_ISNAN)
282
using std::isinf;
283
using std::isinf;
283
using std::isnan;
284
using std::isnan;
285
#endif
284
using std::signbit;
286
using std::signbit;
285
#endif
287
#endif
286
288
289
#if COMPILER_QUIRK(GCC11_GLOBAL_ISINF_ISNAN)
290
// A workaround to avoid conflicting declarations of isinf and isnan when compiling with GCC in C++11 mode.
291
namespace std {
292
    constexpr bool wtf_isinf(float f) { return std::isinf(f); }
293
    constexpr bool wtf_isinf(double d) { return std::isinf(d); }
294
    constexpr bool wtf_isnan(float f) { return std::isnan(f); }
295
    constexpr bool wtf_isnan(double d) { return std::isnan(d); }
296
};
297
298
using std::wtf_isinf;
299
using std::wtf_isnan;
300
301
#define isinf(x) wtf_isinf(x)
302
#define isnan(x) wtf_isnan(x)
303
#endif
304
305
287
// decompose 'number' to its sign, exponent, and mantissa components.
306
// decompose 'number' to its sign, exponent, and mantissa components.
288
// The result is interpreted as:
307
// The result is interpreted as:
289
//     (sign ? -1 : 1) * pow(2, exponent) * (mantissa / (1 << 52))
308
//     (sign ? -1 : 1) * pow(2, exponent) * (mantissa / (1 << 52))

Return to Bug 59249