From d563f5fc8773832dcf986b7edcf30c4fdeb7a987 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 3 Apr 2024 23:20:51 +0200 Subject: [PATCH] decoder/mpg123: use mpg123_ssize_t only on MPG123_API_VERSION >= 47 --- src/decoder/plugins/Mpg123DecoderPlugin.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/decoder/plugins/Mpg123DecoderPlugin.cxx b/src/decoder/plugins/Mpg123DecoderPlugin.cxx index 1bc40db82..9adaef3c3 100644 --- a/src/decoder/plugins/Mpg123DecoderPlugin.cxx +++ b/src/decoder/plugins/Mpg123DecoderPlugin.cxx @@ -64,7 +64,14 @@ struct mpd_mpg123_iohandle { InputStream &is; }; -static mpg123_ssize_t +static +#if MPG123_API_VERSION >= 47 +/* this typedef was added to libmpg123 somewhere between 1.26.4 (45) + and 1.31.2 (47) */ +mpg123_ssize_t +#else +ssize_t +#endif mpd_mpg123_read(void *_iohandle, void *data, size_t size) noexcept { auto &iohandle = *reinterpret_cast(_iohandle);