summaryrefslogtreecommitdiff
path: root/source4/lib/util/attr.h
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-09-21 02:00:50 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:07:03 -0500
commitf415ba5bcfdbf22571526ce4e5e103d1eebab5c5 (patch)
tree025b870f2840bc434b3683e1251f39ba2c63cbff /source4/lib/util/attr.h
parent9f43d96e3f64b9354cd2cc1685fab254f811eedf (diff)
downloadsamba-f415ba5bcfdbf22571526ce4e5e103d1eebab5c5.tar.gz
samba-f415ba5bcfdbf22571526ce4e5e103d1eebab5c5.tar.bz2
samba-f415ba5bcfdbf22571526ce4e5e103d1eebab5c5.zip
r25267: Move PRINTF_ATTRIBUTE to lib/util as well.
(This used to be commit 72b9d6c03661d72e83a5d60d43b75bb9bd5f5285)
Diffstat (limited to 'source4/lib/util/attr.h')
-rw-r--r--source4/lib/util/attr.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/source4/lib/util/attr.h b/source4/lib/util/attr.h
index 1357d902af..8f6c4f5d8a 100644
--- a/source4/lib/util/attr.h
+++ b/source4/lib/util/attr.h
@@ -77,4 +77,16 @@
#endif
#endif
+#ifndef PRINTF_ATTRIBUTE
+#if __GNUC__ >= 3
+/** Use gcc attribute to check printf fns. a1 is the 1-based index of
+ * the parameter containing the format, and a2 the index of the first
+ * argument. Note that some gcc 2.x versions don't handle this
+ * properly **/
+#define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format (__printf__, a1, a2)))
+#else
+#define PRINTF_ATTRIBUTE(a1, a2)
+#endif
+#endif
+
#endif /* __UTIL_ATTR_H__ */