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 | |
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')
-rw-r--r-- | include/core/SkMatrix.h | 3 | ||||
-rw-r--r-- | include/core/SkStrokeRec.h | 1 | ||||
-rw-r--r-- | include/core/SkTypes.h | 12 | ||||
-rw-r--r-- | include/private/SkMacros.h | 14 |
4 files changed, 17 insertions, 13 deletions
diff --git a/include/core/SkMatrix.h b/include/core/SkMatrix.h index bedb536f18..84f805c637 100644 --- a/include/core/SkMatrix.h +++ b/include/core/SkMatrix.h @@ -18,8 +18,9 @@ #ifndef SkMatrix_DEFINED #define SkMatrix_DEFINED -#include "SkRect.h" +#include "../private/SkMacros.h" #include "../private/SkTo.h" +#include "SkRect.h" struct SkRSXform; struct SkPoint3; diff --git a/include/core/SkStrokeRec.h b/include/core/SkStrokeRec.h index ae059a9d51..deabc9edc8 100644 --- a/include/core/SkStrokeRec.h +++ b/include/core/SkStrokeRec.h @@ -8,6 +8,7 @@ #ifndef SkStrokeRec_DEFINED #define SkStrokeRec_DEFINED +#include "../private/SkMacros.h" #include "SkPaint.h" class SkPath; diff --git a/include/core/SkTypes.h b/include/core/SkTypes.h index ef27a7f42b..3ef236e7f4 100644 --- a/include/core/SkTypes.h +++ b/include/core/SkTypes.h @@ -35,8 +35,6 @@ */ SK_API extern void sk_abort_no_print(void); -#define SK_INIT_TO_AVOID_WARNING = 0 - #ifndef SkDebugf SK_API void SkDebugf(const char format[], ...); #endif @@ -140,16 +138,6 @@ inline constexpr int64_t SkLeftShift(int64_t value, int32_t shift) { template <typename T, size_t N> char (&SkArrayCountHelper(T (&array)[N]))[N]; #define SK_ARRAY_COUNT(array) (sizeof(SkArrayCountHelper(array))) -// 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 - //////////////////////////////////////////////////////////////////////////////// template <typename T> inline constexpr T SkAlign2(T x) { return (x + 1) >> 1 << 1; } 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 |