shithub: sox

Download patch

ref: ff5f7b5c765203a4cfd4e5882a388d9743373f74
parent: dae674f1a5a22e562e4640eadcec3fff9816b733
author: robs <robs>
date: Fri Jun 27 17:02:21 EDT 2008

fixes win32 build

--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -44,12 +44,13 @@
   cvsd            htk             s1-fmt          u1-fmt
 )
 add_library(lib${PROJECT_NAME}
-  effects                 formats_i               ${optional_srcs}
-  effects_i               ${formats_srcs}         soxstdint
-  ${effects_srcs}         libsox                  util
-  formats                 libsox_i                xmalloc
+  effects                 ${formats_srcs}         ${optional_srcs}
+  effects_i               getopt                  soxstdint
+  ${effects_srcs}         getopt1                 util
+  formats                 libsox                  xmalloc
+  formats_i               libsox_i
 )
-add_executable(${PROJECT_NAME} ${PROJECT_NAME}.c getopt getopt1)
+add_executable(${PROJECT_NAME} ${PROJECT_NAME}.c)
 target_link_libraries(${PROJECT_NAME} lib${PROJECT_NAME} lpc10 ${optional_libs})
 add_executable(sox_sample_test sox_sample_test.c)
 add_executable(example0 example0.c)
--- a/src/libsox_i.c
+++ b/src/libsox_i.c
@@ -11,21 +11,3 @@
  */
 
 #include "sox_i.h"
-#include <ctype.h>
-
-#ifndef HAVE_STRCASECMP
-int lsx_strcasecmp(const char * s1, const char * s2)
-{
-  while (*s1 && (toupper(*s1) == toupper(*s2)))
-    s1++, s2++;
-  return toupper(*s1) - toupper(*s2);
-}
-
-int lsx_strncasecmp(char const * s1, char const * s2, size_t n)
-{
-  while (--n && *s1 && (toupper(*s1) == toupper(*s2)))
-    s1++, s2++;
-  return toupper(*s1) - toupper(*s2);
-}
-#endif
-
--- a/src/sox_i.h
+++ b/src/sox_i.h
@@ -54,8 +54,6 @@
 #ifndef HAVE_STRCASECMP
 int strcasecmp(const char *s1, const char *s2);
 int strncasecmp(char const * s1, char const * s2, size_t n);
-#define strcasecmp lsx_strcasecmp
-#define strncasecmp lsx_strncasecmp
 #endif
 
 #ifdef HAVE_BYTESWAP_H
--- a/src/util.c
+++ b/src/util.c
@@ -16,8 +16,25 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "util.h"
+#include "sox_i.h"
+#include <ctype.h>
 #include <stdio.h>
+
+#ifndef HAVE_STRCASECMP
+int strcasecmp(const char * s1, const char * s2)
+{
+  while (*s1 && (toupper(*s1) == toupper(*s2)))
+    s1++, s2++;
+  return toupper(*s1) - toupper(*s2);
+}
+
+int strncasecmp(char const * s1, char const * s2, size_t n)
+{
+  while (--n && *s1 && (toupper(*s1) == toupper(*s2)))
+    s1++, s2++;
+  return toupper(*s1) - toupper(*s2);
+}
+#endif
 
 enum_item const * find_enum_text(char const * text, enum_item const * enum_items)
 {