shithub: sox

Download patch

ref: 14e8d3257078b3db09a63e84b9a1a750b3c9ff95
parent: d65152a54d3d242d90666b0dd648f2b37050fd4e
author: cbagwell <cbagwell>
date: Sat Nov 8 00:01:48 EST 2008

Include local getopt.h last in case someone includes a system
header file that defines getopt items.  It can cause errors if
our aliases messes with system header files.

--- a/src/sox.c
+++ b/src/sox.c
@@ -70,8 +70,8 @@
 #include <fcntl.h>
 #endif
 
-/* We are playing games with getopt aliases so this needs to be included after unistd.h
- * to prevent aliasing oS's version of getopt.
+/* We are playing games with getopt aliases so this needs to be included after
+ * unistd.h to prevent aliasing OS's version of getopt.
  */
 #include "getopt.h"
 
--- a/src/spectrogram.c
+++ b/src/spectrogram.c
@@ -26,10 +26,14 @@
 
 #include "sox_i.h"
 #include "fft4g.h"
-#include "getopt.h"
 #include <assert.h>
 #include <math.h>
 #include <png.h>
+
+/* we are playing games with getopt aliases so this needs to be included
+ * after system header files to prevent aliasing OS's version of getopt.
+ */
+#include "getopt.h"
 
 #define malloc              lsx_malloc
 #define calloc              lsx_calloc