Fix build warning
authorSangjin Lee <lsj119@samsung.com>
Fri, 9 Jun 2017 02:16:15 +0000 (11:16 +0900)
committerSung-Jin Park <sj76.park@samsung.com>
Fri, 21 Feb 2020 07:56:57 +0000 (16:56 +0900)
__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

Change-Id: I3f792a7c8b6b7c2f0cfae242c21239fedea6133e

pixman/pixman-glyph.c

index 96a349ab472720b4eb27299ba143c8fa9162def0..470b5ef42ec427c177f38c0f41e8daad646c87cc 100644 (file)
@@ -43,6 +43,14 @@ typedef struct glyph_t glyph_t;
 #define HASH_SIZE (2 * N_GLYPHS_HIGH_WATER)
 #define HASH_MASK (HASH_SIZE - 1)
 
+#if defined(__has_attribute)
+#define HAS_FORCE_ALIGN_ARG_POINTER __has_attribute(__force_align_arg_pointer__)
+#elif defined(_GNUC_) && define(__i386__)
+#define HAS_FORCE_ALIGN_ARG_POINTER 1
+#else
+#define HAS_FORCE_ALIGN_ARG_POINTER 0
+#endif
+
 struct glyph_t
 {
     void *             font_key;
@@ -391,7 +399,7 @@ box32_intersect (pixman_box32_t *dest,
     return dest->x2 > dest->x1 && dest->y2 > dest->y1;
 }
 
-#if defined(__GNUC__) && !defined(__x86_64__) && !defined(__amd64__)
+#if HAS_FORCE_ALIGN_ARG_POINTER
 __attribute__((__force_align_arg_pointer__))
 #endif
 PIXMAN_EXPORT void
@@ -633,7 +641,7 @@ out:
  *   - Trim the mask to the destination clip/image?
  *   - Trim composite region based on sources, when the op ignores 0s.
  */
-#if defined(__GNUC__) && !defined(__x86_64__) && !defined(__amd64__)
+#if HAS_FORCE_ALIGN_ARG_POINTER
 __attribute__((__force_align_arg_pointer__))
 #endif
 PIXMAN_EXPORT void