From 5e7a4b4d62f257172f049c2748e5437c68bf056a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Fri, 15 Apr 2016 19:55:03 +0100 Subject: [PATCH] mpg123: fix build with msvc Fix syntax errors when compiling against cerbero-provided libmpg123 headers. We do the same as the libmpg123 internal visual studio build here. mpg123.h(1378): error C2143: syntax error: missing ')' before '(' mpg123.h(1378): error C2081: 'ssize_t': name in formal parameter list illegal mpg123.h(1378): error C2143: syntax error: missing ')' before '*' mpg123.h(1378): error C2091: function returns function mpg123.h(1378): error C2143: syntax error: missing '{' before '*' mpg123.h(1378): error C2059: syntax error: ')' mpg123.h(1379): error C2143: syntax error: missing ')' before '*' mpg123.h(1379): error C2365: 'off_t': redefinition; previous definition was 'typedef' ... --- ext/mpg123/gstmpg123audiodec.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ext/mpg123/gstmpg123audiodec.h b/ext/mpg123/gstmpg123audiodec.h index e837a56b0c..b865c417ae 100644 --- a/ext/mpg123/gstmpg123audiodec.h +++ b/ext/mpg123/gstmpg123audiodec.h @@ -19,6 +19,18 @@ #ifndef __GST_MPG123_AUDIO_DEC_H__ #define __GST_MPG123_AUDIO_DEC_H__ +/* This is what the visual studio build in mpg123 does before including the + * original header file. Without this we get syntax errors in the + * replace_reader function declarations because it doesn't know ssize_t etc. + * It doesn't realy matter for us if the ssize_t typedef here is correct. */ +#ifdef _MSC_VER +#include +#include +#include +typedef long ssize_t; +#include +#endif + #include #include #include