Skip to content

Commit

Permalink
mingw32's _fseeki64() / _ftelli64() are broken on i686; use fseeko64(…
Browse files Browse the repository at this point in the history
…) and ftello64() instead
  • Loading branch information
dbry committed Jun 7, 2022
1 parent a41a9b0 commit e9f817d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion cli/utils.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////////////////////
// **** WAVPACK **** //
// Hybrid Lossless Wavefile Compressor //
// Copyright (c) 1998 - 2006 Conifer Software. //
// Copyright (c) 1998 - 2022 David Bryant. //
// All Rights Reserved. //
// Distributed under the BSD Software License (see license.txt) //
////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -38,6 +38,11 @@
#define remove(f) unlink_utf8(f)
#endif

#ifdef __MINGW32__ // mingw32's _ftelli64() and _fseeki64() are defective
#define _ftelli64 ftello64
#define _fseeki64 fseeko64
#endif

#ifdef _WIN32

int copy_timestamp (const char *src_filename, const char *dst_filename)
Expand Down
7 changes: 6 additions & 1 deletion src/open_filename.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////////////////////
// **** WAVPACK **** //
// Hybrid Lossless Wavefile Compressor //
// Copyright (c) 1998 - 2013 Conifer Software. //
// Copyright (c) 1998 - 2022 David Bryant. //
// All Rights Reserved. //
// Distributed under the BSD Software License (see license.txt) //
////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -62,6 +62,11 @@ static FILE *fopen_utf8 (const char *filename_utf8, const char *mode_utf8);
#define ftell ftello
#endif

#ifdef __MINGW32__ // mingw32's _ftelli64() and _fseeki64() are defective
#define _ftelli64 ftello64
#define _fseeki64 fseeko64
#endif

static int32_t read_bytes (void *id, void *data, int32_t bcount)
{
return (int32_t) fread (data, 1, bcount, (FILE*) id);
Expand Down

0 comments on commit e9f817d

Please sign in to comment.