From d7455018eb62786b60f2f01ea60ef5513e611eb7 Mon Sep 17 00:00:00 2001 From: Luke Date: Fri, 27 Nov 2020 21:53:29 +0000 Subject: [PATCH] LibGfx: gamma_to_linear4 is not a valid constexpr on clang 10 and below This is a hack which can be removed once GitHub Actions changes the default version to clang 11. This is apparently sometime in mid-December. Note, clang-11 is not currently available on Ubuntu 20.04. However, GitHub Actions uses 20.04, which probably means clang-11 will become available around that time for all 20.04 users. --- Libraries/LibGfx/Gamma.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Libraries/LibGfx/Gamma.h b/Libraries/LibGfx/Gamma.h index c499eeeb17..0ef95b5f48 100644 --- a/Libraries/LibGfx/Gamma.h +++ b/Libraries/LibGfx/Gamma.h @@ -59,7 +59,13 @@ typedef float v4sf __attribute__((vector_size(16))); // Transform v4sf from gamma2.2 space to linear space // Assumes x is in range [0, 1] +// FIXME: Remove this hack once clang-11 is available as the default in Github Actions. +// This is apparently sometime mid-December. https://github.com/actions/virtual-environments/issues/2130 +# if !defined(__clang__) || __clang_major__ >= 11 constexpr v4sf gamma_to_linear4(v4sf x) +# else +inline v4sf gamma_to_linear4(v4sf x) +# endif { return (0.8f + 0.2f * x) * x * x; }