Index: src/core/SkNx.h |
diff --git a/src/core/SkNx.h b/src/core/SkNx.h |
index af7194840a4f028c8bc9dca0c339349a4a79866a..0f5aa829dfc99a5c271897d2e6bc97c55904b663 100644 |
--- a/src/core/SkNx.h |
+++ b/src/core/SkNx.h |
@@ -17,6 +17,13 @@ |
#include <math.h> |
#define REQUIRE(x) static_assert(x, #x) |
+// This file may be included multiple times by .cpp files with different flags, leading |
+// to different definitions. Usually that doesn't matter because it's all inlined, but |
+// in Debug modes the compilers may not inline everything. So wrap everything in an |
+// anonymous namespace to give each includer their own silo of this code (or the linker |
+// will probably pick one randomly for us, which is rarely correct). |
+namespace { |
+ |
// The default implementations just fall back on a pair of size N/2. |
// SkNb is a _very_ minimal class representing a vector of bools returned by comparison operators. |
@@ -251,6 +258,7 @@ protected: |
T fVal; |
}; |
+} // namespace |
// Generic syntax sugar that should work equally well for all implementations. |
template <typename T> T operator - (const T& l) { return T(0) - l; } |