summaryrefslogtreecommitdiff
path: root/lib/fseterr.h
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2012-06-19 23:35:08 +0200
committerBruno Haible <bruno@clisp.org>2012-06-19 23:35:08 +0200
commit2b14f42b44f04bce5631269ed46cd8be2413ccec (patch)
tree429bada82d83dc604d674a02cb621cb00494a3e8 /lib/fseterr.h
parent81c71120400c0f49c1429bf4b5d5ad89c151123a (diff)
downloadgnulib-2b14f42b44f04bce5631269ed46cd8be2413ccec.tar.gz
stdioext: Add support for musl libc.
* m4/fbufmode.m4 (gl_FUNC_FBUFMODE): Test whether __fbufsize exists. * lib/fbufmode.c (fbufmode): Add conditional code for musl. * m4/fseterr.m4: New file. * lib/fseterr.h (fseterr): Define as an alias of __fseterr if that function exists. * modules/fseterr (Files): Add m4/fseterr.m4. (configure.ac): Invoke gl_FUNC_FSETERR. Compile fseterr.c if __fseterr does not exist. (Makefile.am): Remove fseterr.c from lib_SOURCES. * lib/freadable.h: Update comment. * lib/fwritable.h: Update comment. * lib/freading.h: Update comment. * lib/fwriting.h: Update comment. * m4/freadahead.m4: New file. * lib/freadahead.h (freadahead): Define as an alias of __freadahead if that function exists. * modules/freadahead (Files): Add m4/freadahead.m4. (configure.ac): Invoke gl_FUNC_FREADAHEAD. Compile freadahead.c if __freadahead does not exist. (Makefile.am): Remove freadahead.c from lib_SOURCES. * m4/freadptr.m4: New file. * lib/freadptr.h (freadptr): Define as an alias of __freadptr if that function exists. * modules/freadptr (Files): Add m4/freadptr.m4. (configure.ac): Invoke gl_FUNC_FREADPTR. Compile freadptr.c if __freadptr does not exist. (Makefile.am): Remove freadptr.c from lib_SOURCES. * m4/freadseek.m4: New file. * lib/freadseek.c (freadptrinc): Use __freadptrinc if that function exists. * modules/freadseek (Files): Add m4/freadseek.m4. (configure.ac): Invoke gl_FUNC_FREADSEEK. * lib/fpurge.c (fpurge): Update comment. Reported by and with help from Rich Felker <dalias@aerifal.cx>.
Diffstat (limited to 'lib/fseterr.h')
-rw-r--r--lib/fseterr.h22
1 files changed, 15 insertions, 7 deletions
diff --git a/lib/fseterr.h b/lib/fseterr.h
index b3930c5a88..16a1afeeae 100644
--- a/lib/fseterr.h
+++ b/lib/fseterr.h
@@ -19,19 +19,27 @@
#include <stdio.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
/* Set the error indicator of the stream FP.
The "error indicator" is set when an I/O operation on the stream fails, and
is cleared (together with the "end-of-file" indicator) by clearerr (FP). */
-extern void fseterr (FILE *fp);
+#if HAVE___FSETERR /* musl libc */
+
+# include <stdio_ext.h>
+# define fseterr(fp) __fseterr (fp)
-#ifdef __cplusplus
+#else
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+extern void fseterr (FILE *fp);
+
+# ifdef __cplusplus
}
+# endif
+
#endif
#endif /* _FSETERR_H */