xref: /OK3568_Linux_fs/buildroot/package/argp-standalone/0003-fix_build_with_c99_compilers.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1From b2dfa011a3fdcb7d22764d143517d0fbd1c2a201 Mon Sep 17 00:00:00 2001
2From: Emmanuel Dreyfus <manu@netbsd.org>
3Date: Wed, 22 Jan 2014 14:47:23 +0100
4Subject: [PATCH] Fix build with c99 compilers
5
6BUG: 764655
7Change-Id: If5dfdc9c7427bd3d39d8da8f79e33ae2da6a3137
8Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
9Reviewed-on: http://review.gluster.org/6034
10Reviewed-by: Harshavardhana <harsha@harshavardhana.net>
11Tested-by: Gluster Build System <jenkins@build.gluster.com>
12---
13
14diff --git a/argp-fmtstream.c b/argp-fmtstream.c
15index 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 */
33diff --git a/argp-fmtstream.h b/argp-fmtstream.h
34index 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
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