diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-03-22 04:22:39 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:11:10 -0500 |
commit | 340d35be2d3f29a3176d86c0960398c2e36f921f (patch) | |
tree | 7d6eae8267c01b177a5c487348c3f764fad8c0e5 /source4/lib/talloc/talloc.h | |
parent | 455be8fb8271bd97058390dca5a76db81ea2928b (diff) | |
download | samba-340d35be2d3f29a3176d86c0960398c2e36f921f.tar.gz samba-340d35be2d3f29a3176d86c0960398c2e36f921f.tar.bz2 samba-340d35be2d3f29a3176d86c0960398c2e36f921f.zip |
r5937: - performance improvement to talloc_asprintf_append()
- allow standalone talloc to use gcc printf attributes
(This used to be commit e25aa54e962796e6e7385afed57aa287ef6f869d)
Diffstat (limited to 'source4/lib/talloc/talloc.h')
-rw-r--r-- | source4/lib/talloc/talloc.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source4/lib/talloc/talloc.h b/source4/lib/talloc/talloc.h index 0a98881054..f639f3c8cf 100644 --- a/source4/lib/talloc/talloc.h +++ b/source4/lib/talloc/talloc.h @@ -75,8 +75,16 @@ typedef void TALLOC_CTX; #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 /* The following definitions come from talloc.c */ |