Magellan Linux

Contents of /trunk/cpio/patches/cpio-2.9-gnu-inline.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 725 - (show annotations) (download)
Mon Dec 22 23:30:56 2008 UTC (15 years, 5 months ago) by niro
File size: 5997 byte(s)
-added several cpio fixes

1 http://bugs.gentoo.org/198817
2
3 from upstream gnulib for "extern inline" changes
4
5 diff --git a/lib/argp-fmtstream.h b/lib/argp-fmtstream.h
6 index 93fa651..50f1387 100644
7 --- a/lib/argp-fmtstream.h
8 +++ b/lib/argp-fmtstream.h
9 @@ -1,5 +1,5 @@
10 /* Word-wrapping and line-truncating streams.
11 - Copyright (C) 1997, 2006 Free Software Foundation, Inc.
12 + Copyright (C) 1997, 2006-2007 Free Software Foundation, Inc.
13 This file is part of the GNU C Library.
14 Written by Miles Bader <miles@gnu.ai.mit.edu>.
15
16 @@ -134,6 +134,7 @@ extern ssize_t argp_fmtstream_printf (argp_fmtstream_t __fs,
17 const char *__fmt, ...)
18 __attribute__ ((__format__ (printf, 2, 3)));
19
20 +#if _LIBC || !defined __OPTIMIZE__
21 extern int __argp_fmtstream_putc (argp_fmtstream_t __fs, int __ch);
22 extern int argp_fmtstream_putc (argp_fmtstream_t __fs, int __ch);
23
24 @@ -144,6 +145,7 @@ extern size_t __argp_fmtstream_write (argp_fmtstream_t __fs,
25 const char *__str, size_t __len);
26 extern size_t argp_fmtstream_write (argp_fmtstream_t __fs,
27 const char *__str, size_t __len);
28 +#endif
29
30 /* Access macros for various bits of state. */
31 #define argp_fmtstream_lmargin(__fs) ((__fs)->lmargin)
32 @@ -153,6 +155,7 @@ extern size_t argp_fmtstream_write (argp_fmtstream_t __fs,
33 #define __argp_fmtstream_rmargin argp_fmtstream_rmargin
34 #define __argp_fmtstream_wmargin argp_fmtstream_wmargin
35
36 +#if _LIBC || !defined __OPTIMIZE__
37 /* Set __FS's left margin to LMARGIN and return the old value. */
38 extern size_t argp_fmtstream_set_lmargin (argp_fmtstream_t __fs,
39 size_t __lmargin);
40 @@ -174,6 +177,7 @@ extern size_t __argp_fmtstream_set_wmargin (argp_fmtstream_t __fs,
41 /* Return the column number of the current output point in __FS. */
42 extern size_t argp_fmtstream_point (argp_fmtstream_t __fs);
43 extern size_t __argp_fmtstream_point (argp_fmtstream_t __fs);
44 +#endif
45
46 /* Internal routines. */
47 extern void _argp_fmtstream_update (argp_fmtstream_t __fs);
48 @@ -197,7 +201,28 @@ extern int __argp_fmtstream_ensure (argp_fmtstream_t __fs, size_t __amount);
49 #endif
50
51 #ifndef ARGP_FS_EI
52 -#define ARGP_FS_EI extern inline
53 +# ifdef __GNUC__
54 + /* GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99
55 + inline semantics, unless -fgnu89-inline is used. It defines a macro
56 + __GNUC_STDC_INLINE__ to indicate this situation or a macro
57 + __GNUC_GNU_INLINE__ to indicate the opposite situation.
58 + GCC 4.2 with -std=c99 or -std=gnu99 implements the GNU C inline
59 + semantics but warns, unless -fgnu89-inline is used:
60 + warning: C99 inline functions are not supported; using GNU89
61 + warning: to disable this warning use -fgnu89-inline or the gnu_inline function attribute
62 + It defines a macro __GNUC_GNU_INLINE__ to indicate this situation. */
63 +# if defined __GNUC_STDC_INLINE__
64 +# define ARGP_FS_EI inline
65 +# elif defined __GNUC_GNU_INLINE__
66 +# define ARGP_FS_EI extern inline __attribute__ ((__gnu_inline__))
67 +# else
68 +# define ARGP_FS_EI extern inline
69 +# endif
70 +# else
71 + /* With other compilers, assume the ISO C99 meaning of 'inline', if
72 + the compiler supports 'inline' at all. */
73 +# define ARGP_FS_EI inline
74 +# endif
75 #endif
76
77 ARGP_FS_EI size_t
78 diff --git a/lib/argp.h b/lib/argp.h
79 index fb11de6..aa76eb4 100644
80 --- a/lib/argp.h
81 +++ b/lib/argp.h
82 @@ -520,9 +520,11 @@ extern void __argp_state_help (const struct argp_state *__restrict __state,
83 FILE *__restrict __stream,
84 unsigned int __flags);
85
86 +#if _LIBC || !defined __USE_EXTERN_INLINES
87 /* Possibly output the standard usage message for ARGP to stderr and exit. */
88 extern void argp_usage (const struct argp_state *__state);
89 extern void __argp_usage (const struct argp_state *__state);
90 +#endif
91
92 /* If appropriate, print the printf string FMT and following args, preceded
93 by the program name and `:', to stderr, and followed by a `Try ... --help'
94 @@ -551,6 +553,7 @@ extern void __argp_failure (const struct argp_state *__restrict __state,
95 const char *__restrict __fmt, ...)
96 __attribute__ ((__format__ (__printf__, 4, 5)));
97
98 +#if _LIBC || !defined __USE_EXTERN_INLINES
99 /* Returns true if the option OPT is a valid short option. */
100 extern int _option_is_short (const struct argp_option *__opt) __THROW;
101 extern int __option_is_short (const struct argp_option *__opt) __THROW;
102 @@ -559,6 +562,7 @@ extern int __option_is_short (const struct argp_option *__opt) __THROW;
103 options array. */
104 extern int _option_is_end (const struct argp_option *__opt) __THROW;
105 extern int __option_is_end (const struct argp_option *__opt) __THROW;
106 +#endif
107
108 /* Return the input field for ARGP in the parser corresponding to STATE; used
109 by the help routines. */
110 @@ -579,7 +583,28 @@ extern void *__argp_input (const struct argp *__restrict __argp,
111 # endif
112
113 # ifndef ARGP_EI
114 -# define ARGP_EI extern __inline__
115 +# ifdef __GNUC__
116 + /* GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99
117 + inline semantics, unless -fgnu89-inline is used. It defines a macro
118 + __GNUC_STDC_INLINE__ to indicate this situation or a macro
119 + __GNUC_GNU_INLINE__ to indicate the opposite situation.
120 + GCC 4.2 with -std=c99 or -std=gnu99 implements the GNU C inline
121 + semantics but warns, unless -fgnu89-inline is used:
122 + warning: C99 inline functions are not supported; using GNU89
123 + warning: to disable this warning use -fgnu89-inline or the gnu_inline function attribute
124 + It defines a macro __GNUC_GNU_INLINE__ to indicate this situation. */
125 +# if defined __GNUC_STDC_INLINE__
126 +# define ARGP_EI __inline__
127 +# elif defined __GNUC_GNU_INLINE__
128 +# define ARGP_EI extern __inline__ __attribute__ ((__gnu_inline__))
129 +# else
130 +# define ARGP_EI extern __inline__
131 +# endif
132 +# else
133 + /* With other compilers, assume the ISO C99 meaning of 'inline', if
134 + the compiler supports 'inline' at all. */
135 +# define ARGP_EI inline
136 +# endif
137 # endif
138
139 ARGP_EI void