From f20cf610809d74aff58a3711a0405f243da5dce4 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 12 Nov 2010 13:14:00 +1100 Subject: Add attribute macros for Heimdal to use Heimdal uses HEIMDAL_NORETURN_ATTRIBUTE and HEIMDAL_PRINTF_ATTRIBUTE, and we need to provide a link between these and Samba's function attribute handling. Andrew Bartlett --- lib/util/attr.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'lib/util') diff --git a/lib/util/attr.h b/lib/util/attr.h index 9b346459b6..a2690613fb 100644 --- a/lib/util/attr.h +++ b/lib/util/attr.h @@ -81,4 +81,16 @@ #endif #endif +#ifndef FORMAT_ATTRIBUTE +#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) +/** Use gcc attribute to check printf fns. a1 is argument to format() + * in the above macro. This is needed to support Heimdal's printf + * decorations. Note that some gcc 2.x versions don't handle this + * properly, and as such I've used the same minimum from heimdal: GCC 3.1 **/ +#define FORMAT_ATTRIBUTE(a) __attribute__ ((format a)) +#else +#define FORMAT_ATTRIBUTE(a) +#endif +#endif + #endif /* __UTIL_ATTR_H__ */ -- cgit