2010-05-19 Brian Cameron <[email protected]>
authoryippi
Thu, 19 May 2011 22:26:31 +0000
changeset 3452 2b072a2721ff
parent 3451 8f7fd97fc389
child 3453 ed42f26ab39c
2010-05-19 Brian Cameron <[email protected]> * SFEaudacity.spec: Bump to 1.3.13. * patches/audacity-audacity-01-fixsed.diff: Remove patch no longer needed. * patches/audacity-05-header.diff, patches/audacity-06-error-dialog.diff: Add patches needed to build. * SFElibsndfile.spec, patches/libsndfile-01-common.diff: Fix spec and patches so it builds. * patches/libsndfile-01-flac-1.1.3.diff: Remove unused patch. * SFEgnet.spec: Bump to 2.0.8.
ChangeLog
SFEaudacity.spec
SFEgnet.spec
SFElibsndfile.spec
patches/audacity-01-addgtklibs.diff
patches/audacity-01-fixsed.diff
patches/audacity-02-addgtklibs.diff
patches/audacity-02-nyquist.diff
patches/audacity-03-nyquist.diff
patches/audacity-03-portaudio.diff
patches/audacity-04-memorybarrier.diff
patches/audacity-04-portaudio.diff
patches/audacity-05-header.diff
patches/audacity-05-memorybarrier.diff
patches/audacity-06-error-dialog.diff
patches/libsndfile-01-common.diff
patches/libsndfile-01-flac-1.1.3.diff
--- a/ChangeLog	Thu May 19 09:25:39 2011 +0000
+++ b/ChangeLog	Thu May 19 22:26:31 2011 +0000
@@ -1,3 +1,15 @@
+2010-05-19  Brian Cameron  <[email protected]>
+
+	* SFEaudacity.spec: Bump to 1.3.13.
+	* patches/audacity-audacity-01-fixsed.diff: Remove patch no longer
+	  needed.
+	* patches/audacity-05-header.diff,
+	  patches/audacity-06-error-dialog.diff: Add patches needed to build.
+	* SFElibsndfile.spec, patches/libsndfile-01-common.diff: Fix spec
+	  and patches so it builds.
+	* patches/libsndfile-01-flac-1.1.3.diff: Remove unused patch.
+	* SFEgnet.spec: Bump to 2.0.8.
+
 2011-05-14  N.B.Prashanth  <[email protected]>
 
 	* SFEvala.spec: bump to 0.12.0
--- a/SFEaudacity.spec	Thu May 19 09:25:39 2011 +0000
+++ b/SFEaudacity.spec	Thu May 19 22:26:31 2011 +0000
@@ -20,15 +20,15 @@
 
 Name:                SFEaudacity
 Summary:             Free, Cross-Platform Sound Editor
-Version:             1.3.12
+Version:             1.3.13
 Source:              http://audacity.googlecode.com/files/%{src_name}-minsrc-%{version}-beta.tar.bz2
-# bug 1910685/
-Patch1:              audacity-01-fixsed.diff
 # bug 1910699
-Patch2:              audacity-02-addgtklibs.diff
-Patch3:              audacity-03-nyquist.diff
-Patch4:              audacity-04-portaudio.diff
-Patch5:              audacity-05-memorybarrier.diff
+Patch1:              audacity-01-addgtklibs.diff
+Patch2:              audacity-02-nyquist.diff
+Patch3:              audacity-03-portaudio.diff
+Patch4:              audacity-04-memorybarrier.diff
+Patch5:              audacity-05-header.diff
+Patch6:              audacity-06-error-dialog.diff
 SUNW_BaseDir:        %{_basedir}
 BuildRoot:           %{_tmppath}/%{name}-%{version}-build
 %include default-depend.inc
@@ -39,6 +39,8 @@
 Requires: SFEladspa
 BuildRequires: SFEsoundtouch-devel
 Requires: SFEsoundtouch
+BuildRequires: SFElibsndfile-devel
+Requires: SFElibsndfile
 BuildRequires: SUNWaudh
 BuildRequires: SUNWgnu-findutils
 
@@ -100,6 +102,7 @@
 %patch3 -p1
 %patch4 -p1
 %patch5 -p1
+%patch6 -p1
 
 %build
 CPUS=`/usr/sbin/psrinfo | grep on-line | wc -l | tr -d ' '`
@@ -267,6 +270,8 @@
 %endif
 
 %changelog
+* Wed May 19 2011 - Brian Cameron
+- Bump to 1.3.13.
 * Tue Apr 27 2010 - Brian Cameron
 - Bump to 1.3.12.
 * Fri Jan 29 2010 - Brian Cameron
--- a/SFEgnet.spec	Thu May 19 09:25:39 2011 +0000
+++ b/SFEgnet.spec	Thu May 19 22:26:31 2011 +0000
@@ -6,11 +6,11 @@
 %include Solaris.inc
 
 %define	src_name gnet
-%define	src_url	http://www.gnetlibrary.org/src
+%define	src_url	http://download.gnome.org/sources/gnet/2.0
 
 Name:                SFEgnet
 Summary:             Simple network library
-Version:             2.0.7
+Version:             2.0.8
 Source:              %{src_url}/%{src_name}-%{version}.tar.gz
 SUNW_BaseDir:        %{_basedir}
 BuildRoot:           %{_tmppath}/%{name}-%{version}-build
