Index: src/core/Sk4px.h |
diff --git a/src/core/Sk4px.h b/src/core/Sk4px.h |
index 48e09e1c9200d3dbb2d87f4441ca2f534a037cae..8fb546a40639f851abc6192a954d5df21c5a1f03 100644 |
--- a/src/core/Sk4px.h |
+++ b/src/core/Sk4px.h |
@@ -11,6 +11,13 @@ |
#include "SkNx.h" |
#include "SkColor.h" |
+// 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 { |
+ |
// 1, 2 or 4 SkPMColors, generally vectorized. |
class Sk4px : public Sk16b { |
public: |
@@ -171,6 +178,8 @@ private: |
typedef Sk16b INHERITED; |
}; |
+} // namespace |
+ |
#ifdef SKNX_NO_SIMD |
#include "../opts/Sk4px_none.h" |
#else |