summaryrefslogtreecommitdiff
path: root/source3/tdb/tdb.h
diff options
context:
space:
mode:
Diffstat (limited to 'source3/tdb/tdb.h')
-rw-r--r--source3/tdb/tdb.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/source3/tdb/tdb.h b/source3/tdb/tdb.h
index 3db676a633..e8a6d201c5 100644
--- a/source3/tdb/tdb.h
+++ b/source3/tdb/tdb.h
@@ -32,7 +32,15 @@ extern "C" {
#endif
#ifndef PRINTF_ATTRIBUTE
+/** 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 **/
+#if (__GNUC__ >= 3)
#define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format (__printf__, a1, a2)))
+#else
+#define PRINTF_ATTRIBUTE(a1, a2)
+#endif
#endif
/* flags to tdb_store() */