blob: 37189eca3596b21df1d7f8a866bf0139f58d7821 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
XXX libstdc++ from gcc-4.9.4 doesn't yet decorate std::min/std::max
with constexpr
Index: Source/WebCore/platform/graphics/FontSelectionAlgorithm.h
--- Source/WebCore/platform/graphics/FontSelectionAlgorithm.h.orig
+++ Source/WebCore/platform/graphics/FontSelectionAlgorithm.h
@@ -49,7 +49,11 @@ class FontSelectionValue { (public)
explicit constexpr FontSelectionValue(float);
// Precision can be lost, but value will be clamped to the representable range.
+#if defined(__GLIBCXX__) && __GLIBCXX__ <= 20160726L
+ static inline FontSelectionValue clampFloat(float);
+#else
static constexpr FontSelectionValue clampFloat(float);
+#endif
// Since floats have 23 mantissa bits, every value can be represented losslessly.
constexpr operator float() const;
@@ -125,7 +129,11 @@ constexpr FontSelectionValue FontSelectionValue::minim
return { std::numeric_limits<BackingType>::min(), RawTag::RawTag };
}
+#if defined(__GLIBCXX__) && __GLIBCXX__ <= 20160726L
+inline FontSelectionValue FontSelectionValue::clampFloat(float value)
+#else
constexpr FontSelectionValue FontSelectionValue::clampFloat(float value)
+#endif
{
return FontSelectionValue { std::max<float>(minimumValue(), std::min<float>(value, maximumValue())) };
}
|