shithub: sox

Download patch

ref: 93eed5cd3459c8c32cccf9aef8113bdca255221d
parent: d5d91e427bf11ce5e16fb882790ecd0db7d57334
author: cbagwell <cbagwell>
date: Mon Jun 30 16:51:45 EDT 2008

Support <gsm.h> path for external library.  Use unistd.h for off_t on at least OS2.

--- a/src/gsm.c
+++ b/src/gsm.c
@@ -28,7 +28,13 @@
 #include "sox_i.h"
 
 #ifdef EXTERNAL_GSM
+
+#ifdef HAVE_GSM_GSM_H
 #include <gsm/gsm.h>
+#else
+#include <gsm/gsm.h>
+#endif
+
 #else
 #include "../libgsm/gsm.h"
 #endif
--- a/src/sox_i.h
+++ b/src/sox_i.h
@@ -22,6 +22,10 @@
 typedef enum {SOX_WAVE_SINE, SOX_WAVE_TRIANGLE} lsx_wave_t;
 extern enum_item const lsx_wave_enum[];
 
+#ifdef HAVE_UNISTD_H
+#include <unistd.h> /* For off_t not found in stdio.h */
+#endif
+
 /* Define fseeko and ftello for platforms lacking them */
 #ifndef HAVE_FSEEKO
 #define fseeko fseek
--- a/src/wav.c
+++ b/src/wav.c
@@ -23,21 +23,27 @@
 #include "ima_rw.h"
 #include "adpcm.h"
 #ifdef EXTERNAL_GSM
+
+#ifdef HAVE_GSM_GSM_H
 #include <gsm/gsm.h>
 #else
+#include <gsm/gsm.h>
+#endif
+
+#else
 #include "../libgsm/gsm.h"
 #endif
 
-#define	WAVE_FORMAT_UNKNOWN		(0x0000U)
-#define	WAVE_FORMAT_PCM			(0x0001U)
-#define	WAVE_FORMAT_ADPCM		(0x0002U)
+#define WAVE_FORMAT_UNKNOWN             (0x0000U)
+#define WAVE_FORMAT_PCM                 (0x0001U)
+#define WAVE_FORMAT_ADPCM               (0x0002U)
 #define WAVE_FORMAT_IEEE_FLOAT          (0x0003U)
-#define	WAVE_FORMAT_ALAW		(0x0006U)
-#define	WAVE_FORMAT_MULAW		(0x0007U)
-#define	WAVE_FORMAT_OKI_ADPCM		(0x0010U)
-#define WAVE_FORMAT_IMA_ADPCM		(0x0011U)
-#define	WAVE_FORMAT_DIGISTD		(0x0015U)
-#define	WAVE_FORMAT_DIGIFIX		(0x0016U)
+#define WAVE_FORMAT_ALAW                (0x0006U)
+#define WAVE_FORMAT_MULAW               (0x0007U)
+#define WAVE_FORMAT_OKI_ADPCM           (0x0010U)
+#define WAVE_FORMAT_IMA_ADPCM           (0x0011U)
+#define WAVE_FORMAT_DIGISTD             (0x0015U)
+#define WAVE_FORMAT_DIGIFIX             (0x0016U)
 #define WAVE_FORMAT_DOLBY_AC2           (0x0030U)
 #define WAVE_FORMAT_GSM610              (0x0031U)
 #define WAVE_FORMAT_ROCKWELL_ADPCM      (0x003bU)