@@ -77,5 +77,7 @@
 %{_libdir}/pkgconfig/*
 
 %changelog
+* Thu Apr 14 2011 - [email protected]
+- Bump to 2.0.8.
 * Fri Jul 27 2007 - [email protected]
 - Initial spec
--- a/SFElibsndfile.spec	Thu May 19 09:25:39 2011 +0000
+++ b/SFElibsndfile.spec	Thu May 19 22:26:31 2011 +0000
@@ -74,10 +74,13 @@
 %{_bindir}/sndfile-info
 %{_bindir}/sndfile-play
 %{_bindir}/sndfile-regtest
-%{_bindir}/sndfile-jackplay
 %{_bindir}/sndfile-cmp
 %{_bindir}/sndfile-metadata-set
 %{_bindir}/sndfile-metadata-get
+%{_bindir}/sndfile-interleave
+%{_bindir}/sndfile-salvage
+%{_bindir}/sndfile-concat
+%{_bindir}/sndfile-deinterleave
 %dir %attr (0755, root, bin) %{_libdir}
 %{_libdir}/lib*.so*
 %dir %attr (0755, root, sys) %{_datadir}
@@ -91,10 +94,13 @@
 %{_bindir}/%{_arch64}/sndfile-info
 %{_bindir}/%{_arch64}/sndfile-play
 %{_bindir}/%{_arch64}/sndfile-regtest
-%{_bindir}/%{_arch64}/sndfile-jackplay
 %{_bindir}/%{_arch64}/sndfile-cmp
 %{_bindir}/%{_arch64}/sndfile-metadata-set
 %{_bindir}/%{_arch64}/sndfile-metadata-get
+%{_bindir}/%{_arch64}/sndfile-interleave
+%{_bindir}/%{_arch64}/sndfile-salvage
+%{_bindir}/%{_arch64}/sndfile-concat
+%{_bindir}/%{_arch64}/sndfile-deinterleave
 %dir %attr (0755, root, bin) %{_libdir}/%{_arch64}
 %{_libdir}/%{_arch64}/lib*.so*
 %endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/audacity-01-addgtklibs.diff	Thu May 19 22:26:31 2011 +0000
@@ -0,0 +1,12 @@
+--- audacity-src-1.3.5-beta/src/Makefile.in-orig	2008-05-12 17:30:16.132711000 -0500
++++ audacity-src-1.3.5-beta/src/Makefile.in	2008-05-12 17:30:30.874247000 -0500
+@@ -234,7 +234,8 @@ libaudacity.a: $(LIBAUDACITY_OBJS)
+ 	ar rcs libaudacity.a $(LIBAUDACITY_OBJS)
+ 
+ ../audacity: $(OBJS) $(LOCAL_LIBS:%=$(top_builddir)/lib-src/%) $(EXTRAOBJS) libaudacity.a Makefile
+-	$(CCC) -o ../audacity $(OBJS) $(LDFLAGS) $(LOCAL_LIBS:%=$(top_builddir)/lib-src/%) $(EXTRAOBJS) libaudacity.a $(LIBS)
++	$(CCC) -o ../audacity $(OBJS) $(LDFLAGS) $(LOCAL_LIBS:%=$(top_builddir)/lib-src/%) $(EXTRAOBJS) libaudacity.a $(LIBS) `pkg-config --libs gtk+-2.0`
++
+ 	@AFTERBUILD@
+ 
+ $(DIRS):
--- a/patches/audacity-01-fixsed.diff	Thu May 19 09:25:39 2011 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
---- audacity-src-1.3.3-beta/configure.in-orig	2008-03-08 14:59:38.158834000 -0600
-+++ audacity-src-1.3.3-beta/configure.in	2008-03-08 14:59:49.906195000 -0600
-@@ -664,7 +664,8 @@ dnl Substitute any addition libraries th
- dnl
- pa_libs=
- pa_libs=`grep 'Libs:' lib-src/portaudio-v19/portaudio-2.0.pc | sed -e 's/Libs://;s/-L${libdir}//;s/-lportaudio//'`
--sed -i -e "s/@PA_LIBS@/$pa_libs/" src/Makefile
-+sed -e "s/@PA_LIBS@/$pa_libs/" src/Makefile >/tmp/m$$
-+mv -f /tmp/m$$ src/Makefile
- 
- echo ""
- echo "Finished configure:"
--- a/patches/audacity-02-addgtklibs.diff	Thu May 19 09:25:39 2011 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
---- audacity-src-1.3.5-beta/src/Makefile.in-orig	2008-05-12 17:30:16.132711000 -0500
-+++ audacity-src-1.3.5-beta/src/Makefile.in	2008-05-12 17:30:30.874247000 -0500
-@@ -234,7 +234,8 @@ libaudacity.a: $(LIBAUDACITY_OBJS)
- 	ar rcs libaudacity.a $(LIBAUDACITY_OBJS)
- 
- ../audacity: $(OBJS) $(LOCAL_LIBS:%=$(top_builddir)/lib-src/%) $(EXTRAOBJS) libaudacity.a Makefile
--	$(CCC) -o ../audacity $(OBJS) $(LDFLAGS) $(LOCAL_LIBS:%=$(top_builddir)/lib-src/%) $(EXTRAOBJS) libaudacity.a $(LIBS)
-+	$(CCC) -o ../audacity $(OBJS) $(LDFLAGS) $(LOCAL_LIBS:%=$(top_builddir)/lib-src/%) $(EXTRAOBJS) libaudacity.a $(LIBS) `pkg-config --libs gtk+-2.0`
-+
- 	@AFTERBUILD@
- 
- $(DIRS):
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/audacity-02-nyquist.diff	Thu May 19 22:26:31 2011 +0000
@@ -0,0 +1,296 @@
+--- audacity-src-1.3.8/lib-src/libnyquist/nyquist/xlisp/xlisp.h-orig	2009-08-05 18:37:53.578806000 -0500
++++ audacity-src-1.3.8/lib-src/libnyquist/nyquist/xlisp/xlisp.h	2009-08-05 18:39:32.071189000 -0500
+@@ -168,6 +168,14 @@ extern long ptrtoabs();
+ #endif
+ #endif
+ 
++#ifdef __sun
++#if defined (__LITTLE_ENDIAN)
++#define XL_LITTLE_ENDIAN
++#else
++#define XL_BIG_ENDIAN
++#endif
++#endif
++
+ /* default important definitions */
+ #ifndef NNODES
+ #define NNODES		1000
+--- audacity-src-1.3.8/lib-src/libnyquist/nyquist/ffts/src/fftlib.c-orig	2009-08-05 18:55:54.598312000 -0500
++++ audacity-src-1.3.8/lib-src/libnyquist/nyquist/ffts/src/fftlib.c	2009-08-05 18:58:59.934702000 -0500
+@@ -61,8 +61,8 @@ for (i1 = 0; i1 < Nroot_1; i1++){
+ parts of ffts1
+ *************************************************/
+ 
+-inline void bitrevR2(float *ioptr, long M, short *BRLow);
+-inline void bitrevR2(float *ioptr, long M, short *BRLow){
++static inline void bitrevR2(float *ioptr, long M, short *BRLow);
++static inline void bitrevR2(float *ioptr, long M, short *BRLow){
+ /*** bit reverse and first radix 2 stage of forward or inverse fft ***/
+ float	f0r;
+ float	f0i;
+@@ -198,8 +198,8 @@ for (; ioptr < iolimit; ioptr += POW2(M/
+ };
+ }
+ 
+-inline void fft2pt(float *ioptr);
+-inline void fft2pt(float *ioptr){
++static inline void fft2pt(float *ioptr);
++static inline void fft2pt(float *ioptr){
+ /***   RADIX 2 fft	***/
+ float f0r, f0i, f1r, f1i;
+ float t0r, t0i;
+@@ -229,8 +229,8 @@ ioptr[3] = f1i;
+ }
+ 
+ 
+-inline void fft4pt(float *ioptr);
+-inline void fft4pt(float *ioptr){
++static inline void fft4pt(float *ioptr);
++static inline void fft4pt(float *ioptr){
+ /***   RADIX 4 fft	***/
+ float f0r, f0i, f1r, f1i, f2r, f2i, f3r, f3i;
+ float t0r, t0i, t1r, t1i;
+@@ -284,8 +284,8 @@ ioptr[6] = f3r;
+ ioptr[7] = f3i;
+ }
+ 
+-inline void fft8pt(float *ioptr);
+-inline void fft8pt(float *ioptr){
++static inline void fft8pt(float *ioptr);
++static inline void fft8pt(float *ioptr){
+ /***   RADIX 8 fft	***/
+ float w0r = 1.0/MYROOT2; /* cos(pi/4)	*/
+ float f0r, f0i, f1r, f1i, f2r, f2i, f3r, f3i;
+@@ -403,8 +403,8 @@ ioptr[14] = f6r;
+ ioptr[15] = f6i;
+ }
+ 
+-inline void bfR2(float *ioptr, long M, long NDiffU);
+-inline void bfR2(float *ioptr, long M, long NDiffU){
++static inline void bfR2(float *ioptr, long M, long NDiffU);
++static inline void bfR2(float *ioptr, long M, long NDiffU){
+ /*** 2nd radix 2 stage ***/
+ unsigned long	pos;
+ unsigned long	posi;
+@@ -512,8 +512,8 @@ for (SameUCnt = NSameU; SameUCnt > 0 ; S
+ }
+ }
+ 
+-inline void bfR4(float *ioptr, long M, long NDiffU);
+-inline void bfR4(float *ioptr, long M, long NDiffU){
++static inline void bfR4(float *ioptr, long M, long NDiffU);
++static inline void bfR4(float *ioptr, long M, long NDiffU){
+ /*** 1 radix 4 stage ***/
+ unsigned long	pos;
+ unsigned long	posi;
+@@ -721,8 +721,8 @@ f4i = f4i * Two - f6i;
+ 
+ }
+ 
+-inline void bfstages(float *ioptr, long M, float *Utbl, long Ustride, long NDiffU, long StageCnt);
+-inline void bfstages(float *ioptr, long M, float *Utbl, long Ustride, long NDiffU, long StageCnt){
++static inline void bfstages(float *ioptr, long M, float *Utbl, long Ustride, long NDiffU, long StageCnt);
++static inline void bfstages(float *ioptr, long M, float *Utbl, long Ustride, long NDiffU, long StageCnt){
+ /***   RADIX 8 Stages	***/
+ unsigned long	pos;
+ unsigned long	posi;
+@@ -1125,8 +1125,8 @@ default:
+ parts of iffts1
+ *************************************************/
+ 
+-inline void scbitrevR2(float *ioptr, long M, short *BRLow, float scale);
+-inline void scbitrevR2(float *ioptr, long M, short *BRLow, float scale){
++static inline void scbitrevR2(float *ioptr, long M, short *BRLow, float scale);
++static inline void scbitrevR2(float *ioptr, long M, short *BRLow, float scale){
+ /*** scaled bit reverse and first radix 2 stage forward or inverse fft ***/
+ float	f0r;
+ float	f0i;
+@@ -1262,8 +1262,8 @@ for (; ioptr < iolimit; ioptr += POW2(M/
+ };
+ }
+ 
+-inline void ifft2pt(float *ioptr, float scale);
+-inline void ifft2pt(float *ioptr, float scale){
++static inline void ifft2pt(float *ioptr, float scale);
++static inline void ifft2pt(float *ioptr, float scale){
+ /***   RADIX 2 ifft	***/
+ float f0r, f0i, f1r, f1i;
+ float t0r, t0i;
+@@ -1292,8 +1292,8 @@ ioptr[2] = scale*f1r;
+ ioptr[3] = scale*f1i;
+ }
+ 
+-inline void ifft4pt(float *ioptr, float scale);
+-inline void ifft4pt(float *ioptr, float scale){
++static inline void ifft4pt(float *ioptr, float scale);
++static inline void ifft4pt(float *ioptr, float scale){
+ /***   RADIX 4 ifft	***/
+ float f0r, f0i, f1r, f1i, f2r, f2i, f3r, f3i;
+ float t0r, t0i, t1r, t1i;
+@@ -1347,8 +1347,8 @@ ioptr[6] = scale*f3r;
+ ioptr[7] = scale*f3i;
+ }
+ 
+-inline void ifft8pt(float *ioptr, float scale);
+-inline void ifft8pt(float *ioptr, float scale){
++static inline void ifft8pt(float *ioptr, float scale);
++static inline void ifft8pt(float *ioptr, float scale){
+ /***   RADIX 8 ifft	***/
+ float w0r = 1.0/MYROOT2; /* cos(pi/4)	*/
+ float f0r, f0i, f1r, f1i, f2r, f2i, f3r, f3i;
+@@ -1467,8 +1467,8 @@ ioptr[14] = scale*f6r;
+ ioptr[15] = scale*f6i;
+ }
+ 
+-inline void ibfR2(float *ioptr, long M, long NDiffU);
+-inline void ibfR2(float *ioptr, long M, long NDiffU){
++static inline void ibfR2(float *ioptr, long M, long NDiffU);
++static inline void ibfR2(float *ioptr, long M, long NDiffU){
+ /*** 2nd radix 2 stage ***/
+ unsigned long	pos;
+ unsigned long	posi;
+@@ -1576,8 +1576,8 @@ for (SameUCnt = NSameU; SameUCnt > 0 ; S
+ }
+ }
+ 
+-inline void ibfR4(float *ioptr, long M, long NDiffU);
+-inline void ibfR4(float *ioptr, long M, long NDiffU){
++static inline void ibfR4(float *ioptr, long M, long NDiffU);
++static inline void ibfR4(float *ioptr, long M, long NDiffU){
+ /*** 1 radix 4 stage ***/
+ unsigned long	pos;
+ unsigned long	posi;
+@@ -1785,8 +1785,8 @@ f4i = f4i * Two - f6i;
+ 
+ }
+ 
+-inline void ibfstages(float *ioptr, long M, float *Utbl, long Ustride, long NDiffU, long StageCnt);
+-inline void ibfstages(float *ioptr, long M, float *Utbl, long Ustride, long NDiffU, long StageCnt){
++static inline void ibfstages(float *ioptr, long M, float *Utbl, long Ustride, long NDiffU, long StageCnt);
++static inline void ibfstages(float *ioptr, long M, float *Utbl, long Ustride, long NDiffU, long StageCnt){
+ /***   RADIX 8 Stages	***/
+ unsigned long	pos;
+ unsigned long	posi;
+@@ -2193,8 +2193,8 @@ default:
+ parts of rffts1
+ *************************************************/
+ 
+-inline void rfft1pt(float *ioptr);
+-inline void rfft1pt(float *ioptr){
++static inline void rfft1pt(float *ioptr);
++static inline void rfft1pt(float *ioptr){
+ /***   RADIX 2 rfft	***/
+ float f0r, f0i;
+ float t0r, t0i;
+@@ -2212,8 +2212,8 @@ ioptr[0] = t0r;
+ ioptr[1] = t0i;
+ }
+ 
+-inline void rfft2pt(float *ioptr);
+-inline void rfft2pt(float *ioptr){
++static inline void rfft2pt(float *ioptr);
++static inline void rfft2pt(float *ioptr){
+ /***   RADIX 4 rfft	***/
+ float f0r, f0i, f1r, f1i;
+ float t0r, t0i;
+@@ -2245,8 +2245,8 @@ ioptr[2] = f1r;
+ ioptr[3] = f1i;
+ }
+ 
+-inline void rfft4pt(float *ioptr);
+-inline void rfft4pt(float *ioptr){
++static inline void rfft4pt(float *ioptr);
++static inline void rfft4pt(float *ioptr){
+ /***   RADIX 8 rfft	***/
+ float f0r, f0i, f1r, f1i, f2r, f2i, f3r, f3i;
+ float t0r, t0i, t1r, t1i;
+@@ -2318,8 +2318,8 @@ ioptr[6] = scale*f3r;
+ ioptr[7] = scale*f3i;
+ }
+ 
+-inline void rfft8pt(float *ioptr);
+-inline void rfft8pt(float *ioptr){
++static inline void rfft8pt(float *ioptr);
++static inline void rfft8pt(float *ioptr){
+ /***   RADIX 16 rfft	***/
+ float w0r = 1.0/MYROOT2; /* cos(pi/4)	*/
+ float w1r = MYCOSPID8; /* cos(pi/8)	*/
+@@ -2477,8 +2477,8 @@ ioptr[14] = scale*f6r;
+ ioptr[15] = scale*f6i;
+ }
+ 
+-inline void frstage(float *ioptr, long M, float *Utbl);
+-inline void frstage(float *ioptr, long M, float *Utbl){
++static inline void frstage(float *ioptr, long M, float *Utbl);
++static inline void frstage(float *ioptr, long M, float *Utbl){
+ /*	Finish RFFT		*/
+ 
+ unsigned long 	pos;
+@@ -2687,8 +2687,8 @@ default:
+ parts of riffts1
+ *************************************************/
+ 
+-inline void rifft1pt(float *ioptr, float scale);
+-inline void rifft1pt(float *ioptr, float scale){
++static inline void rifft1pt(float *ioptr, float scale);
++static inline void rifft1pt(float *ioptr, float scale){
+ /***   RADIX 2 rifft	***/
+ float f0r, f0i;
+ float t0r, t0i;
+@@ -2706,8 +2706,8 @@ ioptr[0] = scale*t0r;
+ ioptr[1] = scale*t0i;
+ }
+ 
+-inline void rifft2pt(float *ioptr, float scale);
+-inline void rifft2pt(float *ioptr, float scale){
++static inline void rifft2pt(float *ioptr, float scale);
++static inline void rifft2pt(float *ioptr, float scale){
+ /***   RADIX 4 rifft	***/
+ float f0r, f0i, f1r, f1i;
+ float t0r, t0i;
+@@ -2740,8 +2740,8 @@ ioptr[2] = scale*f1r;
+ ioptr[3] = scale*f1i;
+ }
+ 
+-inline void rifft4pt(float *ioptr, float scale);
+-inline void rifft4pt(float *ioptr, float scale){
++static inline void rifft4pt(float *ioptr, float scale);
++static inline void rifft4pt(float *ioptr, float scale){
+ /***   RADIX 8 rifft	***/
+ float f0r, f0i, f1r, f1i, f2r, f2i, f3r, f3i;
+ float t0r, t0i, t1r, t1i;
+@@ -2811,8 +2811,8 @@ ioptr[6] = scale*f3r;
+ ioptr[7] = scale*f3i;
+ }
+ 
+-inline void rifft8pt(float *ioptr, float scale);
+-inline void rifft8pt(float *ioptr, float scale){
++static inline void rifft8pt(float *ioptr, float scale);
++static inline void rifft8pt(float *ioptr, float scale){
+ /***   RADIX 16 rifft	***/
+ float w0r = 1.0/MYROOT2; /* cos(pi/4)	*/
+ float w1r = MYCOSPID8; /* cos(pi/8)	*/
+@@ -2968,8 +2968,8 @@ ioptr[14] = scale*f6r;
+ ioptr[15] = scale*f6i;
+ }
+ 
+-inline void ifrstage(float *ioptr, long M, float *Utbl);
+-inline void ifrstage(float *ioptr, long M, float *Utbl){
++static inline void ifrstage(float *ioptr, long M, float *Utbl);
++static inline void ifrstage(float *ioptr, long M, float *Utbl){
+ /*	Start RIFFT		*/
+ 
+ unsigned long 	pos;
+--- audacity-src-1.3.8/lib-src/libnyquist/nyquist/xlisp/xldmem.c-orig	2009-08-05 19:00:47.193313000 -0500
++++ audacity-src-1.3.8/lib-src/libnyquist/nyquist/xlisp/xldmem.c	2009-08-05 19:04:25.638858000 -0500
+@@ -17,6 +17,10 @@
+ #include "string.h"
+ #include "xlisp.h"
+ 
++#ifdef __sun
++#include "alloca.h"
++#endif
++
+ #ifdef WIN32
+ #include "malloc.h" // defines alloca()
+ #endif
--- a/patches/audacity-03-nyquist.diff	Thu May 19 09:25:39 2011 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,296 +0,0 @@
---- audacity-src-1.3.8/lib-src/libnyquist/nyquist/xlisp/xlisp.h-orig	2009-08-05 18:37:53.578806000 -0500
-+++ audacity-src-1.3.8/lib-src/libnyquist/nyquist/xlisp/xlisp.h	2009-08-05 18:39:32.071189000 -0500
-@@ -168,6 +168,14 @@ extern long ptrtoabs();
- #endif
- #endif
- 
-+#ifdef __sun
-+#if defined (__LITTLE_ENDIAN)
-+#define XL_LITTLE_ENDIAN
-+#else
-+#define XL_BIG_ENDIAN
-+#endif
-+#endif
-+
- /* default important definitions */
- #ifndef NNODES
- #define NNODES		1000
---- audacity-src-1.3.8/lib-src/libnyquist/nyquist/ffts/src/fftlib.c-orig	2009-08-05 18:55:54.598312000 -0500
-+++ audacity-src-1.3.8/lib-src/libnyquist/nyquist/ffts/src/fftlib.c	2009-08-05 18:58:59.934702000 -0500
-@@ -61,8 +61,8 @@ for (i1 = 0; i1 < Nroot_1; i1++){
- parts of ffts1
- *************************************************/
- 
--inline void bitrevR2(float *ioptr, long M, short *BRLow);
--inline void bitrevR2(float *ioptr, long M, short *BRLow){
-+static inline void bitrevR2(float *ioptr, long M, short *BRLow);
-+static inline void bitrevR2(float *ioptr, long M, short *BRLow){
- /*** bit reverse and first radix 2 stage of forward or inverse fft ***/
- float	f0r;
- float	f0i;
-@@ -198,8 +198,8 @@ for (; ioptr < iolimit; ioptr += POW2(M/
- };
- }
- 
--inline void fft2pt(float *ioptr);
--inline void fft2pt(float *ioptr){
-+static inline void fft2pt(float *ioptr);
-+static inline void fft2pt(float *ioptr){
- /***   RADIX 2 fft	***/
- float f0r, f0i, f1r, f1i;
- float t0r, t0i;
-@@ -229,8 +229,8 @@ ioptr[3] = f1i;
- }
- 
- 
--inline void fft4pt(float *ioptr);
--inline void fft4pt(float *ioptr){
-+static inline void fft4pt(float *ioptr);
-+static inline void fft4pt(float *ioptr){
- /***   RADIX 4 fft	***/
- float f0r, f0i, f1r, f1i, f2r, f2i, f3r, f3i;
- float t0r, t0i, t1r, t1i;
-@@ -284,8 +284,8 @@ ioptr[6] = f3r;
- ioptr[7] = f3i;
- }
- 
--inline void fft8pt(float *ioptr);
--inline void fft8pt(float *ioptr){
-+static inline void fft8pt(float *ioptr);
-+static inline void fft8pt(float *ioptr){
- /***   RADIX 8 fft	***/
- float w0r = 1.0/MYROOT2; /* cos(pi/4)	*/
- float f0r, f0i, f1r, f1i, f2r, f2i, f3r, f3i;
-@@ -403,8 +403,8 @@ ioptr[14] = f6r;
- ioptr[15] = f6i;
- }
- 
--inline void bfR2(float *ioptr, long M, long NDiffU);
--inline void bfR2(float *ioptr, long M, long NDiffU){
-+static inline void bfR2(float *ioptr, long M, long NDiffU);
-+static inline void bfR2(float *ioptr, long M, long NDiffU){
- /*** 2nd radix 2 stage ***/
- unsigned long	pos;
- unsigned long	posi;
-@@ -512,8 +512,8 @@ for (SameUCnt = NSameU; SameUCnt > 0 ; S
- }
- }
- 
--inline void bfR4(float *ioptr, long M, long NDiffU);
--inline void bfR4(float *ioptr, long M, long NDiffU){
-+static inline void bfR4(float *ioptr, long M, long NDiffU);
-+static inline void bfR4(float *ioptr, long M, long NDiffU){
- /*** 1 radix 4 stage ***/
- unsigned long	pos;
- unsigned long	posi;
-@@ -721,8 +721,8 @@ f4i = f4i * Two - f6i;
- 
- }
- 
--inline void bfstages(float *ioptr, long M, float *Utbl, long Ustride, long NDiffU, long StageCnt);
--inline void bfstages(float *ioptr, long M, float *Utbl, long Ustride, long NDiffU, long StageCnt){
-+static inline void bfstages(float *ioptr, long M, float *Utbl, long Ustride, long NDiffU, long StageCnt);
-+static inline void bfstages(float *ioptr, long M, float *Utbl, long Ustride, long NDiffU, long StageCnt){
- /***   RADIX 8 Stages	***/
- unsigned long	pos;
- unsigned long	posi;
-@@ -1125,8 +1125,8 @@ default:
- parts of iffts1
- *************************************************/
- 
--inline void scbitrevR2(float *ioptr, long M, short *BRLow, float scale);
--inline void scbitrevR2(float *ioptr, long M, short *BRLow, float scale){
-+static inline void scbitrevR2(float *ioptr, long M, short *BRLow, float scale);
-+static inline void scbitrevR2(float *ioptr, long M, short *BRLow, float scale){
- /*** scaled bit reverse and first radix 2 stage forward or inverse fft ***/
- float	f0r;
- float	f0i;
-@@ -1262,8 +1262,8 @@ for (; ioptr < iolimit; ioptr += POW2(M/
- };
- }
- 
--inline void ifft2pt(float *ioptr, float scale);
--inline void ifft2pt(float *ioptr, float scale){
-+static inline void ifft2pt(float *ioptr, float scale);
-+static inline void ifft2pt(float *ioptr, float scale){
- /***   RADIX 2 ifft	***/
- float f0r, f0i, f1r, f1i;
- float t0r, t0i;
-@@ -1292,8 +1292,8 @@ ioptr[2] = scale*f1r;
- ioptr[3] = scale*f1i;
- }
- 
--inline void ifft4pt(float *ioptr, float scale);
--inline void ifft4pt(float *ioptr, float scale){
-+static inline void ifft4pt(float *ioptr, float scale);
-+static inline void ifft4pt(float *ioptr, float scale){
- /***   RADIX 4 ifft	***/
- float f0r, f0i, f1r, f1i, f2r, f2i, f3r, f3i;
- float t0r, t0i, t1r, t1i;
-@@ -1347,8 +1347,8 @@ ioptr[6] = scale*f3r;
- ioptr[7] = scale*f3i;
- }
- 
--inline void ifft8pt(float *ioptr, float scale);
--inline void ifft8pt(float *ioptr, float scale){
-+static inline void ifft8pt(float *ioptr, float scale);
-+static inline void ifft8pt(float *ioptr, float scale){
- /***   RADIX 8 ifft	***/
- float w0r = 1.0/MYROOT2; /* cos(pi/4)	*/
- float f0r, f0i, f1r, f1i, f2r, f2i, f3r, f3i;
-@@ -1467,8 +1467,8 @@ ioptr[14] = scale*f6r;
- ioptr[15] = scale*f6i;
- }
- 
--inline void ibfR2(float *ioptr, long M, long NDiffU);
--inline void ibfR2(float *ioptr, long M, long NDiffU){
-+static inline void ibfR2(float *ioptr, long M, long NDiffU);
-+static inline void ibfR2(float *ioptr, long M, long NDiffU){
- /*** 2nd radix 2 stage ***/
- unsigned long	pos;
- unsigned long	posi;
-@@ -1576,8 +1576,8 @@ for (SameUCnt = NSameU; SameUCnt > 0 ; S
- }
- }
- 
--inline void ibfR4(float *ioptr, long M, long NDiffU);
--inline void ibfR4(float *ioptr, long M, long NDiffU){
-+static inline void ibfR4(float *ioptr, long M, long NDiffU);
-+static inline void ibfR4(float *ioptr, long M, long NDiffU){
- /*** 1 radix 4 stage ***/
- unsigned long	pos;
- unsigned long	posi;
-@@ -1785,8 +1785,8 @@ f4i = f4i * Two - f6i;
- 
- }
- 
--inline void ibfstages(float *ioptr, long M, float *Utbl, long Ustride, long NDiffU, long StageCnt);
--inline void ibfstages(float *ioptr, long M, float *Utbl, long Ustride, long NDiffU, long StageCnt){
-+static inline void ibfstages(float *ioptr, long M, float *Utbl, long Ustride, long NDiffU, long StageCnt);
-+static inline void ibfstages(float *ioptr, long M, float *Utbl, long Ustride, long NDiffU, long StageCnt){
- /***   RADIX 8 Stages	***/
- unsigned long	pos;
- unsigned long	posi;
-@@ -2193,8 +2193,8 @@ default:
- parts of rffts1
- *************************************************/
- 
--inline void rfft1pt(float *ioptr);
--inline void rfft1pt(float *ioptr){
-+static inline void rfft1pt(float *ioptr);
-+static inline void rfft1pt(float *ioptr){
- /***   RADIX 2 rfft	***/
- float f0r, f0i;
- float t0r, t0i;
-@@ -2212,8 +2212,8 @@ ioptr[0] = t0r;
- ioptr[1] = t0i;
- }
- 
--inline void rfft2pt(float *ioptr);
--inline void rfft2pt(float *ioptr){
-+static inline void rfft2pt(float *ioptr);
-+static inline void rfft2pt(float *ioptr){
- /***   RADIX 4 rfft	***/
- float f0r, f0i, f1r, f1i;
- float t0r, t0i;
-@@ -2245,8 +2245,8 @@ ioptr[2] = f1r;
- ioptr[3] = f1i;
- }
- 
--inline void rfft4pt(float *ioptr);
--inline void rfft4pt(float *ioptr){
-+static inline void rfft4pt(float *ioptr);
-+static inline void rfft4pt(float *ioptr){
- /***   RADIX 8 rfft	***/
- float f0r, f0i, f1r, f1i, f2r, f2i, f3r, f3i;
- float t0r, t0i, t1r, t1i;
-@@ -2318,8 +2318,8 @@ ioptr[6] = scale*f3r;
- ioptr[7] = scale*f3i;
- }
- 
--inline void rfft8pt(float *ioptr);
--inline void rfft8pt(float *ioptr){
-+static inline void rfft8pt(float *ioptr);
-+static inline void rfft8pt(float *ioptr){
- /***   RADIX 16 rfft	***/
- float w0r = 1.0/MYROOT2; /* cos(pi/4)	*/
- float w1r = MYCOSPID8; /* cos(pi/8)	*/
-@@ -2477,8 +2477,8 @@ ioptr[14] = scale*f6r;
- ioptr[15] = scale*f6i;
- }
- 
--inline void frstage(float *ioptr, long M, float *Utbl);
--inline void frstage(float *ioptr, long M, float *Utbl){
-+static inline void frstage(float *ioptr, long M, float *Utbl);
-+static inline void frstage(float *ioptr, long M, float *Utbl){
- /*	Finish RFFT		*/
- 
- unsigned long 	pos;
-@@ -2687,8 +2687,8 @@ default:
- parts of riffts1
- *************************************************/
- 
--inline void rifft1pt(float *ioptr, float scale);
--inline void rifft1pt(float *ioptr, float scale){
-+static inline void rifft1pt(float *ioptr, float scale);
-+static inline void rifft1pt(float *ioptr, float scale){
- /***   RADIX 2 rifft	***/
- float f0r, f0i;
- float t0r, t0i;
-@@ -2706,8 +2706,8 @@ ioptr[0] = scale*t0r;
- ioptr[1] = scale*t0i;
- }
- 
--inline void rifft2pt(float *ioptr, float scale);
--inline void rifft2pt(float *ioptr, float scale){
-+static inline void rifft2pt(float *ioptr, float scale);
-+static inline void rifft2pt(float *ioptr, float scale){
- /***   RADIX 4 rifft	***/
- float f0r, f0i, f1r, f1i;
- float t0r, t0i;
-@@ -2740,8 +2740,8 @@ ioptr[2] = scale*f1r;
- ioptr[3] = scale*f1i;
- }
- 
--inline void rifft4pt(float *ioptr, float scale);
--inline void rifft4pt(float *ioptr, float scale){
-+static inline void rifft4pt(float *ioptr, float scale);
-+static inline void rifft4pt(float *ioptr, float scale){
- /***   RADIX 8 rifft	***/
- float f0r, f0i, f1r, f1i, f2r, f2i, f3r, f3i;
- float t0r, t0i, t1r, t1i;
-@@ -2811,8 +2811,8 @@ ioptr[6] = scale*f3r;
- ioptr[7] = scale*f3i;
- }
- 
--inline void rifft8pt(float *ioptr, float scale);
--inline void rifft8pt(float *ioptr, float scale){
-+static inline void rifft8pt(float *ioptr, float scale);
-+static inline void rifft8pt(float *ioptr, float scale){
- /***   RADIX 16 rifft	***/
- float w0r = 1.0/MYROOT2; /* cos(pi/4)	*/
- float w1r = MYCOSPID8; /* cos(pi/8)	*/
-@@ -2968,8 +2968,8 @@ ioptr[14] = scale*f6r;
- ioptr[15] = scale*f6i;
- }
- 
--inline void ifrstage(float *ioptr, long M, float *Utbl);
--inline void ifrstage(float *ioptr, long M, float *Utbl){
-+static inline void ifrstage(float *ioptr, long M, float *Utbl);
-+static inline void ifrstage(float *ioptr, long M, float *Utbl){
- /*	Start RIFFT		*/
- 
- unsigned long 	pos;
---- audacity-src-1.3.8/lib-src/libnyquist/nyquist/xlisp/xldmem.c-orig	2009-08-05 19:00:47.193313000 -0500
-+++ audacity-src-1.3.8/lib-src/libnyquist/nyquist/xlisp/xldmem.c	2009-08-05 19:04:25.638858000 -0500
-@@ -17,6 +17,10 @@
- #include "string.h"
- #include "xlisp.h"
- 
-+#ifdef __sun
-+#include "alloca.h"
-+#endif
-+
- #ifdef WIN32
- #include "malloc.h" // defines alloca()
- #endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/audacity-03-portaudio.diff	Thu May 19 22:26:31 2011 +0000
@@ -0,0 +1,18 @@
+--- audacity-src-1.3.9.orig/lib-src/portaudio-v19/configure.in	Mon Aug 31 06:46:04 2009
++++ audacity-src-1.3.9/lib-src/portaudio-v19/configure.in	Wed Sep  9 19:25:41 2009
+@@ -338,11 +338,11 @@
+               SHARED_FLAGS="-G"
+               THREAD_CFLAGS="-mt"
+               ;;
+-           *)
+-              SHARED_FLAGS="-shared -fPIC"
+-              THREAD_CFLAGS="-pthread"
+-              ;;
+         esac
++        if test "$GCC" = "yes"; then
++           SHARED_FLAGS="-shared -fPIC"
++           THREAD_CFLAGS="-pthread"
++        fi
+ 
+         OTHER_OBJS="$OTHER_OBJS src/os/unix/pa_unix_hostapis.o src/os/unix/pa_unix_util.o"
+ esac
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/audacity-04-memorybarrier.diff	Thu May 19 22:26:31 2011 +0000
@@ -0,0 +1,14 @@
+--- audacity-src-1.3.10/lib-src/portaudio-v19/src/common/pa_memorybarrier.h	Tue Dec  1 20:32:06 2009
++++ audacity-src-1.3.10-patch/lib-src/portaudio-v19/src/common/pa_memorybarrier.h	Sun Jan 17 17:30:49 2010
+@@ -110,6 +110,11 @@
+ #   define PaUtil_FullMemoryBarrier()  _asm { lock add    [esp], 0 }
+ #   define PaUtil_ReadMemoryBarrier()  _asm { lock add    [esp], 0 }
+ #   define PaUtil_WriteMemoryBarrier() _asm { lock add    [esp], 0 }
++#elif defined(__sun) && defined(__SVR4)
++#   include <sys/atomic.h>
++#   define PaUtil_FullMemoryBarrier()  membar_exit();
++#   define PaUtil_ReadMemoryBarrier()  membar_exit();
++#   define PaUtil_WriteMemoryBarrier() membar_exit();
+ #else
+ #   ifdef ALLOW_SMP_DANGERS
+ #      warning Memory barriers not defined on this system or system unknown
--- a/patches/audacity-04-portaudio.diff	Thu May 19 09:25:39 2011 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
---- audacity-src-1.3.9.orig/lib-src/portaudio-v19/configure.in	Mon Aug 31 06:46:04 2009
-+++ audacity-src-1.3.9/lib-src/portaudio-v19/configure.in	Wed Sep  9 19:25:41 2009
-@@ -338,11 +338,11 @@
-               SHARED_FLAGS="-G"
-               THREAD_CFLAGS="-mt"
-               ;;
--           *)
--              SHARED_FLAGS="-shared -fPIC"
--              THREAD_CFLAGS="-pthread"
--              ;;
-         esac
-+        if test "$GCC" = "yes"; then
-+           SHARED_FLAGS="-shared -fPIC"
-+           THREAD_CFLAGS="-pthread"
-+        fi
- 
-         OTHER_OBJS="$OTHER_OBJS src/os/unix/pa_unix_hostapis.o src/os/unix/pa_unix_util.o"
- esac
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/audacity-05-header.diff	Thu May 19 22:26:31 2011 +0000
@@ -0,0 +1,10 @@
+--- audacity-src-1.3.13-beta/lib-src/portsmf/allegro.cpp-orig	2011-05-19 16:23:38.321211753 -0500
++++ audacity-src-1.3.13-beta/lib-src/portsmf/allegro.cpp	2011-05-19 16:24:31.259714151 -0500
+@@ -16,6 +16,7 @@
+ #include "memory.h"
+ #include <iostream>
+ #include <fstream>
++#include <sys/ddi.h>
+ using namespace std;
+ #include "allegro.h"
+ #include "algrd_internal.h"
--- a/patches/audacity-05-memorybarrier.diff	Thu May 19 09:25:39 2011 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
---- audacity-src-1.3.10/lib-src/portaudio-v19/src/common/pa_memorybarrier.h	Tue Dec  1 20:32:06 2009
-+++ audacity-src-1.3.10-patch/lib-src/portaudio-v19/src/common/pa_memorybarrier.h	Sun Jan 17 17:30:49 2010
-@@ -110,6 +110,11 @@
- #   define PaUtil_FullMemoryBarrier()  _asm { lock add    [esp], 0 }
- #   define PaUtil_ReadMemoryBarrier()  _asm { lock add    [esp], 0 }
- #   define PaUtil_WriteMemoryBarrier() _asm { lock add    [esp], 0 }
-+#elif defined(__sun) && defined(__SVR4)
-+#   include <sys/atomic.h>
-+#   define PaUtil_FullMemoryBarrier()  membar_exit();
-+#   define PaUtil_ReadMemoryBarrier()  membar_exit();
-+#   define PaUtil_WriteMemoryBarrier() membar_exit();
- #else
- #   ifdef ALLOW_SMP_DANGERS
- #      warning Memory barriers not defined on this system or system unknown
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/audacity-06-error-dialog.diff	Thu May 19 22:26:31 2011 +0000
@@ -0,0 +1,20 @@
+--- audacity-src-1.3.13-beta/src/widgets/ErrorDialog.cpp-orig	2011-05-19 16:57:48.231972528 -0500
++++ audacity-src-1.3.13-beta/src/widgets/ErrorDialog.cpp	2011-05-19 16:58:00.952979043 -0500
+@@ -285,7 +285,7 @@ void ShowErrorDialog(wxWindow *parent,
+                      const wxString &dlogTitle,
+                      const wxString &message, 
+                      const wxString &helpURL,
+-                     const bool Close)
++                     bool Close)
+ {
+    ErrorDialog dlog(parent, dlogTitle, message, helpURL, Close);
+    dlog.CentreOnParent();
+@@ -296,7 +296,7 @@ void ShowModelessErrorDialog(wxWindow *p
+                      const wxString &dlogTitle,
+                      const wxString &message, 
+                      const wxString &helpURL,
+-                     const bool Close)
++                     bool Close)
+ {
+    ErrorDialog *dlog = new ErrorDialog(parent, dlogTitle, message, helpURL, Close, false);
+    dlog->CentreOnParent();
--- a/patches/libsndfile-01-common.diff	Thu May 19 09:25:39 2011 +0000
+++ b/patches/libsndfile-01-common.diff	Thu May 19 22:26:31 2011 +0000
@@ -1,9 +1,9 @@
---- libsndfile-1.0.19/src/common.h	2009-04-28 15:14:15.091536034 +0530
-+++ libsndfile-1.0.19-new/src/common.h	2009-04-28 15:14:37.386000755 +0530
-@@ -39,7 +39,7 @@
- 
- #if (SIZEOF_LONG == 8)
+--- libsndfile-1.0.24/src/common.h-orig	2011-05-19 16:13:47.696255277 -0500
++++ libsndfile-1.0.24/src/common.h	2011-05-19 16:13:59.546688195 -0500
+@@ -42,7 +42,7 @@
  #	define	SF_PLATFORM_S64(x)		x##l
+ #elif (SIZEOF_LONG_LONG == 8)
+ #	define	SF_PLATFORM_S64(x)		x##ll
 -#elif COMPILER_IS_GCC
 +#elif COMPILER_IS_GCC || __SUNPRO_C
  #	define	SF_PLATFORM_S64(x)		x##ll
--- a/patches/libsndfile-01-flac-1.1.3.diff	Thu May 19 09:25:39 2011 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,478 +0,0 @@
-diff -ru libsndfile-1.0.17/configure.ac libsndfile-1.0.17-b2/configure.ac
---- libsndfile-1.0.17/configure.ac	2006-08-31 02:39:37.000000000 -0700
-+++ libsndfile-1.0.17-b2/configure.ac	2006-10-27 08:54:45.000000000 -0700
-@@ -339,7 +339,8 @@
- 		if test "x$HAVE_FLAC_1_1_1" = xyes ; then
- 			AC_DEFINE(HAVE_FLAC_1_1_1, [1], [Define to 1 if you have libflac 1.1.1])
- 			fi
--		FLAC_LIBS="-lFLAC"
-+		# in FLAC 1.1.3 libOggFLAC was merged into libFLAC, hence we need -logg
-+		FLAC_LIBS="-lFLAC -logg"
- 		fi
- 	fi
- 
-diff -ru libsndfile-1.0.17/src/flac.c libsndfile-1.0.17-b2/src/flac.c
---- libsndfile-1.0.17/src/flac.c	2006-08-31 02:22:19.000000000 -0700
-+++ libsndfile-1.0.17-b2/src/flac.c	2006-10-27 08:47:36.000000000 -0700
-@@ -46,6 +46,13 @@
- #include	"sfendian.h"
- #include	"float_cast.h"
- 
-+/* FLAC 1.1.3 has FLAC_API_VERSION_CURRENT == 8 */
-+#if !defined(FLAC_API_VERSION_CURRENT) || FLAC_API_VERSION_CURRENT < 8
-+#define LEGACY_FLAC
-+#else
-+#undef LEGACY_FLAC
-+#endif
-+
- /*------------------------------------------------------------------------------
- ** Private static functions.
- */
-@@ -60,8 +67,14 @@
- } PFLAC_PCM ;
- 
- typedef struct
--{	FLAC__SeekableStreamDecoder *fsd ;
-+{
-+#ifdef LEGACY_FLAC
-+	FLAC__SeekableStreamDecoder *fsd ;
- 	FLAC__SeekableStreamEncoder *fse ;
-+#else
-+	FLAC__StreamDecoder *fsd ;
-+	FLAC__StreamEncoder *fse ;
-+#endif
- 	PFLAC_PCM pcmtype ;
- 	void* ptr ;
- 	unsigned pos, len, remain ;
-@@ -108,6 +121,7 @@
- static int flac_command (SF_PRIVATE *psf, int command, void *data, int datasize) ;
- 
- /* Decoder Callbacks */
-+#ifdef LEGACY_FLAC
- static FLAC__SeekableStreamDecoderReadStatus sf_flac_read_callback (const FLAC__SeekableStreamDecoder *decoder, FLAC__byte buffer [], unsigned *bytes, void *client_data) ;
- static FLAC__SeekableStreamDecoderSeekStatus sf_flac_seek_callback (const FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 absolute_byte_offset, void *client_data) ;
- static FLAC__SeekableStreamDecoderTellStatus sf_flac_tell_callback (const FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 *absolute_byte_offset, void *client_data) ;
-@@ -116,13 +130,29 @@
- static FLAC__StreamDecoderWriteStatus sf_flac_write_callback (const FLAC__SeekableStreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer [], void *client_data) ;
- static void sf_flac_meta_callback (const FLAC__SeekableStreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data) ;
- static void sf_flac_error_callback (const FLAC__SeekableStreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data) ;
-+#else
-+static FLAC__StreamDecoderReadStatus sf_flac_read_callback (const FLAC__StreamDecoder *decoder, FLAC__byte buffer [], size_t *bytes, void *client_data) ;
-+static FLAC__StreamDecoderSeekStatus sf_flac_seek_callback (const FLAC__StreamDecoder *decoder, FLAC__uint64 absolute_byte_offset, void *client_data) ;
-+static FLAC__StreamDecoderTellStatus sf_flac_tell_callback (const FLAC__StreamDecoder *decoder, FLAC__uint64 *absolute_byte_offset, void *client_data) ;
-+static FLAC__StreamDecoderLengthStatus sf_flac_length_callback (const FLAC__StreamDecoder *decoder, FLAC__uint64 *stream_length, void *client_data) ;
-+static FLAC__bool sf_flac_eof_callback (const FLAC__StreamDecoder *decoder, void *client_data) ;
-+static FLAC__StreamDecoderWriteStatus sf_flac_write_callback (const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer [], void *client_data) ;
-+static void sf_flac_meta_callback (const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data) ;
-+static void sf_flac_error_callback (const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data) ;
-+#endif
- 
- /* Encoder Callbacks */
-+#ifdef LEGACY_FLAC
- static FLAC__SeekableStreamEncoderSeekStatus sf_flac_enc_seek_callback (const FLAC__SeekableStreamEncoder *encoder, FLAC__uint64 absolute_byte_offset, void *client_data) ;
- #ifdef HAVE_FLAC_1_1_1
- static FLAC__SeekableStreamEncoderTellStatus sf_flac_enc_tell_callback (const FLAC__SeekableStreamEncoder *encoder, FLAC__uint64 *absolute_byte_offset, void *client_data) ;
- #endif
- static FLAC__StreamEncoderWriteStatus sf_flac_enc_write_callback (const FLAC__SeekableStreamEncoder *encoder, const FLAC__byte buffer [], unsigned bytes, unsigned samples, unsigned current_frame, void *client_data) ;
-+#else
-+static FLAC__StreamEncoderSeekStatus sf_flac_enc_seek_callback (const FLAC__StreamEncoder *encoder, FLAC__uint64 absolute_byte_offset, void *client_data) ;
-+static FLAC__StreamEncoderTellStatus sf_flac_enc_tell_callback (const FLAC__StreamEncoder *encoder, FLAC__uint64 *absolute_byte_offset, void *client_data) ;
-+static FLAC__StreamEncoderWriteStatus sf_flac_enc_write_callback (const FLAC__StreamEncoder *encoder, const FLAC__byte buffer [], size_t bytes, unsigned samples, unsigned current_frame, void *client_data) ;
-+#endif
- 
- static const int legal_sample_rates [] =
- {	8000, 16000, 22050, 24000, 32000, 44100, 48000, 96000
-@@ -283,51 +313,99 @@
- } /* flac_buffer_copy */
- 
- 
-+#ifdef LEGACY_FLAC
- static FLAC__SeekableStreamDecoderReadStatus
- sf_flac_read_callback (const FLAC__SeekableStreamDecoder * UNUSED (decoder), FLAC__byte buffer [], unsigned *bytes, void *client_data)
-+#else
-+static FLAC__StreamDecoderReadStatus
-+sf_flac_read_callback (const FLAC__StreamDecoder * UNUSED (decoder), FLAC__byte buffer [], size_t *bytes, void *client_data)
-+#endif
- {	SF_PRIVATE *psf = (SF_PRIVATE*) client_data ;
- 
- 	*bytes = psf_fread (buffer, 1, *bytes, psf) ;
- 	if (*bytes > 0 && psf->error == 0)
-+#ifdef LEGACY_FLAC
- 		return FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_OK ;
- 
-     return FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_ERROR ;
-+#else
-+		return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE ;
-+
-+    return FLAC__STREAM_DECODER_READ_STATUS_ABORT ;
-+#endif
- } /* sf_flac_read_callback */
- 
-+#ifdef LEGACY_FLAC
- static FLAC__SeekableStreamDecoderSeekStatus
- sf_flac_seek_callback (const FLAC__SeekableStreamDecoder * UNUSED (decoder), FLAC__uint64 absolute_byte_offset, void *client_data)
-+#else
-+static FLAC__StreamDecoderSeekStatus
-+sf_flac_seek_callback (const FLAC__StreamDecoder * UNUSED (decoder), FLAC__uint64 absolute_byte_offset, void *client_data)
-+#endif
- {	SF_PRIVATE *psf = (SF_PRIVATE*) client_data ;
- 
- 	psf_fseek (psf, absolute_byte_offset, SEEK_SET) ;
- 	if (psf->error)
-+#ifdef LEGACY_FLAC
- 		return FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_ERROR ;
- 
- 	return FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_OK ;
-+#else
-+		return FLAC__STREAM_DECODER_SEEK_STATUS_ERROR ;
-+
-+	return FLAC__STREAM_DECODER_SEEK_STATUS_OK ;
-+#endif
- } /* sf_flac_seek_callback */
- 
-+#ifdef LEGACY_FLAC
- static FLAC__SeekableStreamDecoderTellStatus
- sf_flac_tell_callback (const FLAC__SeekableStreamDecoder * UNUSED (decoder), FLAC__uint64 *absolute_byte_offset, void *client_data)
-+#else
-+static FLAC__StreamDecoderTellStatus
-+sf_flac_tell_callback (const FLAC__StreamDecoder * UNUSED (decoder), FLAC__uint64 *absolute_byte_offset, void *client_data)
-+#endif
- {	SF_PRIVATE *psf = (SF_PRIVATE*) client_data ;
- 
- 	*absolute_byte_offset = psf_ftell (psf) ;
- 	if (psf->error)
-+#ifdef LEGACY_FLAC
- 		return FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_ERROR ;
- 
- 	return FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_OK ;
-+#else
-+		return FLAC__STREAM_DECODER_TELL_STATUS_ERROR ;
-+
-+	return FLAC__STREAM_DECODER_TELL_STATUS_OK ;
-+#endif
- } /* sf_flac_tell_callback */
- 
-+#ifdef LEGACY_FLAC
- static FLAC__SeekableStreamDecoderLengthStatus
- sf_flac_length_callback (const FLAC__SeekableStreamDecoder * UNUSED (decoder), FLAC__uint64 *stream_length, void *client_data)
-+#else
-+static FLAC__StreamDecoderLengthStatus
-+sf_flac_length_callback (const FLAC__StreamDecoder * UNUSED (decoder), FLAC__uint64 *stream_length, void *client_data)
-+#endif
- {	SF_PRIVATE *psf = (SF_PRIVATE*) client_data ;
- 
- 	if ((*stream_length = psf->filelength) == 0)
-+#ifdef LEGACY_FLAC
- 		return FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_ERROR ;
- 
- 	return FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_OK ;
-+#else
-+		return FLAC__STREAM_DECODER_LENGTH_STATUS_ERROR ;
-+
-+	return FLAC__STREAM_DECODER_LENGTH_STATUS_OK ;
-+#endif
- } /* sf_flac_length_callback */
- 
- static FLAC__bool
-+#ifdef LEGACY_FLAC
- sf_flac_eof_callback (const FLAC__SeekableStreamDecoder *UNUSED (decoder), void *client_data)
-+#else
-+sf_flac_eof_callback (const FLAC__StreamDecoder *UNUSED (decoder), void *client_data)
-+#endif
- {	SF_PRIVATE *psf = (SF_PRIVATE*) client_data ;
- 
- 	if (psf_ftell (psf) == psf->filelength)
-@@ -337,7 +415,11 @@
- } /* sf_flac_eof_callback */
- 
- static FLAC__StreamDecoderWriteStatus
-+#ifdef LEGACY_FLAC
- sf_flac_write_callback (const FLAC__SeekableStreamDecoder * UNUSED (decoder), const FLAC__Frame *frame, const FLAC__int32 * const buffer [], void *client_data)
-+#else
-+sf_flac_write_callback (const FLAC__StreamDecoder * UNUSED (decoder), const FLAC__Frame *frame, const FLAC__int32 * const buffer [], void *client_data)
-+#endif
- {	SF_PRIVATE *psf = (SF_PRIVATE*) client_data ;
- 	FLAC_PRIVATE* pflac = (FLAC_PRIVATE*) psf->codec_data ;
- 
-@@ -353,7 +435,11 @@
- } /* sf_flac_write_callback */
- 
- static void
-+#ifdef LEGACY_FLAC
- sf_flac_meta_callback (const FLAC__SeekableStreamDecoder * UNUSED (decoder), const FLAC__StreamMetadata *metadata, void *client_data)
-+#else
-+sf_flac_meta_callback (const FLAC__StreamDecoder * UNUSED (decoder), const FLAC__StreamMetadata *metadata, void *client_data)
-+#endif
- {	SF_PRIVATE *psf = (SF_PRIVATE*) client_data ;
- 
- 	switch (metadata->type)
-@@ -387,7 +473,11 @@
- } /* sf_flac_meta_callback */
- 
- static void
-+#ifdef LEGACY_FLAC
- sf_flac_error_callback (const FLAC__SeekableStreamDecoder * UNUSED (decoder), FLAC__StreamDecoderErrorStatus status, void *client_data)
-+#else
-+sf_flac_error_callback (const FLAC__StreamDecoder * UNUSED (decoder), FLAC__StreamDecoderErrorStatus status, void *client_data)
-+#endif
- {	SF_PRIVATE *psf = (SF_PRIVATE*) client_data ;
- 
- 	psf_log_printf (psf, "ERROR : %s\n", FLAC__StreamDecoderErrorStatusString [status]) ;
-@@ -407,17 +497,29 @@
- 	return ;
- } /* sf_flac_error_callback */
- 
-+#ifdef LEGACY_FLAC
- static FLAC__SeekableStreamEncoderSeekStatus
- sf_flac_enc_seek_callback (const FLAC__SeekableStreamEncoder * UNUSED (encoder), FLAC__uint64 absolute_byte_offset, void *client_data)
-+#else
-+static FLAC__StreamEncoderSeekStatus
-+sf_flac_enc_seek_callback (const FLAC__StreamEncoder * UNUSED (encoder), FLAC__uint64 absolute_byte_offset, void *client_data)
-+#endif
- {	SF_PRIVATE *psf = (SF_PRIVATE*) client_data ;
- 
- 	psf_fseek (psf, absolute_byte_offset, SEEK_SET) ;
- 	if (psf->error)
-+#ifdef LEGACY_FLAC
- 		return FLAC__SEEKABLE_STREAM_ENCODER_SEEK_STATUS_ERROR ;
- 
-     return FLAC__SEEKABLE_STREAM_ENCODER_SEEK_STATUS_OK ;
-+#else
-+		return FLAC__STREAM_ENCODER_SEEK_STATUS_ERROR ;
-+
-+    return FLAC__STREAM_ENCODER_SEEK_STATUS_OK ;
-+#endif
- } /* sf_flac_enc_seek_callback */
- 
-+#ifdef LEGACY_FLAC
- #ifdef HAVE_FLAC_1_1_1
- static FLAC__SeekableStreamEncoderTellStatus
- sf_flac_enc_tell_callback (const FLAC__SeekableStreamEncoder *UNUSED (encoder), FLAC__uint64 *absolute_byte_offset, void *client_data)
-@@ -430,9 +532,25 @@
- 	return FLAC__SEEKABLE_STREAM_ENCODER_TELL_STATUS_OK ;
- } /* sf_flac_enc_tell_callback */
- #endif
-+#else
-+static FLAC__StreamEncoderTellStatus
-+sf_flac_enc_tell_callback (const FLAC__StreamEncoder *UNUSED (encoder), FLAC__uint64 *absolute_byte_offset, void *client_data)
-+{	SF_PRIVATE *psf = (SF_PRIVATE*) client_data ;
-+
-+	*absolute_byte_offset = psf_ftell (psf) ;
-+	if (psf->error)
-+		return FLAC__STREAM_ENCODER_TELL_STATUS_ERROR ;
-+
-+	return FLAC__STREAM_ENCODER_TELL_STATUS_OK ;
-+} /* sf_flac_enc_tell_callback */
-+#endif
- 
- static FLAC__StreamEncoderWriteStatus
-+#ifdef LEGACY_FLAC
- sf_flac_enc_write_callback (const FLAC__SeekableStreamEncoder * UNUSED (encoder), const FLAC__byte buffer [], unsigned bytes, unsigned UNUSED (samples), unsigned UNUSED (current_frame), void *client_data)
-+#else
-+sf_flac_enc_write_callback (const FLAC__StreamEncoder * UNUSED (encoder), const FLAC__byte buffer [], size_t bytes, unsigned UNUSED (samples), unsigned UNUSED (current_frame), void *client_data)
-+#endif
- {	SF_PRIVATE *psf = (SF_PRIVATE*) client_data ;
- 
- 	if (psf_fwrite (buffer, 1, bytes, psf) == bytes && psf->error == 0)
-@@ -509,15 +627,27 @@
- 		return 0 ;
- 
- 	if (psf->mode == SFM_WRITE)
--	{	FLAC__seekable_stream_encoder_finish (pflac->fse) ;
-+	{
-+#ifdef LEGACY_FLAC
-+		FLAC__seekable_stream_encoder_finish (pflac->fse) ;
- 		FLAC__seekable_stream_encoder_delete (pflac->fse) ;
-+#else
-+		FLAC__stream_encoder_finish (pflac->fse) ;
-+		FLAC__stream_encoder_delete (pflac->fse) ;
-+#endif
- 		if (pflac->encbuffer)
- 			free (pflac->encbuffer) ;
- 		} ;
- 
- 	if (psf->mode == SFM_READ)
--	{	FLAC__seekable_stream_decoder_finish (pflac->fsd) ;
-+	{
-+#ifdef LEGACY_FLAC
-+		FLAC__seekable_stream_decoder_finish (pflac->fsd) ;
- 		FLAC__seekable_stream_decoder_delete (pflac->fsd) ;
-+#else
-+		FLAC__stream_decoder_finish (pflac->fsd) ;
-+		FLAC__stream_decoder_delete (pflac->fsd) ;
-+#endif
- 		} ;
- 
- 	for (k = 0 ; k < ARRAY_LEN (pflac->rbuffer) ; k++)
-@@ -546,17 +676,6 @@
- 		return SFE_FLAC_BAD_SAMPLE_RATE ;
- 
- 	psf_fseek (psf, 0, SEEK_SET) ;
--	if ((pflac->fse = FLAC__seekable_stream_encoder_new ()) == NULL)
--		return SFE_FLAC_NEW_DECODER ;
--	FLAC__seekable_stream_encoder_set_write_callback (pflac->fse, sf_flac_enc_write_callback) ;
--	FLAC__seekable_stream_encoder_set_seek_callback (pflac->fse, sf_flac_enc_seek_callback) ;
--
--#ifdef HAVE_FLAC_1_1_1
--	FLAC__seekable_stream_encoder_set_tell_callback (pflac->fse, sf_flac_enc_tell_callback) ;
--#endif
--	FLAC__seekable_stream_encoder_set_client_data (pflac->fse, psf) ;
--	FLAC__seekable_stream_encoder_set_channels (pflac->fse, psf->sf.channels) ;
--	FLAC__seekable_stream_encoder_set_sample_rate (pflac->fse, psf->sf.samplerate) ;
- 
- 	switch (psf->sf.format & SF_FORMAT_SUBMASK)
- 	{	case SF_FORMAT_PCM_S8 :
-@@ -574,12 +693,36 @@
- 			break ;
- 		} ;
- 
-+#ifdef LEGACY_FLAC
-+	if ((pflac->fse = FLAC__seekable_stream_encoder_new ()) == NULL)
-+		return SFE_FLAC_NEW_DECODER ;
-+	FLAC__seekable_stream_encoder_set_write_callback (pflac->fse, sf_flac_enc_write_callback) ;
-+	FLAC__seekable_stream_encoder_set_seek_callback (pflac->fse, sf_flac_enc_seek_callback) ;
-+
-+#ifdef HAVE_FLAC_1_1_1
-+	FLAC__seekable_stream_encoder_set_tell_callback (pflac->fse, sf_flac_enc_tell_callback) ;
-+#endif
-+	FLAC__seekable_stream_encoder_set_client_data (pflac->fse, psf) ;
-+	FLAC__seekable_stream_encoder_set_channels (pflac->fse, psf->sf.channels) ;
-+	FLAC__seekable_stream_encoder_set_sample_rate (pflac->fse, psf->sf.samplerate) ;
- 	FLAC__seekable_stream_encoder_set_bits_per_sample (pflac->fse, bps) ;
- 
- 	if ((bps = FLAC__seekable_stream_encoder_init (pflac->fse)) != FLAC__SEEKABLE_STREAM_DECODER_OK)
- 	{	psf_log_printf (psf, "Error : FLAC encoder init returned error : %s\n", FLAC__seekable_stream_encoder_get_resolved_state_string (pflac->fse)) ;
- 		return SFE_FLAC_INIT_DECODER ;
- 		} ;
-+#else
-+	if ((pflac->fse = FLAC__stream_encoder_new ()) == NULL)
-+		return SFE_FLAC_NEW_DECODER ;
-+	FLAC__stream_encoder_set_channels (pflac->fse, psf->sf.channels) ;
-+	FLAC__stream_encoder_set_sample_rate (pflac->fse, psf->sf.samplerate) ;
-+	FLAC__stream_encoder_set_bits_per_sample (pflac->fse, bps) ;
-+
-+	if ((bps = FLAC__stream_encoder_init_stream (pflac->fse, sf_flac_enc_write_callback, sf_flac_enc_seek_callback, sf_flac_enc_tell_callback, NULL, psf)) != FLAC__STREAM_DECODER_INIT_STATUS_OK)
-+	{	psf_log_printf (psf, "Error : FLAC encoder init returned error : %s\n", FLAC__StreamEncoderInitStatusString[bps]) ;
-+		return SFE_FLAC_INIT_DECODER ;
-+		} ;
-+#endif
- 
- 	if (psf->error == 0)
- 		psf->dataoffset = psf_ftell (psf) ;
-@@ -593,6 +736,7 @@
- {	FLAC_PRIVATE* pflac = (FLAC_PRIVATE*) psf->codec_data ;
- 
- 	psf_fseek (psf, 0, SEEK_SET) ;
-+#ifdef LEGACY_FLAC
- 	if ((pflac->fsd = FLAC__seekable_stream_decoder_new ()) == NULL)
- 		return SFE_FLAC_NEW_DECODER ;
- 
-@@ -610,9 +754,22 @@
- 		return SFE_FLAC_INIT_DECODER ;
- 
- 	FLAC__seekable_stream_decoder_process_until_end_of_metadata (pflac->fsd) ;
-+#else
-+	if ((pflac->fsd = FLAC__stream_decoder_new ()) == NULL)
-+		return SFE_FLAC_NEW_DECODER ;
-+
-+	if (FLAC__stream_decoder_init_stream (pflac->fsd, sf_flac_read_callback, sf_flac_seek_callback, sf_flac_tell_callback, sf_flac_length_callback, sf_flac_eof_callback, sf_flac_write_callback, sf_flac_meta_callback, sf_flac_error_callback, psf) != FLAC__STREAM_DECODER_INIT_STATUS_OK)
-+		return SFE_FLAC_INIT_DECODER ;
-+
-+	FLAC__stream_decoder_process_until_end_of_metadata (pflac->fsd) ;
-+#endif
- 	if (psf->error == 0)
- 	{	FLAC__uint64 position ;
-+#ifdef LEGACY_FLAC
- 		FLAC__seekable_stream_decoder_get_decode_position (pflac->fsd, &position) ;
-+#else
-+		FLAC__stream_decoder_get_decode_position (pflac->fsd, &position) ;
-+#endif
- 		psf->dataoffset = position ;
- 		} ;
- 
-@@ -676,10 +833,18 @@
- 		flac_buffer_copy (psf) ;
- 
- 	while (pflac->pos < pflac->len)
--	{	if (FLAC__seekable_stream_decoder_process_single (pflac->fsd) == 0)
-+	{
-+#ifdef LEGACY_FLAC
-+		if (FLAC__seekable_stream_decoder_process_single (pflac->fsd) == 0)
- 			break ;
- 		if (FLAC__seekable_stream_decoder_get_state (pflac->fsd) != FLAC__SEEKABLE_STREAM_DECODER_OK)
- 			break ;
-+#else
-+		if (FLAC__stream_decoder_process_single (pflac->fsd) == 0)
-+			break ;
-+		if (FLAC__stream_decoder_get_state (pflac->fsd) >= FLAC__STREAM_DECODER_END_OF_STREAM)
-+			break ;
-+#endif
- 		} ;
- 
- 	pflac->ptr = NULL ;
-@@ -795,7 +960,11 @@
- 	while (len > 0)
- 	{	writecount = (len >= bufferlen) ? bufferlen : (int) len ;
- 		convert (ptr + total, buffer, writecount) ;
-+#ifdef LEGACY_FLAC
- 		if (FLAC__seekable_stream_encoder_process_interleaved (pflac->fse, buffer, writecount/psf->sf.channels))
-+#else
-+		if (FLAC__stream_encoder_process_interleaved (pflac->fse, buffer, writecount/psf->sf.channels))
-+#endif
- 			thiswrite = writecount ;
- 		else
- 			break ;
-@@ -837,7 +1006,11 @@
- 	while (len > 0)
- 	{	writecount = (len >= bufferlen) ? bufferlen : (int) len ;
- 		convert (ptr + total, buffer, writecount) ;
-+#ifdef LEGACY_FLAC
- 		if (FLAC__seekable_stream_encoder_process_interleaved (pflac->fse, buffer, writecount/psf->sf.channels))
-+#else
-+		if (FLAC__stream_encoder_process_interleaved (pflac->fse, buffer, writecount/psf->sf.channels))
-+#endif
- 			thiswrite = writecount ;
- 		else
- 			break ;
-@@ -879,7 +1052,11 @@
- 	while (len > 0)
- 	{	writecount = (len >= bufferlen) ? bufferlen : (int) len ;
- 		convert (ptr + total, buffer, writecount, psf->norm_float) ;
-+#ifdef LEGACY_FLAC
- 		if (FLAC__seekable_stream_encoder_process_interleaved (pflac->fse, buffer, writecount/psf->sf.channels))
-+#else
-+		if (FLAC__stream_encoder_process_interleaved (pflac->fse, buffer, writecount/psf->sf.channels))
-+#endif
- 			thiswrite = writecount ;
- 		else
- 			break ;
-@@ -1011,7 +1188,11 @@
- 	while (len > 0)
- 	{	writecount = (len >= bufferlen) ? bufferlen : (int) len ;
- 		convert (ptr + total, buffer, writecount, psf->norm_double) ;
-+#ifdef LEGACY_FLAC
- 		if (FLAC__seekable_stream_encoder_process_interleaved (pflac->fse, buffer, writecount/psf->sf.channels))
-+#else
-+		if (FLAC__stream_encoder_process_interleaved (pflac->fse, buffer, writecount/psf->sf.channels))
-+#endif
- 			thiswrite = writecount ;
- 		else
- 			break ;
-@@ -1131,10 +1312,17 @@
- 
- 	if (psf->mode == SFM_READ)
- 	{	FLAC__uint64 position ;
-+#ifdef LEGACY_FLAC
- 		if (FLAC__seekable_stream_decoder_seek_absolute (pflac->fsd, offset))
- 		{	FLAC__seekable_stream_decoder_get_decode_position (pflac->fsd, &position) ;
- 			return offset ;
- 			} ;
-+#else
-+		if (FLAC__stream_decoder_seek_absolute (pflac->fsd, offset))
-+		{	FLAC__stream_decoder_get_decode_position (pflac->fsd, &position) ;
-+			return offset ;
-+			} ;
-+#endif
- 
- 		return ((sf_count_t) -1) ;
- 		} ;