You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

116 lines
4.9 KiB

  1. update for glibc libio.h removal in 2.28+
  2. see
  3. https://src.fedoraproject.org/rpms/m4/c/814d592134fad36df757f9a61422d164ea2c6c9b?branch=master
  4. Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=4af4a4a718]
  5. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  6. --- a/lib/fflush.c
  7. +++ b/lib/fflush.c
  8. @@ -33,7 +33,7 @@
  9. #undef fflush
  10. -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
  11. +#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
  12. /* Clear the stream's ungetc buffer, preserving the value of ftello (fp). */
  13. static void
  14. @@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp)
  15. #endif
  16. -#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
  17. +#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
  18. # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
  19. /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
  20. @@ -148,7 +148,7 @@ rpl_fflush (FILE *stream)
  21. if (stream == NULL || ! freading (stream))
  22. return fflush (stream);
  23. -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
  24. +#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
  25. clear_ungetc_buffer_preserving_position (stream);
  26. --- a/lib/fpending.c
  27. +++ b/lib/fpending.c
  28. @@ -32,7 +32,7 @@ __fpending (FILE *fp)
  29. /* Most systems provide FILE as a struct and the necessary bitmask in
  30. <stdio.h>, because they need it for implementing getc() and putc() as
  31. fast macros. */
  32. -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
  33. +#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
  34. return fp->_IO_write_ptr - fp->_IO_write_base;
  35. #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
  36. /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
  37. --- a/lib/fpurge.c
  38. +++ b/lib/fpurge.c
  39. @@ -62,7 +62,7 @@ fpurge (FILE *fp)
  40. /* Most systems provide FILE as a struct and the necessary bitmask in
  41. <stdio.h>, because they need it for implementing getc() and putc() as
  42. fast macros. */
  43. -# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
  44. +# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
  45. fp->_IO_read_end = fp->_IO_read_ptr;
  46. fp->_IO_write_ptr = fp->_IO_write_base;
  47. /* Avoid memory leak when there is an active ungetc buffer. */
  48. --- a/lib/freadahead.c
  49. +++ b/lib/freadahead.c
  50. @@ -25,7 +25,7 @@
  51. size_t
  52. freadahead (FILE *fp)
  53. {
  54. -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
  55. +#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
  56. if (fp->_IO_write_ptr > fp->_IO_write_base)
  57. return 0;
  58. return (fp->_IO_read_end - fp->_IO_read_ptr)
  59. --- a/lib/freading.c
  60. +++ b/lib/freading.c
  61. @@ -31,7 +31,7 @@ freading (FILE *fp)
  62. /* Most systems provide FILE as a struct and the necessary bitmask in
  63. <stdio.h>, because they need it for implementing getc() and putc() as
  64. fast macros. */
  65. -# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
  66. +# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
  67. return ((fp->_flags & _IO_NO_WRITES) != 0
  68. || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
  69. && fp->_IO_read_base != NULL));
  70. --- a/lib/fseeko.c
  71. +++ b/lib/fseeko.c
  72. @@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int when
  73. #endif
  74. /* These tests are based on fpurge.c. */
  75. -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
  76. +#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
  77. if (fp->_IO_read_end == fp->_IO_read_ptr
  78. && fp->_IO_write_ptr == fp->_IO_write_base
  79. && fp->_IO_save_base == NULL)
  80. @@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int when
  81. return -1;
  82. }
  83. -#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
  84. +#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
  85. fp->_flags &= ~_IO_EOF_SEEN;
  86. fp->_offset = pos;
  87. #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
  88. --- a/lib/stdio-impl.h
  89. +++ b/lib/stdio-impl.h
  90. @@ -18,6 +18,12 @@
  91. the same implementation of stdio extension API, except that some fields
  92. have different naming conventions, or their access requires some casts. */
  93. +/* Glibc 2.28 made _IO_IN_BACKUP private. For now, work around this
  94. + problem by defining it ourselves. FIXME: Do not rely on glibc
  95. + internals. */
  96. +#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
  97. +# define _IO_IN_BACKUP 0x100
  98. +#endif
  99. /* BSD stdio derived implementations. */