summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/intel_tex_subimage.c6
-rw-r--r--src/util/macros.h11
2 files changed, 7 insertions, 10 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_tex_subimage.c b/src/mesa/drivers/dri/i965/intel_tex_subimage.c
index a121816dcec..cb5738a9387 100644
--- a/src/mesa/drivers/dri/i965/intel_tex_subimage.c
+++ b/src/mesa/drivers/dri/i965/intel_tex_subimage.c
@@ -334,12 +334,6 @@ ytile_copy(
}
}
-#ifdef __GNUC__
-#define FLATTEN __attribute__((flatten))
-#else
-#define FLATTEN
-#endif
-
/**
* Copy texture data from linear to X tile layout, faster.
*
diff --git a/src/util/macros.h b/src/util/macros.h
index 2e2f90f587c..a9867b41354 100644
--- a/src/util/macros.h
+++ b/src/util/macros.h
@@ -75,24 +75,27 @@ do { \
#define unreachable(str)
#endif
+#ifdef HAVE_FUNC_ATTRIBUTE_FLATTEN
+#define FLATTEN __attribute__((__flatten__))
+#else
+#define FLATTEN
+#endif
-#if (__GNUC__ >= 3)
+#ifdef HAVE_FUNC_ATTRIBUTE_FORMAT
#define PRINTFLIKE(f, a) __attribute__ ((format(__printf__, f, a)))
#else
#define PRINTFLIKE(f, a)
#endif
-
/* Used to optionally mark structures with misaligned elements or size as
* packed, to trade off performance for space.
*/
-#if (__GNUC__ >= 3)
+#ifdef HAVE_FUNC_ATTRIBUTE_PACKED
#define PACKED __attribute__((__packed__))
#else
#define PACKED
#endif
-
#ifdef __cplusplus
/**
* Macro function that evaluates to true if T is a trivially