ref: c7405147a011a2a6f127d08715caef9ee1a49f22
parent: 6469c0fd871e539b9fe6e7332710c7cb4c34ec7f
author: robs <robs>
date: Wed Sep 9 15:01:37 EDT 2009
pipe seek support for FreeBSD
--- a/ChangeLog
+++ b/ChangeLog
@@ -50,6 +50,8 @@
o Fix build so that grouped files (e.g. play -r 6k "*.vox" plays all
at 6k) works. (robs)
+ o Fix build to support auto file type detection with pipes on FreeBSD
+ and elsewhere. (Dan Nelson)
o Fix simultaneous play & rec not working. (robs)
o Fix multi-threading bug on Windows OS; also, change default to
single-threaded.
--- a/src/formats.c
+++ b/src/formats.c
@@ -393,7 +393,9 @@
* Works by resetting the FILE buffer pointer */
static void UNUSED rewind_pipe(FILE * fp)
{
-#if defined _NEWLIB_VERSION || defined __APPLE__
+/* _FSTDIO is for Torek stdio (i.e. most BSD-derived libc's)
+ * In theory, we no longer need to check _NEWLIB_VERSION or __APPLE__ */
+#if defined _FSTDIO || defined _NEWLIB_VERSION || defined __APPLE__
fp->_p -= AUTO_DETECT_SIZE;
fp->_r += AUTO_DETECT_SIZE;
#elif defined __GLIBC__