summaryrefslogtreecommitdiffstats
path: root/gl/vasnprintf.h
diff options
context:
space:
mode:
Diffstat (limited to 'gl/vasnprintf.h')
-rw-r--r--gl/vasnprintf.h19
1 files changed, 9 insertions, 10 deletions
diff --git a/gl/vasnprintf.h b/gl/vasnprintf.h
index a689bad2..7658f505 100644
--- a/gl/vasnprintf.h
+++ b/gl/vasnprintf.h
@@ -1,5 +1,5 @@
1/* vsprintf with automatic memory allocation. 1/* vsprintf with automatic memory allocation.
2 Copyright (C) 2002-2004, 2007-2010 Free Software Foundation, Inc. 2 Copyright (C) 2002-2004, 2007-2013 Free Software Foundation, Inc.
3 3
4 This program is free software; you can redistribute it and/or modify 4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by 5 it under the terms of the GNU General Public License as published by
@@ -12,8 +12,7 @@
12 GNU General Public License for more details. 12 GNU General Public License for more details.
13 13
14 You should have received a copy of the GNU General Public License along 14 You should have received a copy of the GNU General Public License along
15 with this program; if not, write to the Free Software Foundation, 15 with this program; if not, see <http://www.gnu.org/licenses/>. */
16 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
17 16
18#ifndef _VASNPRINTF_H 17#ifndef _VASNPRINTF_H
19#define _VASNPRINTF_H 18#define _VASNPRINTF_H
@@ -24,16 +23,16 @@
24/* Get size_t. */ 23/* Get size_t. */
25#include <stddef.h> 24#include <stddef.h>
26 25
27#ifndef __attribute__
28/* The __attribute__ feature is available in gcc versions 2.5 and later. 26/* The __attribute__ feature is available in gcc versions 2.5 and later.
29 The __-protected variants of the attributes 'format' and 'printf' are 27 The __-protected variants of the attributes 'format' and 'printf' are
30 accepted by gcc versions 2.6.4 (effectively 2.7) and later. 28 accepted by gcc versions 2.6.4 (effectively 2.7) and later.
31 We enable __attribute__ only if these are supported too, because 29 We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because
32 gnulib and libintl do '#define printf __printf__' when they override 30 gnulib and libintl do '#define printf __printf__' when they override
33 the 'printf' function. */ 31 the 'printf' function. */
34# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) 32#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
35# define __attribute__(Spec) /* empty */ 33# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
36# endif 34#else
35# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
37#endif 36#endif
38 37
39#ifdef __cplusplus 38#ifdef __cplusplus
@@ -69,9 +68,9 @@ extern "C" {
69# define vasnprintf rpl_vasnprintf 68# define vasnprintf rpl_vasnprintf
70#endif 69#endif
71extern char * asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...) 70extern char * asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...)
72 __attribute__ ((__format__ (__printf__, 3, 4))); 71 _GL_ATTRIBUTE_FORMAT ((__printf__, 3, 4));
73extern char * vasnprintf (char *resultbuf, size_t *lengthp, const char *format, va_list args) 72extern char * vasnprintf (char *resultbuf, size_t *lengthp, const char *format, va_list args)
74 __attribute__ ((__format__ (__printf__, 3, 0))); 73 _GL_ATTRIBUTE_FORMAT ((__printf__, 3, 0));
75 74
76#ifdef __cplusplus 75#ifdef __cplusplus
77} 76}