3cd4d4
commit 2c820533c61fed175390bc6058afbbe42d2edc37
3cd4d4
Author: Florian Weimer <fweimer@redhat.com>
3cd4d4
Date:   Thu Aug 18 11:15:42 2016 +0200
3cd4d4
3cd4d4
    argp: Do not override GCC keywords with macros [BZ #16907]
3cd4d4
    
3cd4d4
    glibc provides fallback definitions already.  It is not necessary to
3cd4d4
    suppress warnings for unknown attributes because GCC does this
3cd4d4
    automatically for system headers.
3cd4d4
    
3cd4d4
    This commit does not sync with gnulib because gnulib has started to use
3cd4d4
    _GL_* macros in the header file, which are arguably in the gnulib
3cd4d4
    implementation space and not suitable for an installed glibc header
3cd4d4
    file.
3cd4d4
3cd4d4
diff --git a/argp/argp-fmtstream.h b/argp/argp-fmtstream.h
3cd4d4
index 61c45bf86b6bf8d5..b8e4e2406ff2784e 100644
3cd4d4
--- a/argp/argp-fmtstream.h
3cd4d4
+++ b/argp/argp-fmtstream.h
3cd4d4
@@ -29,21 +29,6 @@
3cd4d4
 #include <string.h>
3cd4d4
 #include <unistd.h>
3cd4d4
 
3cd4d4
-#ifndef __attribute__
3cd4d4
-/* This feature is available in gcc versions 2.5 and later.  */
3cd4d4
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || \
3cd4d4
-  defined __STRICT_ANSI__
3cd4d4
-#  define __attribute__(Spec) /* empty */
3cd4d4
-# endif
3cd4d4
-/* The __-protected variants of `format' and `printf' attributes
3cd4d4
-   are accepted by gcc versions 2.6.4 (effectively 2.7) and later.  */
3cd4d4
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) || \
3cd4d4
-  defined __STRICT_ANSI__
3cd4d4
-#  define __format__ format
3cd4d4
-#  define __printf__ printf
3cd4d4
-# endif
3cd4d4
-#endif
3cd4d4
-
3cd4d4
 #if defined (__GNU_LIBRARY__) && defined (HAVE_LINEWRAP_H)
3cd4d4
 /* line_wrap_stream is available, so use that.  */
3cd4d4
 #define ARGP_FMTSTREAM_USE_LINEWRAP
3cd4d4
@@ -111,6 +96,8 @@ struct argp_fmtstream
3cd4d4
 
3cd4d4
 typedef struct argp_fmtstream *argp_fmtstream_t;
3cd4d4
 
3cd4d4
+__BEGIN_DECLS
3cd4d4
+
3cd4d4
 /* Return an argp_fmtstream that outputs to STREAM, and which prefixes lines
3cd4d4
    written on it with LMARGIN spaces and limits them to RMARGIN columns
3cd4d4
    total.  If WMARGIN >= 0, words that extend past RMARGIN are wrapped by
3cd4d4
@@ -297,6 +284,8 @@ __argp_fmtstream_point (argp_fmtstream_t __fs)
3cd4d4
 
3cd4d4
 #endif /* __OPTIMIZE__ */
3cd4d4
 
3cd4d4
+__END_DECLS
3cd4d4
+
3cd4d4
 #endif /* ARGP_FMTSTREAM_USE_LINEWRAP */
3cd4d4
 
3cd4d4
 #endif /* argp-fmtstream.h */
3cd4d4
diff --git a/argp/argp.h b/argp/argp.h
3cd4d4
index 37544fe44a102574..61b792909530aaac 100644
3cd4d4
--- a/argp/argp.h
3cd4d4
+++ b/argp/argp.h
3cd4d4
@@ -29,48 +29,12 @@
3cd4d4
 #define __need_error_t
3cd4d4
 #include <errno.h>
3cd4d4
 
3cd4d4
-#ifndef __THROW
3cd4d4
-# define __THROW
3cd4d4
-#endif
3cd4d4
-#ifndef __NTH
3cd4d4
-# define __NTH(fct) fct __THROW
3cd4d4
-#endif
3cd4d4
-
3cd4d4
-#ifndef __attribute__
3cd4d4
-/* This feature is available in gcc versions 2.5 and later.  */
3cd4d4
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || \
3cd4d4
-  defined __STRICT_ANSI__
3cd4d4
-#  define __attribute__(Spec) /* empty */
3cd4d4
-# endif
3cd4d4
-/* The __-protected variants of `format' and `printf' attributes
3cd4d4
-   are accepted by gcc versions 2.6.4 (effectively 2.7) and later.  */
3cd4d4
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) || \
3cd4d4
-  defined __STRICT_ANSI__
3cd4d4
-#  define __format__ format
3cd4d4
-#  define __printf__ printf
3cd4d4
-# endif
3cd4d4
-#endif
3cd4d4
-
3cd4d4
-/* GCC 2.95 and later have "__restrict"; C99 compilers have
3cd4d4
-   "restrict", and "configure" may have defined "restrict".  */
3cd4d4
-#ifndef __restrict
3cd4d4
-# if ! (2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__))
3cd4d4
-#  if defined restrict || 199901L <= __STDC_VERSION__
3cd4d4
-#   define __restrict restrict
3cd4d4
-#  else
3cd4d4
-#   define __restrict
3cd4d4
-#  endif
3cd4d4
-# endif
3cd4d4
-#endif
3cd4d4
-
3cd4d4
 #ifndef __error_t_defined
3cd4d4
 typedef int error_t;
3cd4d4
 # define __error_t_defined
3cd4d4
 #endif
3cd4d4
 
3cd4d4
-#ifdef  __cplusplus
3cd4d4
-extern "C" {
3cd4d4
-#endif
3cd4d4
+__BEGIN_DECLS
3cd4d4
 
3cd4d4
 /* A description of a particular option.  A pointer to an array of
3cd4d4
    these is passed in the OPTIONS field of an argp structure.  Each option
3cd4d4
@@ -591,8 +555,6 @@ __NTH (__option_is_end (const struct argp_option *__opt))
3cd4d4
 # endif
3cd4d4
 #endif /* Use extern inlines.  */
3cd4d4
 
3cd4d4
-#ifdef  __cplusplus
3cd4d4
-}
3cd4d4
-#endif
3cd4d4
+__END_DECLS
3cd4d4
 
3cd4d4
 #endif /* argp.h */