try to limit the #defines (of fseeko to fseek and ftello to ftell) to just the versions of MSVC that appear not to have fseeko()/ftello()

This commit is contained in:
Josh Coalson
2006-10-03 01:16:59 +00:00
parent 799c700f84
commit 825e72cf57
13 changed files with 28 additions and 15 deletions

View File

@@ -28,10 +28,11 @@
#endif
#if defined _MSC_VER || defined __MINGW32__
#include <sys/types.h> /* for off_t */
//@@@ [2G limit] hacks for MSVC6
#if _MSC_VER <= 1200 /* @@@ [2G limit] */
#define fseeko fseek
#define ftello ftell
#endif
#endif
#include <errno.h>
#include <math.h> /* for floor() */
#include <stdio.h> /* for FILE etc. */
@@ -647,7 +648,7 @@ FLAC__bool write_iff_headers(FILE *f, DecoderSession *decoder_session, FLAC__uin
if(!write_little_endian_uint32(f, decoder_session->sample_rate))
return false;
if(!write_little_endian_uint32(f, decoder_session->sample_rate * decoder_session->channels * ((decoder_session->bps+7) / 8))) /* @@@ or is it (sample_rate*channels*bps) / 8 ??? */
if(!write_little_endian_uint32(f, decoder_session->sample_rate * decoder_session->channels * ((decoder_session->bps+7) / 8)))
return false;
if(!write_little_endian_uint16(f, (FLAC__uint16)(decoder_session->channels * ((decoder_session->bps+7) / 8)))) /* block align */

View File

@@ -28,10 +28,11 @@
#endif
#if defined _MSC_VER || defined __MINGW32__
#include <sys/types.h> /* for off_t */
//@@@@@@ [2G limit] hacks for MSVC6
#if _MSC_VER <= 1200 /* @@@ [2G limit] */
#define fseeko fseek
#define ftello ftell
#endif
#endif
#include <errno.h>
#include <limits.h> /* for LONG_MAX */
#include <math.h> /* for floor() */

View File

@@ -42,9 +42,10 @@
#include <sys/utime.h> /* for utime() */
#include <io.h> /* for chmod() */
#include <sys/types.h> /* for off_t */
//@@@ [2G limit] hacks for MSVC6
#if _MSC_VER <= 1200 /* @@@ [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() */

View File

@@ -47,10 +47,11 @@
#include <sys/stat.h> /* for stat() */
#include <sys/types.h> /* for off_t */
#if defined _MSC_VER || defined __MINGW32__
/*@@@ [2G limit] hacks for MSVC6 */
#if _MSC_VER <= 1200 /* @@@ [2G limit] */
#define fseeko fseek
#define ftello ftell
#endif
#endif
#include "FLAC/assert.h"
#include "protected/stream_decoder.h"
#include "private/bitbuffer.h"

View File

@@ -50,10 +50,11 @@
#include <string.h> /* for memcpy() */
#include <sys/types.h> /* for off_t */
#if defined _MSC_VER || defined __MINGW32__
/*@@@ [2G limit] hacks for MSVC6 */
#if _MSC_VER <= 1200 /* @@@ [2G limit] */
#define fseeko fseek
#define ftello ftell
#endif
#endif
#include "FLAC/assert.h"
#include "FLAC/stream_decoder.h"
#include "protected/stream_encoder.h"

View File

@@ -46,10 +46,11 @@
#include <sys/stat.h> /* for stat() */
#include <sys/types.h> /* for off_t */
#if defined _MSC_VER || defined __MINGW32__
/*@@@ [2G limit] hacks for MSVC6 */
#if _MSC_VER <= 1200 /* @@@ [2G limit] */
#define fseeko fseek
#define ftello ftell
#endif
#endif
#include "FLAC/assert.h"
#include "protected/stream_decoder.h"
#include "../libFLAC/include/private/float.h" /* @@@ ugly hack, but how else to do? we need to reuse the float formats but don't want to expose it */

View File

@@ -46,10 +46,11 @@
#include <string.h> /* for memcpy() */
#include <sys/types.h> /* for off_t */
#if defined _MSC_VER || defined __MINGW32__
/*@@@@@@ [2G limit] hacks for MSVC6 */
#if _MSC_VER <= 1200 /* @@@ [2G limit] */
#define fseeko fseek
#define ftello ftell
#endif
#endif
#include "FLAC/assert.h"
#include "OggFLAC/stream_encoder.h"
#include "protected/stream_encoder.h"

View File

@@ -25,10 +25,11 @@
#include <stdlib.h>
#include <string.h>
#if defined _MSC_VER || defined __MINGW32__
//@@@ [2G limit] hacks for MSVC6
#if _MSC_VER <= 1200 /* @@@ [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()

View File

@@ -22,9 +22,10 @@
#if defined _MSC_VER || defined __MINGW32__
#include <sys/utime.h> /* for utime() */
#include <io.h> /* for chmod() */
//@@@ [2G limit] hacks for MSVC6
#if _MSC_VER <= 1200 /* @@@ [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() */

View File

@@ -25,10 +25,11 @@
#include <stdlib.h>
#include <string.h>
#if defined _MSC_VER || defined __MINGW32__
//@@@ [2G limit] hacks for MSVC6
#if _MSC_VER <= 1200 /* @@@ [2G limit] */
#define fseeko fseek
#define ftello ftell
#endif
#endif
#include "decoders.h"
#include "FLAC/assert.h"
#include "FLAC/stream_decoder.h"

View File

@@ -25,9 +25,10 @@
#if defined _MSC_VER || defined __MINGW32__
#include <sys/utime.h> /* for utime() */
#include <io.h> /* for chmod() */
//@@@ [2G limit] hacks for MSVC6
#if _MSC_VER <= 1200 /* @@@ [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() */

View File

@@ -25,10 +25,11 @@
#include <stdlib.h>
#include <string.h>
#if defined _MSC_VER || defined __MINGW32__
//@@@ [2G limit] hacks for MSVC6
#if _MSC_VER <= 1200 /* @@@ [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()

View File

@@ -25,10 +25,11 @@
#include <stdlib.h>
#include <string.h>
#if defined _MSC_VER || defined __MINGW32__
//@@@ [2G limit] hacks for MSVC6
#if _MSC_VER <= 1200 /* @@@ [2G limit] */
#define fseeko fseek
#define ftello ftell
#endif
#endif
#include "decoders.h"
#include "FLAC/assert.h"
#include "OggFLAC/stream_decoder.h"
@@ -36,7 +37,7 @@
#include "test_libs_common/file_utils_oggflac.h"
#include "test_libs_common/metadata_utils.h"
//@@@@@@ this is almost exactly like test_libFLAC/decoders.c, maybe should consolidate some stuff liek client data and callbacks
//@@@@@@ this is almost exactly like test_libFLAC/decoders.c, maybe should consolidate some stuff like client data and callbacks
typedef enum {
LAYER_STREAM = 0, /* FLAC__stream_decoder_init_stream() without seeking */
LAYER_SEEKABLE_STREAM, /* FLAC__stream_decoder_init_stream() with seeking */