diff options
author | Erik de Castro Lopo <erikd@mega-nerd.com> | 2013-03-14 18:22:29 +1100 |
---|---|---|
committer | Erik de Castro Lopo <erikd@mega-nerd.com> | 2013-03-14 18:22:37 +1100 |
commit | f25b2602dce3c09098e3092bfad983e3ec7fdb4f (patch) | |
tree | ca2eba807a5d839dc3f817ab71e0a4486b0f0682 /include | |
parent | 6497ce19770ec48d565f3a043cc74c9c389c7829 (diff) | |
download | flac-f25b2602dce3c09098e3092bfad983e3ec7fdb4f.tar.gz |
Fix a couple of Windows 2Gig file size issues.
Patch submitted by Janne Hyvärinen <cse@sci.fi>.
Diffstat (limited to 'include')
-rw-r--r-- | include/share/compat.h | 17 | ||||
-rw-r--r-- | include/share/grabbag/file.h | 3 | ||||
-rw-r--r-- | include/test_libs_common/file_utils_flac.h | 3 |
3 files changed, 9 insertions, 14 deletions
diff --git a/include/share/compat.h b/include/share/compat.h index 279e8660..d056b0b0 100644 --- a/include/share/compat.h +++ b/include/share/compat.h @@ -48,20 +48,13 @@ #if defined _MSC_VER || defined __BORLANDC__ || defined __MINGW32__ #include <sys/types.h> /* for off_t */ -#if !defined __MINGW32__ /* @@@ [2G limit] */ -#ifndef fseeko -#define fseeko fseek -#endif -#ifndef ftello -#define ftello ftell +#define FLAC__off_t __int64 /* use this instead of off_t to fix the 2 GB limit */ +#if !defined __MINGW32__ +#define fseeko _fseeki64 +#define ftello _ftelli64 #endif #else -/* MinGW */ -#if !defined(HAVE_FSEEKO) -# define fseeko fseeko64 -# define ftello ftello64 -#endif -#endif +#define FLAC__off_t off_t #endif #if HAVE_INTTYPES_H diff --git a/include/share/grabbag/file.h b/include/share/grabbag/file.h index 62b29079..98bccfbc 100644 --- a/include/share/grabbag/file.h +++ b/include/share/grabbag/file.h @@ -31,13 +31,14 @@ #include <sys/types.h> /* for off_t */ #include <stdio.h> /* for FILE */ #include "FLAC/ordinals.h" +#include "share/compat.h" #ifdef __cplusplus extern "C" { #endif void grabbag__file_copy_metadata(const char *srcpath, const char *destpath); -off_t grabbag__file_get_filesize(const char *srcpath); +FLAC__off_t grabbag__file_get_filesize(const char *srcpath); const char *grabbag__file_get_basename(const char *srcpath); /* read_only == false means "make file writable by user" diff --git a/include/test_libs_common/file_utils_flac.h b/include/test_libs_common/file_utils_flac.h index e802fcad..c92bac06 100644 --- a/include/test_libs_common/file_utils_flac.h +++ b/include/test_libs_common/file_utils_flac.h @@ -26,9 +26,10 @@ #include "FLAC/format.h" #include <sys/types.h> /* for off_t */ +#include "share/compat.h" extern const long file_utils__ogg_serial_number; -FLAC__bool file_utils__generate_flacfile(FLAC__bool is_ogg, const char *output_filename, off_t *output_filesize, unsigned length, const FLAC__StreamMetadata *streaminfo, FLAC__StreamMetadata **metadata, unsigned num_metadata); +FLAC__bool file_utils__generate_flacfile(FLAC__bool is_ogg, const char *output_filename, FLAC__off_t *output_filesize, unsigned length, const FLAC__StreamMetadata *streaminfo, FLAC__StreamMetadata **metadata, unsigned num_metadata); #endif |