Skip to content

Commit

Permalink
decoder/mpg123: use mpg123_ssize_t only on MPG123_API_VERSION >= 47
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxKellermann committed Apr 3, 2024
1 parent 9c2df5c commit d563f5f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/decoder/plugins/Mpg123DecoderPlugin.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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<mpd_mpg123_iohandle *>(_iohandle);
Expand Down

0 comments on commit d563f5f

Please sign in to comment.