110-glibc-change-work-around.patch 4.2 KB

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