From b3219b2766d6f6462d1be843bc497595ba0b33ac Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 5 Sep 2017 19:30:27 +0200 Subject: [PATCH] Update libFLAC - not portable enough --- core/cd_hw/libchdr/deps/libFLAC/include/private/macros.h | 1 - core/cd_hw/libchdr/deps/libFLAC/include/share/compat.h | 4 ++-- core/cd_hw/libchdr/deps/libFLAC/stream_decoder.c | 8 ++++++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/core/cd_hw/libchdr/deps/libFLAC/include/private/macros.h b/core/cd_hw/libchdr/deps/libFLAC/include/private/macros.h index becc59f..a5d9a90 100644 --- a/core/cd_hw/libchdr/deps/libFLAC/include/private/macros.h +++ b/core/cd_hw/libchdr/deps/libFLAC/include/private/macros.h @@ -50,7 +50,6 @@ /* Whatever other unix that has sys/param.h */ #elif defined(HAVE_SYS_PARAM_H) -#include #define flac_max(a,b) MAX(a,b) #define flac_min(a,b) MIN(a,b) diff --git a/core/cd_hw/libchdr/deps/libFLAC/include/share/compat.h b/core/cd_hw/libchdr/deps/libFLAC/include/share/compat.h index 4f33bc1..2083f3a 100644 --- a/core/cd_hw/libchdr/deps/libFLAC/include/share/compat.h +++ b/core/cd_hw/libchdr/deps/libFLAC/include/share/compat.h @@ -144,7 +144,7 @@ # endif #endif /* defined _MSC_VER */ -#if defined(_WIN32) && defined(NEED_UTF8_SUPPORT) +#ifdef _WIN32 /* All char* strings are in UTF-8 format. Added to support Unicode files on Windows */ #include "share/win_utf8_io.h" @@ -175,7 +175,7 @@ #endif -#if defined _MSC_VER +#ifdef _WIN32 #define flac_stat_s __stat64 /* stat struct */ #define flac_fstat _fstat64 #else diff --git a/core/cd_hw/libchdr/deps/libFLAC/stream_decoder.c b/core/cd_hw/libchdr/deps/libFLAC/stream_decoder.c index d364b0c..7c8a26e 100644 --- a/core/cd_hw/libchdr/deps/libFLAC/stream_decoder.c +++ b/core/cd_hw/libchdr/deps/libFLAC/stream_decoder.c @@ -3356,7 +3356,11 @@ FLAC__StreamDecoderSeekStatus file_seek_callback_(const FLAC__StreamDecoder *dec if(decoder->private_->file == stdin) return FLAC__STREAM_DECODER_SEEK_STATUS_UNSUPPORTED; +#ifdef __CELLOS_LV2__ + else if(fseek(decoder->private_->file, (FLAC__off_t)absolute_byte_offset, SEEK_SET) < 0) +#else else if(fseeko(decoder->private_->file, (FLAC__off_t)absolute_byte_offset, SEEK_SET) < 0) +#endif return FLAC__STREAM_DECODER_SEEK_STATUS_ERROR; else return FLAC__STREAM_DECODER_SEEK_STATUS_OK; @@ -3369,7 +3373,11 @@ FLAC__StreamDecoderTellStatus file_tell_callback_(const FLAC__StreamDecoder *dec if(decoder->private_->file == stdin) return FLAC__STREAM_DECODER_TELL_STATUS_UNSUPPORTED; +#ifdef __CELLOS_LV2__ + else if((pos = ftell(decoder->private_->file)) < 0) +#else else if((pos = ftello(decoder->private_->file)) < 0) +#endif return FLAC__STREAM_DECODER_TELL_STATUS_ERROR; else { *absolute_byte_offset = (FLAC__uint64)pos;