aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar bungeman@google.com <bungeman@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-08-06 18:32:29 +0000
committerGravatar bungeman@google.com <bungeman@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-08-06 18:32:29 +0000
commit5ebbbe53779cfe93741dc66f433107d04da74486 (patch)
tree0cb876a8f3c0531db8b40f4358271f132795c86e
parentfedc4f9f43a8b187bcd065a0e38c2efc9dbae6f3 (diff)
Annotate SK_COMPILE_ASSERT's typedef as permissibly unused, to fix GCC 4.8 build warning. Patch originally by dholbert.
R=bsalomon@google.com Review URL: https://codereview.chromium.org/22285002 git-svn-id: http://skia.googlecode.com/svn/trunk@10575 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r--include/core/SkPostConfig.h14
-rw-r--r--include/core/SkTypes.h2
2 files changed, 15 insertions, 1 deletions
diff --git a/include/core/SkPostConfig.h b/include/core/SkPostConfig.h
index 022757554c..07c1217f4f 100644
--- a/include/core/SkPostConfig.h
+++ b/include/core/SkPostConfig.h
@@ -63,6 +63,14 @@
#endif
#endif
+#if !defined(SK_ATTRIBUTE)
+ #if defined(__clang__) || defined(__GNUC__)
+ #define SK_ATTRIBUTE(attr) __attribute__((attr))
+ #else
+ #define SK_ATTRIBUTE(attr)
+ #endif
+#endif
+
#if !defined(SK_SUPPORT_GPU)
#define SK_SUPPORT_GPU 1
#endif
@@ -354,6 +362,12 @@
//////////////////////////////////////////////////////////////////////
+#if !defined(SK_UNUSED)
+ #define SK_UNUSED SK_ATTRIBUTE(unused)
+#endif
+
+//////////////////////////////////////////////////////////////////////
+
#ifndef SK_PRINTF_LIKE
#if defined(__clang__) || defined(__GNUC__)
#define SK_PRINTF_LIKE(A, B) __attribute__((format(printf, (A), (B))))
diff --git a/include/core/SkTypes.h b/include/core/SkTypes.h
index 48a6de80dd..039369119e 100644
--- a/include/core/SkTypes.h
+++ b/include/core/SkTypes.h
@@ -127,7 +127,7 @@ struct SkCompileAssert {
};
#define SK_COMPILE_ASSERT(expr, msg) \
- typedef SkCompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1]
+ typedef SkCompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1] SK_UNUSED
/*
* Usage: SK_MACRO_CONCAT(a, b) to construct the symbol ab