summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-01-10 07:08:27 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:49:59 -0500
commit073866887d8f0ee50037bfe1779bc172d0b6c178 (patch)
tree50b0afd84d83e683f15462a4653158a98ad9e3c6 /source4/lib
parent81dc03b290c2225a828d71ee7f416b0c0085152f (diff)
downloadsamba-073866887d8f0ee50037bfe1779bc172d0b6c178.tar.gz
samba-073866887d8f0ee50037bfe1779bc172d0b6c178.tar.bz2
samba-073866887d8f0ee50037bfe1779bc172d0b6c178.zip
r12814: we need this here too, as we'll include replace.h for building heimdal/*
too, and for this we don't include includes.h (hopefully) fix the build on AIX metze (This used to be commit 32f2cf433f65aaa9bcc5e33958d6f9c72c7f13d9)
Diffstat (limited to 'source4/lib')
-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 63ec8cfd49..0f1eb42ac0 100644
--- a/source4/lib/replace/replace.h
+++ b/source4/lib/replace/replace.h
@@ -100,6 +100,18 @@ int vasprintf(char **ptr, const char *format, va_list ap);
#define bzero(a,b) memset((a),'\0',(b))
#endif
+#ifndef PRINTF_ATTRIBUTE
+#if !defined(NO_PRINTF_ATTRIBUTE) && (__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
+
/* add varargs prototypes with printf checking */
#ifndef HAVE_SNPRINTF_DECL
int snprintf(char *,size_t ,const char *, ...) PRINTF_ATTRIBUTE(3,4);