i965/fs: Make half() divide the register width by 2 and use it more
[mesa.git] / src / util / macros.h
index 2e2f90f587c08c1364606ded52fa47bde0f911a0..40ebf02da84cc86c22cbd930d29c8f07185604e4 100644 (file)
@@ -75,24 +75,33 @@ 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
 
+#ifdef HAVE_FUNC_ATTRIBUTE_MALLOC
+#define MALLOCLIKE __attribute__((__malloc__))
+#else
+#define MALLOCLIKE
+#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