]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/argp-standalone/0003-fix_build_with_c99_compilers.patch
bfa0bb53e1f67bcd7504d0b07f5578456d887225
[coffee/buildroot.git] / package / argp-standalone / 0003-fix_build_with_c99_compilers.patch
1 From b2dfa011a3fdcb7d22764d143517d0fbd1c2a201 Mon Sep 17 00:00:00 2001
2 From: Emmanuel Dreyfus <manu@netbsd.org>
3 Date: Wed, 22 Jan 2014 14:47:23 +0100
4 Subject: [PATCH] Fix build with c99 compilers
5
6 BUG: 764655
7 Change-Id: If5dfdc9c7427bd3d39d8da8f79e33ae2da6a3137
8 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
9 Reviewed-on: http://review.gluster.org/6034
10 Reviewed-by: Harshavardhana <harsha@harshavardhana.net>
11 Tested-by: Gluster Build System <jenkins@build.gluster.com>
12 ---
13
14 diff --git a/argp-fmtstream.c b/argp-fmtstream.c
15 index 7f79285..494b6b3 100644
16 --- a/argp-fmtstream.c
17 +++ b/argp-fmtstream.c
18 @@ -389,6 +389,7 @@
19  weak_alias (__argp_fmtstream_printf, argp_fmtstream_printf)
20  #endif
21  
22 +#if __STDC_VERSION__ - 199900L < 1
23  /* Duplicate the inline definitions in argp-fmtstream.h, for compilers
24   * that don't do inlining. */
25  size_t
26 @@ -471,5 +472,6 @@
27      __argp_fmtstream_update (__fs);
28    return __fs->point_col >= 0 ? __fs->point_col : 0;
29  }
30 +#endif /* __STDC_VERSION__ - 199900L < 1 */
31  
32  #endif /* !ARGP_FMTSTREAM_USE_LINEWRAP */
33 diff --git a/argp-fmtstream.h b/argp-fmtstream.h
34 index e797b11..828f435 100644
35 --- a/argp-fmtstream.h
36 +++ b/argp-fmtstream.h
37 @@ -153,6 +153,7 @@
38                                       __const char *__fmt, ...)
39       PRINTF_STYLE(2,3);
40  
41 +#if __STDC_VERSION__ - 199900L < 1
42  extern int __argp_fmtstream_putc (argp_fmtstream_t __fs, int __ch);
43  extern int argp_fmtstream_putc (argp_fmtstream_t __fs, int __ch);
44  
45 @@ -163,6 +164,7 @@
46                                       __const char *__str, size_t __len);
47  extern size_t argp_fmtstream_write (argp_fmtstream_t __fs,
48                                     __const char *__str, size_t __len);
49 +#endif /* __STDC_VERSION__ - 199900L < 1 */
50  \f
51  /* Access macros for various bits of state.  */
52  #define argp_fmtstream_lmargin(__fs) ((__fs)->lmargin)
53 @@ -172,6 +174,7 @@
54  #define __argp_fmtstream_rmargin argp_fmtstream_rmargin
55  #define __argp_fmtstream_wmargin argp_fmtstream_wmargin
56  
57 +#if __STDC_VERSION__ - 199900L < 1
58  /* Set __FS's left margin to LMARGIN and return the old value.  */
59  extern size_t argp_fmtstream_set_lmargin (argp_fmtstream_t __fs,
60                                           size_t __lmargin);
61 @@ -193,6 +196,7 @@
62  /* Return the column number of the current output point in __FS.  */
63  extern size_t argp_fmtstream_point (argp_fmtstream_t __fs);
64  extern size_t __argp_fmtstream_point (argp_fmtstream_t __fs);
65 +#endif /* __STDC_VERSION__ - 199900L < 1 */
66  
67  /* Internal routines.  */
68  extern void _argp_fmtstream_update (argp_fmtstream_t __fs);
69 @@ -216,7 +220,11 @@
70  #endif
71  
72  #ifndef ARGP_FS_EI
73 +#if defined(__GNUC__) && !defined(__GNUC_STDC_INLINE__)
74  #define ARGP_FS_EI extern inline
75 +#else
76 +#define ARGP_FS_EI inline
77 +#endif
78  #endif
79  
80  ARGP_FS_EI size_t