[MPlayer-dev-eng] [PATCH] MNG detection fails with libjpeg-turbo

The Wanderer wanderer at fastmail.fm
Sun Nov 26 22:36:34 EET 2017


With current SVN (and for as long as I can remember checking), the
configure check for the availability of libmng fails. Today I finally
got around to looking into why.


The test performs a compile check against libmng.h, which includes
jpeglib.h. With libjpeg-turbo (the source of jpeglib.h in current
Debian), this test fails because FILE is undefined. This is typedef is
normally expected to come from stdio.h.

https://github.com/libjpeg-turbo/libjpeg-turbo/issues/17
indicates that this is intentional, for backwards compatibility with
libjpeg, and that "it is actually a design requirement of the libjpeg
API that you include stdio.h before including jpeglib.h.".

This would seem to indicate that this has been broken for a very long
time, and quite possibly no one noticed (which would imply that no one
bothered trying to compile with MNG support). The last MNG-related
commits seem to have been in 2012; support was originally added in 2011.


The compilation check is performed by the return_statement_check
function, which only permits passing one header-file argument. There is
an existing statement_check_broken function, specifically for use with
headers which don't include some of their own dependencies; however, it
hardcodes a 'return 0', whereas return_statement_check permits passing
in an expression to be used in the return statement.

Rather than try to add an ' 0' to all callers of statement_check_broken,
I've duplicated it into return_statement_check_broken, which adds the
return-statement argument from return_statement_check.

With that, detection of libmng succeeds. With an include of stdio.h
added to vo_mng.c, compilation also succeeds.

The attached patch makes both changes.

-- 
   The Wanderer

The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all
progress depends on the unreasonable man.         -- George Bernard Shaw
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libmng-detection-fix.diff
Type: text/x-diff
Size: 1177 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20171126/72872f03/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20171126/72872f03/attachment.sig>


More information about the MPlayer-dev-eng mailing list