shithub: sox

Download patch

ref: a65561ef6694031d264354a50835ff556c16c9bc
parent: 55f7d6f8841f97d21f630a5e97b774ac35b4bd05
author: cbagwell <cbagwell>
date: Tue Jul 1 15:16:39 EDT 2008

Work around platforms (solaris) that are mapping "tell" to "tell64".

--- a/src/formats_i.c
+++ b/src/formats_i.c
@@ -100,7 +100,7 @@
   size_t ret = fread(buf, 1, len, ft->fp);
   if (ret != len && ferror(ft->fp))
     lsx_fail_errno(ft, errno, "lsx_readbuf");
-  ft->tell += ret;
+  ft->tell_off += ret;
   return ret;
 }
 
@@ -136,7 +136,7 @@
     lsx_fail_errno(ft, errno, "error writing output file");
     clearerr(ft->fp); /* Allows us to seek back to write header */
   }
-  ft->tell += ret;
+  ft->tell_off += ret;
   return ret;
 }
 
@@ -155,7 +155,7 @@
 
 sox_ssize_t lsx_tell(sox_format_t * ft)
 {
-  return ft->seekable? (sox_ssize_t)ftello(ft->fp) : ft->tell;
+  return ft->seekable? (sox_ssize_t)ftello(ft->fp) : ft->tell_off;
 }
 
 int lsx_eof(sox_format_t * ft)
@@ -197,7 +197,7 @@
             while (offset > 0 && !feof(ft->fp)) {
                 getc(ft->fp);
                 offset--;
-                ++ft->tell;
+                ++ft->tell_off;
             }
             if (offset)
                 lsx_fail_errno(ft,SOX_EOF, "offset past EOF");
--- a/src/sox.h
+++ b/src/sox.h
@@ -369,7 +369,7 @@
   int              sox_errno;       /* Failure error code */
   char             sox_errstr[256]; /* Failure error text */
   FILE             * fp;            /* File stream pointer */
-  long             tell;
+  long             tell_off;
   long             data_start;
   sox_format_handler_t handler;     /* Format handler for this file */
   void             * priv;          /* Format handler's private data area */