summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartijn van Beurden <mvanb1@gmail.com>2022-08-06 20:32:28 +0200
committerGitHub <noreply@github.com>2022-08-06 20:32:28 +0200
commit3022dad831f9ab5e428a785525b9a346343209e6 (patch)
tree8737b1b4c9cb55522f621d0feb4c8b27b3d585e7 /src
parent428e681784b57de38bdb94924e642e071799c703 (diff)
downloadflac-3022dad831f9ab5e428a785525b9a346343209e6.tar.gz
Fix and warning for MSVC with Windows XP toolset (#399)
A warning and a small workaround is added for building libFLAC on MSVC with a specific Windows XP targeting toolset.
Diffstat (limited to 'src')
-rw-r--r--src/libFLAC/stream_decoder.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/libFLAC/stream_decoder.c b/src/libFLAC/stream_decoder.c
index 69645c40..e3031a14 100644
--- a/src/libFLAC/stream_decoder.c
+++ b/src/libFLAC/stream_decoder.c
@@ -3652,7 +3652,13 @@ FLAC__StreamDecoderLengthStatus file_length_callback_(const FLAC__StreamDecoder
if(decoder->private_->file == stdin)
return FLAC__STREAM_DECODER_LENGTH_STATUS_UNSUPPORTED;
- else if(flac_fstat(fileno(decoder->private_->file), &filestats) != 0)
+
+#ifndef FLAC__USE_FILELENGTHI64
+ if(flac_fstat(fileno(decoder->private_->file), &filestats) != 0)
+#else
+ filestats.st_size = _filelengthi64(fileno(decoder->private_->file));
+ if(filestats.st_size < 0)
+#endif
return FLAC__STREAM_DECODER_LENGTH_STATUS_ERROR;
else {
*stream_length = (FLAC__uint64)filestats.st_size;