diff options
author | Hal Canary <halcanary@google.com> | 2018-06-12 14:50:37 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-06-12 20:24:43 +0000 |
commit | 50dbc0949fb256a316163143e649028eeed2970a (patch) | |
tree | b0069d2b47cccfb207d4a5245f18a6b9455c3300 /include/private/SkMacros.h | |
parent | bc718c1e9ce0b4c2d10458f4c3549fd98e10a9f2 (diff) |
SkTypes: more into SkMacros
Change-Id: I4c9a2d81a1bc4ccebc78eea56c0de116b98d415e
Reviewed-on: https://skia-review.googlesource.com/134330
Commit-Queue: Hal Canary <halcanary@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
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 |