diff options
Diffstat (limited to 'include/private/SkMacros.h')
-rw-r--r-- | include/private/SkMacros.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/private/SkMacros.h b/include/private/SkMacros.h index 3d79d52230..a68193228f 100644 --- a/include/private/SkMacros.h +++ b/include/private/SkMacros.h @@ -50,4 +50,18 @@ #define SK_REQUIRE_LOCAL_VAR(classname) \ static_assert(false, "missing name for " #classname) +//////////////////////////////////////////////////////////////////////////////// + +// Can be used to bracket data types that must be dense, e.g. hash keys. +#if defined(__clang__) // This should work on GCC too, but GCC diagnostic pop didn't seem to work! + #define SK_BEGIN_REQUIRE_DENSE _Pragma("GCC diagnostic push") \ + _Pragma("GCC diagnostic error \"-Wpadded\"") + #define SK_END_REQUIRE_DENSE _Pragma("GCC diagnostic pop") +#else + #define SK_BEGIN_REQUIRE_DENSE + #define SK_END_REQUIRE_DENSE +#endif + +#define SK_INIT_TO_AVOID_WARNING = 0 + #endif // SkMacros_DEFINED |