summaryrefslogtreecommitdiffstats
path: root/lib/util/attr.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/util/attr.h')
-rw-r--r--lib/util/attr.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/util/attr.h b/lib/util/attr.h
index 9b346459b6..a2690613fb 100644
--- a/lib/util/attr.h
+++ b/lib/util/attr.h
@@ -81,4 +81,16 @@
#endif
#endif
+#ifndef FORMAT_ATTRIBUTE
+#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
+/** Use gcc attribute to check printf fns. a1 is argument to format()
+ * in the above macro. This is needed to support Heimdal's printf
+ * decorations. Note that some gcc 2.x versions don't handle this
+ * properly, and as such I've used the same minimum from heimdal: GCC 3.1 **/
+#define FORMAT_ATTRIBUTE(a) __attribute__ ((format a))
+#else
+#define FORMAT_ATTRIBUTE(a)
+#endif
+#endif
+
#endif /* __UTIL_ATTR_H__ */