2013-10-02 16:21:27 +02:00
|
|
|
$NetBSD: patch-ak,v 1.3 2013/10/02 14:21:27 drochner Exp $
|
2010-12-27 06:32:49 +01:00
|
|
|
|
|
|
|
* On DragonFly, FILE is hidden, only allowed to modify in __FILE_public.
|
|
|
|
|
2012-12-18 15:42:29 +01:00
|
|
|
* Disable file-type pipe detection on 64-bit Solaris.
|
|
|
|
|
2013-10-02 16:21:27 +02:00
|
|
|
--- src/formats.c.orig 2013-01-13 19:57:39.000000000 +0000
|
|
|
|
+++ src/formats.c
|
|
|
|
@@ -407,17 +407,22 @@ static void UNUSED rewind_pipe(FILE * fp
|
2010-12-27 06:32:49 +01:00
|
|
|
/* _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__
|
|
|
|
+# ifdef __DragonFly__
|
|
|
|
+ struct __FILE_public *fpp = (struct __FILE_public *)fp;
|
|
|
|
+ fpp->_p -= AUTO_DETECT_SIZE;
|
|
|
|
+ fpp->_r += AUTO_DETECT_SIZE;
|
|
|
|
+# else
|
2013-10-02 16:21:27 +02:00
|
|
|
fp->_p -= PIPE_AUTO_DETECT_SIZE;
|
|
|
|
fp->_r += PIPE_AUTO_DETECT_SIZE;
|
2010-12-27 06:32:49 +01:00
|
|
|
+# endif
|
|
|
|
#elif defined __GLIBC__
|
|
|
|
fp->_IO_read_ptr = fp->_IO_read_base;
|
2013-10-02 16:21:27 +02:00
|
|
|
-#elif defined _MSC_VER || defined _WIN32 || defined _WIN64 || defined _ISO_STDIO_ISO_H
|
|
|
|
+#elif defined _MSC_VER || defined _WIN32 || defined _WIN64 || (defined _ISO_STDIO_ISO_H && !(defined(__sun) && defined(_LP64)))
|
2012-12-18 15:42:29 +01:00
|
|
|
fp->_ptr = fp->_base;
|
|
|
|
#else
|
|
|
|
/* To fix this #error, either simply remove the #error line and live without
|
|
|
|
* file-type detection with pipes, or add support for your compiler in the
|
2013-10-02 16:21:27 +02:00
|
|
|
* lines above. Test with cat monkey.wav | ./sox --info - */
|
2012-12-18 15:42:29 +01:00
|
|
|
- #error FIX NEEDED HERE
|
|
|
|
#define NO_REWIND_PIPE
|
|
|
|
(void)fp;
|
|
|
|
#endif
|