Commit 7c06e892 authored by Nathan Froyd's avatar Nathan Froyd
Browse files

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
parent c3bcfee4
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -248,6 +248,8 @@ win32-avoid-extend-pad-fallback: Avoid falling back to pixman when using EXTEND_

support-new-style-atomic-primitives.patch: Support the __atomic_* primitives for atomic operations

clang-cl-popcount.patch: Use __builtin_popcount for Clang (including clang-cl)

==== disable printing patch ====

disable-printing.patch:  allows us to use NS_PRINTING to disable printing.
+1 −1
Original line number Diff line number Diff line
@@ -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;
+13 −0
Original line number Diff line number Diff line
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;