010-glibc-change-work-around.patch 4.9 KB

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