summaryrefslogtreecommitdiff
path: root/source4/scripting
diff options
context:
space:
mode:
Diffstat (limited to 'source4/scripting')
-rw-r--r--source4/scripting/swig/tdb.i10
1 files changed, 10 insertions, 0 deletions
diff --git a/source4/scripting/swig/tdb.i b/source4/scripting/swig/tdb.i
index 0c756765de..404f498c26 100644
--- a/source4/scripting/swig/tdb.i
+++ b/source4/scripting/swig/tdb.i
@@ -45,6 +45,16 @@ typedef sig_atomic_t SIG_ATOMIC_T;
typedef int SIG_ATOMIC_T;
#endif
+#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
+
/* Include tdb headers */
#include "lib/tdb/include/tdb.h"