summaryrefslogtreecommitdiff
path: root/source4/lib/replace/replace.h
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-07-11 04:17:54 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:20:05 -0500
commit54ffd4fdbf470cb71cbf9a9c9e5aa37f73acc559 (patch)
tree9b15a1db27e6cf5de2e181659d15699a97187ef4 /source4/lib/replace/replace.h
parent5f26a5a18af948a671ee9b043e1f51dc72d91749 (diff)
downloadsamba-54ffd4fdbf470cb71cbf9a9c9e5aa37f73acc559.tar.gz
samba-54ffd4fdbf470cb71cbf9a9c9e5aa37f73acc559.tar.bz2
samba-54ffd4fdbf470cb71cbf9a9c9e5aa37f73acc559.zip
r8313: moved PRINTF_ATTRIBUTE to replace.h to try to get irix building with heimdal
(This used to be commit 7d4e309f02cfcef661ebf3bbe9c227938318077c)
Diffstat (limited to 'source4/lib/replace/replace.h')
-rw-r--r--source4/lib/replace/replace.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/source4/lib/replace/replace.h b/source4/lib/replace/replace.h
index e0cb1420ec..c7c343ef38 100644
--- a/source4/lib/replace/replace.h
+++ b/source4/lib/replace/replace.h
@@ -111,4 +111,16 @@ int asprintf(char **,const char *, ...) PRINTF_ATTRIBUTE(2,3);
typedef int (*comparison_fn_t)(const void *, const void *);
#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