shithub: sox

Download patch

ref: 0ed6d04ef74863e1bebd3be7cf4932c0b066c9a7
parent: 5c58413544fd600bf12fdc54fa9648f0bc1ea860
author: Ulrich Klauer <ulrich@chirlu.de>
date: Sun Feb 10 10:56:13 EST 2013

Link Windows build to wsock32.dll again

Link the Windows build to wsock32.dll for ntohl() again instead of
trying to provide an own implementation.

(Partial revert of commit d0647a4f8650f92057274f2412bb8aa79f71a242.)

This will be rendered unnecessary by the forthcoming 1.3.0 release of
libflac that removes the call to ntohl().

--- a/configure.ac
+++ b/configure.ac
@@ -441,6 +441,11 @@
 #  support for OGG and if OGG libraries are found on this
 #  system then its highly likely to be compiled into FLAC
 #  and will require these at link time.
+case $target in
+  *mingw*)
+  FLAC_LIBS="-lwsock32"
+  ;;
+esac
 AC_OPTIONAL_FORMAT(flac, FLAC, [AC_CHECK_HEADER(FLAC/all.h, [AC_CHECK_DECL(FLAC_API_VERSION_CURRENT, [AC_CHECK_LIB(FLAC, FLAC__stream_encoder_new, FLAC_LIBS="-lFLAC $FLAC_LIBS $OGG_VORBIS_LIBS",using_flac=no, $FLAC_LIBS $OGG_VORBIS_LIBS)], using_flac=no, [#include <FLAC/all.h>])], using_flac=no)], using_flac=no)
 
 
--- a/src/flac.c
+++ b/src/flac.c
@@ -55,14 +55,6 @@
 } priv_t;
 
 
-#if defined(__MINGW32__)
-/* Provide a local definition of ntohl so we don't need to load wsock32.dll. */
-unsigned long __stdcall ntohl(unsigned long val)
-{
-    return lsx_swapdw(val);
-}
-#endif
-
 static FLAC__StreamDecoderReadStatus decoder_read_callback(FLAC__StreamDecoder const* decoder UNUSED, FLAC__byte buffer[], size_t* bytes, void* ft_data)
 {
   sox_format_t* ft = (sox_format_t*)ft_data;