diff options
author | Björn Jacke <bj@sernet.de> | 2020-05-24 13:56:22 +0200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2020-05-24 23:55:36 +0000 |
commit | 2f75b35e1b86a6eb094c7193e3dae76778197696 (patch) | |
tree | 75dbbe4cd307844670c1f4af0209238deb0e45fa /lib/talloc | |
parent | 22870830159a753a70e197f7abe671a1d642f00e (diff) | |
download | samba-2f75b35e1b86a6eb094c7193e3dae76778197696.tar.gz |
talloc: also use portable __has_attribute macro to check for attribute support
Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'lib/talloc')
-rw-r--r-- | lib/talloc/talloc.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/talloc/talloc.h b/lib/talloc/talloc.h index b991dd3c4f5..0154bf3bbf6 100644 --- a/lib/talloc/talloc.h +++ b/lib/talloc/talloc.h @@ -89,8 +89,13 @@ typedef void TALLOC_CTX; #define TALLOC_DEPRECATED 0 #endif +/* for old gcc releases that don't have the feature test macro __has_attribute */ +#ifndef __has_attribute +#define __has_attribute(x) 0 +#endif + #ifndef PRINTF_ATTRIBUTE -#if (__GNUC__ >= 3) +#if __has_attribute(format) || (__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 |