aboutsummaryrefslogtreecommitdiffstats
path: root/main/findutils/fix-gnulib-freadahead.patch
blob: adcfdd418643538804e1f2050b72efb0c78dc769 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
--- findutils-4.4.2.orig/gnulib/lib/freadahead.c
+++ findutils-4.4.2/gnulib/lib/freadahead.c
@@ -19,6 +19,7 @@
 /* Specification.  */
 #include "freadahead.h"
 
+#ifndef HAVE___FREADAHEAD
 size_t
 freadahead (FILE *fp)
 {
@@ -64,3 +65,4 @@
  #error "Please port gnulib freadahead.c to your platform! Look at the definition of fflush, fread on your system, then report this to bug-gnulib."
 #endif
 }
+#endif
--- findutils-4.4.2.orig/gnulib/lib/freadahead.h
+++ findutils-4.4.2/gnulib/lib/freadahead.h
@@ -29,7 +29,20 @@
 
    STREAM must not be wide-character oriented.  */
 
+#if HAVE___FREADAHEAD || (defined(__linux__) && !defined(__GLIBC__) && !defined(__UCLIBC__)) /* musl libc */
+
+#ifndef HAVE___FREADAHEAD
+#define HAVE___FREADAHEAD 1
+#endif
+
+# include <stdio_ext.h>
+# define freadahead(stream) __freadahead (stream)
+
+#else
+
 extern size_t freadahead (FILE *stream);
+
+#endif
 
 #ifdef __cplusplus
 }