diff options
Diffstat (limited to 'source4/lib/util/attr.h')
-rw-r--r-- | source4/lib/util/attr.h | 12 |
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__ */ |