gecko-dev/gfx/cairo/clang-cl-popcount.patch
Nathan Froyd 7c06e89288 Bug 1577583 - use __builtin_popcount in cairo for clang; r=lsalzman
`register` isn't allowed in C++17, but cairo is too old to care.
Instead of turning off the warning, just use the `__builtin_popcount`
path for clang.  This path also applies to clang-cl.

Differential Revision: https://phabricator.services.mozilla.com/D44047

--HG--
extra : moz-landing-system : lando
2019-09-12 13:06:01 +00:00

14 lines
479 B
Diff

diff --git a/gfx/cairo/cairo/src/cairoint.h b/gfx/cairo/cairo/src/cairoint.h
index d71ddca..c3c2b9b 100644
--- a/gfx/cairo/cairo/src/cairoint.h
+++ b/gfx/cairo/cairo/src/cairoint.h
@@ -178,7 +178,7 @@ do { \
static inline int cairo_const
_cairo_popcount (uint32_t mask)
{
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || __clang__
return __builtin_popcount (mask);
#else
register int y;