patch-lib_freadahead_h 846 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. --- m4-1.4.16.orig/lib/freadahead.h 2011-03-01 17:39:27.000000000 +0100
  2. +++ m4-1.4.16/lib/freadahead.h 2013-09-04 13:59:50.000000000 +0200
  3. @@ -17,9 +17,6 @@
  4. #include <stddef.h>
  5. #include <stdio.h>
  6. -#ifdef __cplusplus
  7. -extern "C" {
  8. -#endif
  9. /* Assuming the stream STREAM is open for reading:
  10. Return the number of bytes waiting in the input buffer of STREAM.
  11. @@ -31,8 +28,25 @@ extern "C" {
  12. STREAM must not be wide-character oriented. */
  13. +
  14. +#if HAVE___FREADAHEAD || (defined(__linux__) && !defined(__GLIBC__) && !defined(__UCLIBC__)) /* musl libc */
  15. +#ifndef HAVE___FREADAHEAD
  16. +#define HAVE___FREADAHEAD 1
  17. +#endif
  18. +
  19. +#include <stdio_ext.h>
  20. +#define freadahead(stream) __freadahead (stream)
  21. +
  22. +#else
  23. +
  24. +#ifdef __cplusplus
  25. +extern "C" {
  26. +#endif
  27. +
  28. extern size_t freadahead (FILE *stream);
  29. #ifdef __cplusplus
  30. }
  31. #endif
  32. +
  33. +#endif