Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(193)

Unified Diff: third_party/qcms/src/transform.c

Issue 11365242: Fix compiler warning in qcms with gcc/arm (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/qcms/google.patch ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/qcms/src/transform.c
diff --git a/third_party/qcms/src/transform.c b/third_party/qcms/src/transform.c
index 44ce9b5631f047866ae69c21e8c8ec8cdeb6ebaa..7312ced88ca3ab6a45865c89f1b6ede8faf581c6 100644
--- a/third_party/qcms/src/transform.c
+++ b/third_party/qcms/src/transform.c
@@ -1323,19 +1323,20 @@ qcms_transform* qcms_transform_create(
return transform;
}
-#if defined(__GNUC__) && !defined(__x86_64__) && !defined(__amd64__)
-#if !defined(__has_attribute)
-/* Assume that the compiler supports the provided attribute. */
-#define __has_attribute(x) 1
+/* __force_align_arg_pointer__ is an x86-only attribute, and gcc/clang warns on unused
+ * attributes. Don't use this on ARM or AMD64. __has_attribute can detect the presence
+ * of the attribute but is currently only supported by clang */
+#if defined(__has_attribute)
+#define HAS_FORCE_ALIGN_ARG_POINTER __has_attribute(__force_align_arg_pointer__)
+#elif defined(__GNUC__) && !defined(__x86_64__) && !defined(__amd64__) && !defined(__arm__)
+#define HAS_FORCE_ALIGN_ARG_POINTER 1
+#else
+#define HAS_FORCE_ALIGN_ARG_POINTER 0
#endif
-#if __has_attribute(__force_align_arg_pointer__)
+
+#if HAS_FORCE_ALIGN_ARG_POINTER
/* we need this to avoid crashes when gcc assumes the stack is 128bit aligned */
__attribute__((__force_align_arg_pointer__))
-#else
-/* __force_align_arg_pointer__ is an x86-only attribute, and clang warns on used
- * attributes. Don't use this on ARM.
- */
-#endif
#endif
void qcms_transform_data(qcms_transform *transform, void *src, void *dest, size_t length)
{
« no previous file with comments | « third_party/qcms/google.patch ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698