From 7a1393882d000005ff34a31f72c7c3a256e42dd6 Mon Sep 17 00:00:00 2001 From: Josh Coalson Date: Fri, 11 May 2007 00:48:14 +0000 Subject: [PATCH] msvc fixes --- src/utils/flacdiff/main.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/utils/flacdiff/main.cpp b/src/utils/flacdiff/main.cpp index a777a7e8..73bfac8a 100644 --- a/src/utils/flacdiff/main.cpp +++ b/src/utils/flacdiff/main.cpp @@ -23,6 +23,12 @@ #include #include #include "FLAC++/decoder.h" +#if defined _MSC_VER || defined __MINGW32__ +#if _MSC_VER <= 1600 /* @@@ [2G limit] */ +#define fseeko fseek +#define ftello ftell +#endif +#endif class AutoFILE { protected: @@ -52,9 +58,9 @@ protected: virtual ::FLAC__StreamDecoderReadStatus read_callback(FLAC__byte buffer[], size_t *bytes) { *bytes = fread(buffer, 1, *bytes, f_); - if(ferror(f_)) + if(ferror((FILE*)f_)) return ::FLAC__STREAM_DECODER_READ_STATUS_ABORT; - else if(*bytes == 0 && feof(f_)) + else if(*bytes == 0 && feof((FILE*)f_)) return ::FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM; else return ::FLAC__STREAM_DECODER_READ_STATUS_CONTINUE; @@ -71,7 +77,7 @@ protected: virtual bool eof_callback() { - return feof(f_); + return feof((FILE*)f_); } virtual ::FLAC__StreamDecoderWriteStatus write_callback(const ::FLAC__Frame *frame, const FLAC__int32 * const /*buffer*/[])