On 2/4/2012 13:20, Erik de Castro Lopo wrote:
> Hi all, especially David Yeo and JonY,
> 
> I've started moving compiler specific CPP hacker into a separate file
> at include/share/compat.h.
> 
> Eventually I hope to be able to move all of the require CPP hackery
> for $random_compiler into this file and have any C file which needs
> any compiler specific tweak to include this new compatibilty header.
> 
> My belief is that one this CPP hackery is all in one place, it will
> be far easier to modify and keep correct.
> 
> So, I would be very greatful if David Yeo and JonY could test current
> git HEAD and provide a patch if anything breaks. I will hold off
> on any further hacking for a couple of days to give you guys time to
> test this.
> 

Hi,

Looks like there are some missed defines in the test_libFLAC++. Attached
patch fixes that.

Also, wsock32 usage is deprecated, on Win7, wsock32 forwards everything
to ws2_32, suggest changing to -lwsock32 to -lws2_32 in configure.ac.
Additionally, using -lwsock32 on Cygwin is wrong. Fix in config.txt.

I also suggest changing all the switch-case statements in configure.ac
to AS_CASE.
diff --git a/src/libFLAC/stream_decoder.c b/src/libFLAC/stream_decoder.c
index 0323d73..67654b8 100644
--- a/src/libFLAC/stream_decoder.c
+++ b/src/libFLAC/stream_decoder.c
@@ -46,16 +46,7 @@
 #include <string.h> /* for memset/memcpy() */
 #include <sys/stat.h> /* for stat() */
 #include <sys/types.h> /* for off_t */
-#if defined _MSC_VER || defined __BORLANDC__ || defined __MINGW32__
-#if _MSC_VER <= 1600 || defined __BORLANDC__ /* @@@ [2G limit] */
-#ifndef fseeko
-#define fseeko fseek
-#endif
-#ifndef ftello
-#define ftello ftell
-#endif
-#endif
-#endif
+#include "share/compat.h"
 #include "FLAC/assert.h"
 #include "share/alloc.h"
 #include "protected/stream_decoder.h"
diff --git a/src/test_libFLAC++/decoders.cpp b/src/test_libFLAC++/decoders.cpp
index 4398887..f7f5a42 100644
--- a/src/test_libFLAC++/decoders.cpp
+++ b/src/test_libFLAC++/decoders.cpp
@@ -24,17 +24,12 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#if defined _MSC_VER || defined __MINGW32__
-#if _MSC_VER <= 1600 /* @@@ [2G limit] */
-#define fseeko fseek
-#define ftello ftell
-#endif
-#endif
 #include "decoders.h"
 #include "FLAC/assert.h"
 #include "FLAC/metadata.h" // for ::FLAC__metadata_object_is_equal()
 #include "FLAC++/decoder.h"
 #include "share/grabbag.h"
+#include "share/compat.h"
 extern "C" {
 #include "test_libs_common/file_utils_flac.h"
 #include "test_libs_common/metadata_utils.h"
diff --git a/src/test_libFLAC++/metadata_manip.cpp 
b/src/test_libFLAC++/metadata_manip.cpp
index 4ee4281..9bf0eb2 100644
--- a/src/test_libFLAC++/metadata_manip.cpp
+++ b/src/test_libFLAC++/metadata_manip.cpp
@@ -23,23 +23,15 @@
 #include <stdio.h>
 #include <stdlib.h> /* for malloc() */
 #include <string.h> /* for memcpy()/memset() */
-#if defined _MSC_VER || defined __MINGW32__
-#include <sys/utime.h> /* for utime() */
-#include <io.h> /* for chmod() */
-#if _MSC_VER <= 1600 /* @@@ [2G limit] */
-#define fseeko fseek
-#define ftello ftell
-#endif
-#else
 #include <sys/types.h> /* some flavors of BSD (like OS X) require this to get 
time_t */
 #include <utime.h> /* for utime() */
 #include <unistd.h> /* for chown(), unlink() */
-#endif
 #include <sys/stat.h> /* for stat(), maybe chmod() */
 #include "FLAC/assert.h"
 #include "FLAC++/decoder.h"
 #include "FLAC++/metadata.h"
 #include "share/grabbag.h"
+#include "share/compat.h"
 extern "C" {
 #include "test_libs_common/file_utils_flac.h"
 }
diff --git a/configure.ac b/configure.ac
index 36ac6c6..c0ed842 100644
--- a/configure.ac
+++ b/configure.ac
@@ -103,11 +103,16 @@ esac
 AC_SUBST(OBJ_FORMAT)
 
 case "$host" in
-       *-*-cygwin|*mingw*)
+       *-*-cygwin*)
+                # define this variable for enabling strict exports with 
libtool; for now, it's only supported by Win32
+                LT_NO_UNDEFINED="-no-undefined"
+               MINGW_WINSOCK_LIBS=
+               ;;
+       *-*-mingw*)
                # define this variable for enabling strict exports with 
libtool; for now, it's only supported by Win32
                LT_NO_UNDEFINED="-no-undefined"
-               # -lwsock32 only needed because of ntohl() usage, can get rid 
of after that's gone:
-               MINGW_WINSOCK_LIBS=-lwsock32
+               # -lws2_32 only needed because of ntohl() usage, can get rid of 
after that's gone:
+               MINGW_WINSOCK_LIBS=-lws2_32
                ;;
        *)
                LT_NO_UNDEFINED=

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
flac-dev mailing list
flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev

Reply via email to