X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fargp-fmtstream.h;h=0222d1d49cf9682128c9903dd2f04ac735e27c91;hb=fa1db0dd22768f09a507674a30beb5b8a87bb35f;hp=b913d1b254bb324b8a97c9e4004ca206460144c8;hpb=4a24fcd6cf5620964e71361c57c2b273225dc47a;p=gnulib.git diff --git a/lib/argp-fmtstream.h b/lib/argp-fmtstream.h index b913d1b25..0222d1d49 100644 --- a/lib/argp-fmtstream.h +++ b/lib/argp-fmtstream.h @@ -1,5 +1,5 @@ /* Word-wrapping and line-truncating streams. - Copyright (C) 1997, 2006-2010 Free Software Foundation, Inc. + Copyright (C) 1997, 2006-2013 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Miles Bader . @@ -16,7 +16,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -/* This package emulates glibc `line_wrap_stream' semantics for systems that +/* This package emulates glibc 'line_wrap_stream' semantics for systems that don't have that. If the system does have it, it is just a wrapper for that. This header file is only used internally while compiling argp, and shouldn't be installed. */ @@ -28,16 +28,16 @@ #include #include -#ifndef __attribute__ /* The __attribute__ feature is available in gcc versions 2.5 and later. The __-protected variants of the attributes 'format' and 'printf' are accepted by gcc versions 2.6.4 (effectively 2.7) and later. - We enable __attribute__ only if these are supported too, because + We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because gnulib and libintl do '#define printf __printf__' when they override the 'printf' function. */ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) -# define __attribute__(Spec) /* empty */ -# endif +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) +# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec)) +#else +# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */ #endif #if (_LIBC - 0 && !defined (USE_IN_LIBIO)) \ @@ -128,12 +128,12 @@ extern void argp_fmtstream_free (argp_fmtstream_t __fs); extern ssize_t __argp_fmtstream_printf (argp_fmtstream_t __fs, const char *__fmt, ...) - __attribute__ ((__format__ (printf, 2, 3))); + _GL_ATTRIBUTE_FORMAT ((printf, 2, 3)); extern ssize_t argp_fmtstream_printf (argp_fmtstream_t __fs, const char *__fmt, ...) - __attribute__ ((__format__ (printf, 2, 3))); + _GL_ATTRIBUTE_FORMAT ((printf, 2, 3)); -#if _LIBC || !defined __OPTIMIZE__ +#if _LIBC extern int __argp_fmtstream_putc (argp_fmtstream_t __fs, int __ch); extern int argp_fmtstream_putc (argp_fmtstream_t __fs, int __ch); @@ -154,7 +154,7 @@ extern size_t argp_fmtstream_write (argp_fmtstream_t __fs, #define __argp_fmtstream_rmargin argp_fmtstream_rmargin #define __argp_fmtstream_wmargin argp_fmtstream_wmargin -#if _LIBC || !defined __OPTIMIZE__ +#if _LIBC /* Set __FS's left margin to LMARGIN and return the old value. */ extern size_t argp_fmtstream_set_lmargin (argp_fmtstream_t __fs, size_t __lmargin); @@ -184,7 +184,7 @@ extern void __argp_fmtstream_update (argp_fmtstream_t __fs); extern int _argp_fmtstream_ensure (argp_fmtstream_t __fs, size_t __amount); extern int __argp_fmtstream_ensure (argp_fmtstream_t __fs, size_t __amount); -#ifdef __OPTIMIZE__ +#if !_LIBC || defined __OPTIMIZE__ /* Inline versions of above routines. */ #if !_LIBC @@ -197,6 +197,13 @@ extern int __argp_fmtstream_ensure (argp_fmtstream_t __fs, size_t __amount); #define __argp_fmtstream_point argp_fmtstream_point #define __argp_fmtstream_update _argp_fmtstream_update #define __argp_fmtstream_ensure _argp_fmtstream_ensure +#ifndef _GL_INLINE_HEADER_BEGIN + #error "Please include config.h first." +#endif +_GL_INLINE_HEADER_BEGIN +#ifndef ARGP_FS_EI +# define ARGP_FS_EI _GL_INLINE +#endif #endif #ifndef ARGP_FS_EI @@ -345,9 +352,10 @@ __argp_fmtstream_point (argp_fmtstream_t __fs) #undef __argp_fmtstream_point #undef __argp_fmtstream_update #undef __argp_fmtstream_ensure +_GL_INLINE_HEADER_END #endif -#endif /* __OPTIMIZE__ */ +#endif /* !_LIBC || __OPTIMIZE__ */ #endif /* ARGP_FMTSTREAM_USE_LINEWRAP */