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
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>
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
19 weak_alias (__argp_fmtstream_printf, argp_fmtstream_printf)
22 +#if __STDC_VERSION__ - 199900L < 1
23 /* Duplicate the inline definitions in argp-fmtstream.h, for compilers
24 * that don't do inlining. */
27 __argp_fmtstream_update (__fs);
28 return __fs->point_col >= 0 ? __fs->point_col : 0;
30 +#endif /* __STDC_VERSION__ - 199900L < 1 */
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
38 __const char *__fmt, ...)
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);
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 */
51 /* Access macros for various bits of state. */
52 #define argp_fmtstream_lmargin(__fs) ((__fs)->lmargin)
54 #define __argp_fmtstream_rmargin argp_fmtstream_rmargin
55 #define __argp_fmtstream_wmargin argp_fmtstream_wmargin
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,
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 */
67 /* Internal routines. */
68 extern void _argp_fmtstream_update (argp_fmtstream_t __fs);
73 +#if defined(__GNUC__) && !defined(__GNUC_STDC_INLINE__)
74 #define ARGP_FS_EI extern inline
76 +#define ARGP_FS_EI inline