shithub: sox

Download patch

ref: 1c7df4323ff2538a908466db763351240898e33b
parent: c4ea6bf365e1d627ed9cc7d88d770a1433d286af
author: Chris Bagwell <chris@cnpbagwell.com>
date: Tue Jul 10 04:10:46 EDT 2012

Don't use symbol names read/write.

Fixes incompatible redefinition error on mingw.

--- a/src/cvsd-fmt.c
+++ b/src/cvsd-fmt.c
@@ -68,7 +68,7 @@
     p->sample = max(p->step_mult * p->sample - p->step, SOX_SAMPLE_MIN);
 }
 
-static size_t read(sox_format_t * ft, sox_sample_t * buf, size_t len)
+static size_t cvsdread(sox_format_t * ft, sox_sample_t * buf, size_t len)
 {
   priv_t *p = (priv_t *) ft->priv;
   size_t i;
@@ -85,7 +85,7 @@
   return i;
 }
 
-static size_t write(sox_format_t * ft, sox_sample_t const * buf, size_t len)
+static size_t cvsdwrite(sox_format_t * ft, sox_sample_t const * buf, size_t len)
 {
   priv_t *p = (priv_t *) ft->priv;
   size_t i;
@@ -107,7 +107,7 @@
   static unsigned const write_encodings[] = {SOX_ENCODING_CVSD, 1, 0, 0};
   static sox_format_handler_t const handler = {SOX_LIB_VERSION_CODE,
     "Headerless Continuously Variable Slope Delta modulation (unfiltered)",
-    names, SOX_FILE_MONO, start, read, NULL, start, write, NULL,
+    names, SOX_FILE_MONO, start, cvsdread, NULL, start, cvsdwrite, NULL,
     lsx_rawseek, write_encodings, NULL, sizeof(priv_t)
   };
   return &handler;
--- a/src/waveaudio.c
+++ b/src/waveaudio.c
@@ -392,7 +392,7 @@
   return SOX_SUCCESS;
 }
 
-static size_t read(sox_format_t * ft, sox_sample_t* buf, size_t len)
+static size_t waveread(sox_format_t * ft, sox_sample_t* buf, size_t len)
 {
   size_t copied = 0;
   priv_t *priv = (priv_t*)ft->priv;
@@ -454,7 +454,7 @@
   return copied;
 }
 
-static size_t write(sox_format_t * ft, const sox_sample_t* buf, size_t len)
+static size_t wavewrite(sox_format_t * ft, const sox_sample_t* buf, size_t len)
 {
   size_t copied = 0;
   priv_t *priv = (priv_t*)ft->priv;
@@ -526,8 +526,8 @@
   static sox_format_handler_t const handler = {SOX_LIB_VERSION_CODE,
   "Windows Multimedia Audio", names,
   SOX_FILE_DEVICE | SOX_FILE_NOSTDIO,
-  start, read, stop,
-  start, write, stop,
+  start, waveread, stop,
+  start, wavewrite, stop,
   NULL, write_encodings, NULL, sizeof(priv_t)
   };
   return &handler;