0003-fix_build_with_c99_compilers.patch 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. BUG: 764655
  6. Change-Id: If5dfdc9c7427bd3d39d8da8f79e33ae2da6a3137
  7. Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
  8. Reviewed-on: http://review.gluster.org/6034
  9. Reviewed-by: Harshavardhana <harsha@harshavardhana.net>
  10. Tested-by: Gluster Build System <jenkins@build.gluster.com>
  11. ---
  12. diff --git a/argp-fmtstream.c b/argp-fmtstream.c
  13. index 7f79285..494b6b3 100644
  14. --- a/argp-fmtstream.c
  15. +++ b/argp-fmtstream.c
  16. @@ -389,6 +389,7 @@
  17. weak_alias (__argp_fmtstream_printf, argp_fmtstream_printf)
  18. #endif
  19. +#if __STDC_VERSION__ - 199900L < 1
  20. /* Duplicate the inline definitions in argp-fmtstream.h, for compilers
  21. * that don't do inlining. */
  22. size_t
  23. @@ -471,5 +472,6 @@
  24. __argp_fmtstream_update (__fs);
  25. return __fs->point_col >= 0 ? __fs->point_col : 0;
  26. }
  27. +#endif /* __STDC_VERSION__ - 199900L < 1 */
  28. #endif /* !ARGP_FMTSTREAM_USE_LINEWRAP */
  29. diff --git a/argp-fmtstream.h b/argp-fmtstream.h
  30. index e797b11..828f435 100644
  31. --- a/argp-fmtstream.h
  32. +++ b/argp-fmtstream.h
  33. @@ -153,6 +153,7 @@
  34. __const char *__fmt, ...)
  35. PRINTF_STYLE(2,3);
  36. +#if __STDC_VERSION__ - 199900L < 1
  37. extern int __argp_fmtstream_putc (argp_fmtstream_t __fs, int __ch);
  38. extern int argp_fmtstream_putc (argp_fmtstream_t __fs, int __ch);
  39. @@ -163,6 +164,7 @@
  40. __const char *__str, size_t __len);
  41. extern size_t argp_fmtstream_write (argp_fmtstream_t __fs,
  42. __const char *__str, size_t __len);
  43. +#endif /* __STDC_VERSION__ - 199900L < 1 */
  44. /* Access macros for various bits of state. */
  45. #define argp_fmtstream_lmargin(__fs) ((__fs)->lmargin)
  46. @@ -172,6 +174,7 @@
  47. #define __argp_fmtstream_rmargin argp_fmtstream_rmargin
  48. #define __argp_fmtstream_wmargin argp_fmtstream_wmargin
  49. +#if __STDC_VERSION__ - 199900L < 1
  50. /* Set __FS's left margin to LMARGIN and return the old value. */
  51. extern size_t argp_fmtstream_set_lmargin (argp_fmtstream_t __fs,
  52. size_t __lmargin);
  53. @@ -193,6 +196,7 @@
  54. /* Return the column number of the current output point in __FS. */
  55. extern size_t argp_fmtstream_point (argp_fmtstream_t __fs);
  56. extern size_t __argp_fmtstream_point (argp_fmtstream_t __fs);
  57. +#endif /* __STDC_VERSION__ - 199900L < 1 */
  58. /* Internal routines. */
  59. extern void _argp_fmtstream_update (argp_fmtstream_t __fs);