On 2/3/2012 06:33, JonY wrote:
> On 2/3/2012 02:50, Erik de Castro Lopo wrote:
>> JonY wrote:
>>
>>> Attached patch builds without any warnings for MinGW.
>>
>> Sorry JonY, that patch does not apply against current git master
>> which is here:
>>
>>     https://git.xiph.org/?p=flac.git;a=summary
>>
>> Specifically I pulled out much of the "#ifdef _MSC_VER" printf stuff
>> in this commit:
>>
>>     
>> https://git.xiph.org/?p=flac.git;a=commit;h=ce8a75134cace056f6c436d54b57bad1a1d93797
>>
>> For example (damn thats a horrible URL):
>>
>>     
>> https://git.xiph.org/?p=flac.git;a=blobdiff;f=examples/c/decode/file/main.c;h=e5138b4f9a08f0cf3e9a26c8ab68ac76d161785d;hp=32b555947d5c576693dbb6a9ee13a0a67582d96a;hb=ce8a75134cace056f6c436d54b57bad1a1d93797;hpb=8bbbf56403808ff75126cd0840a936aedbc4113b
>>
>> Since your patch seems pretty similar to what I have already commited,
>> I wouldn't be surprised it what we have now doesn't just compile correctly
>> under MinGW.
> 
> OK, will redo patch later today. My git repo still pointed to the old
> /mirrors/flac.git link, so I didn't get any updates.
> 
> 

OK, rebuilt with latest master, no more printf warnings. Here's another
attached patch to suppress redefinition warnings with mingw-w64 lfs64
support.
diff --git a/src/flac/decode.c b/src/flac/decode.c
index 05d86f3..2173669 100644
--- a/src/flac/decode.c
+++ b/src/flac/decode.c
@@ -29,10 +29,14 @@
 #if defined _MSC_VER || defined __MINGW32__
 #include <sys/types.h> /* for off_t */
 #if _MSC_VER <= 1600 /* @@@ [2G limit] */
+#ifndef fseeko
 #define fseeko fseek
+#endif
+#ifndef ftello
 #define ftello ftell
 #endif
 #endif
+#endif
 #include <errno.h>
 #include <math.h> /* for floor() */
 #include <stdio.h> /* for FILE etc. */
diff --git a/src/flac/encode.c b/src/flac/encode.c
index dafa105..87ef2ef 100644
--- a/src/flac/encode.c
+++ b/src/flac/encode.c
@@ -29,10 +29,14 @@
 #if defined _MSC_VER || defined __MINGW32__
 #include <sys/types.h> /* for off_t */
 #if _MSC_VER <= 1600 /* @@@ [2G limit] */
+#ifndef fseeko
 #define fseeko fseek
+#endif
+#ifndef ftello
 #define ftello ftell
 #endif
 #endif
+#endif
 #include <errno.h>
 #include <limits.h> /* for LONG_MAX */
 #include <math.h> /* for floor() */
diff --git a/src/flac/foreign_metadata.c b/src/flac/foreign_metadata.c
index 7e273a5..d4fb7c2 100644
--- a/src/flac/foreign_metadata.c
+++ b/src/flac/foreign_metadata.c
@@ -23,10 +23,14 @@
 #if defined _MSC_VER || defined __MINGW32__
 #include <sys/types.h> /* for off_t */
 #if _MSC_VER <= 1600 /* @@@ [2G limit] */
+#ifndef fseeko
 #define fseeko fseek
+#endif
+#ifndef ftello
 #define ftello ftell
 #endif
 #endif
+#endif
 #include <stdio.h> /* for FILE etc. */
 #include <stdlib.h> /* for calloc() etc. */
 #include <string.h> /* for memcmp() etc. */
diff --git a/src/flac/iffscan.c b/src/flac/iffscan.c
index da74a5f..2cb9075 100644
--- a/src/flac/iffscan.c
+++ b/src/flac/iffscan.c
@@ -26,10 +26,14 @@
 #if defined _MSC_VER || defined __MINGW32__
 #include <sys/types.h> /* for off_t */
 #if _MSC_VER <= 1600 /* @@@ [2G limit] */
+#ifndef fseeko
 #define fseeko fseek
+#endif
+#ifndef ftello
 #define ftello ftell
 #endif
 #endif
+#endif
 #include "foreign_metadata.h"
 
 static FLAC__uint32 unpack32be_(const FLAC__byte *b)
diff --git a/src/libFLAC/metadata_iterators.c b/src/libFLAC/metadata_iterators.c
index ac6473e..9ef9882 100644
--- a/src/libFLAC/metadata_iterators.c
+++ b/src/libFLAC/metadata_iterators.c
@@ -47,9 +47,13 @@
 #include <io.h> /* for chmod() */
 #include <sys/types.h> /* for off_t */
 #if _MSC_VER <= 1600 || defined __BORLANDC__ /* @@@ [2G limit] */
+#ifndef fseeko
 #define fseeko fseek
+#endif
+#ifndef ftello
 #define ftello ftell
 #endif
+#endif
 #else
 #include <sys/types.h> /* some flavors of BSD (like OS X) require this to get 
time_t */
 #include <utime.h> /* for utime() */
diff --git a/src/libFLAC/stream_decoder.c b/src/libFLAC/stream_decoder.c
index 72d9e43..0323d73 100644
--- a/src/libFLAC/stream_decoder.c
+++ b/src/libFLAC/stream_decoder.c
@@ -48,10 +48,14 @@
 #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 "FLAC/assert.h"
 #include "share/alloc.h"
 #include "protected/stream_decoder.h"
diff --git a/src/libFLAC/stream_encoder.c b/src/libFLAC/stream_encoder.c
index 8fb3209..0b6d8c2 100644
--- a/src/libFLAC/stream_encoder.c
+++ b/src/libFLAC/stream_encoder.c
@@ -48,10 +48,14 @@
 #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 "FLAC/assert.h"
 #include "FLAC/stream_decoder.h"
 #include "share/alloc.h"
diff --git a/src/test_libFLAC/decoders.c b/src/test_libFLAC/decoders.c
index e45e722..70127cf 100644
--- a/src/test_libFLAC/decoders.c
+++ b/src/test_libFLAC/decoders.c
@@ -26,10 +26,14 @@
 #include <string.h>
 #if defined _MSC_VER || defined __MINGW32__
 #if _MSC_VER <= 1600 /* @@@ [2G limit] */
+#ifndef fseeko
 #define fseeko fseek
+#endif
+#ifndef ftello
 #define ftello ftell
 #endif
 #endif
+#endif
 #include "decoders.h"
 #include "FLAC/assert.h"
 #include "FLAC/stream_decoder.h"
diff --git a/src/test_libFLAC/metadata_manip.c 
b/src/test_libFLAC/metadata_manip.c
index 4214383..6644e79 100644
--- a/src/test_libFLAC/metadata_manip.c
+++ b/src/test_libFLAC/metadata_manip.c
@@ -27,9 +27,13 @@
 #include <sys/utime.h> /* for utime() */
 #include <io.h> /* for chmod() */
 #if _MSC_VER <= 1600 /* @@@ [2G limit] */
+#ifndef fseeko
 #define fseeko fseek
+#endif
+#ifndef ftello
 #define ftello ftell
 #endif
+#endif
 #else
 #include <sys/types.h> /* some flavors of BSD (like OS X) require this to get 
time_t */
 #include <utime.h> /* for utime() */

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