[libdvdcss-devel] [PATCH] Make dependency on direct.h explicit

Alexander Strasser eclipse7 at gmx.net
Wed Jan 30 19:18:28 CET 2013


Hi Jean-Baptiste!

Jean-Baptiste Kempf wrote:
> On 29 Jan, Alexander Strasser wrote :
> >   I attached a patch to fix libdvdcss build on OS/2
> > from inside MPlayer source directory.

  I am not sure I made this clear enough. So I will try to
do it now.

  According to my knowledge these conditional compilation
constructs based on have DIRECT_H came in about 2002/2003.
Long time has passed since and I am not familiar with all
compilation environments of libdvdcss on Windows.

  There seems something wrong with this code nowadays but
maybe it was even back then. I can't know for sure.

  What I know is that:

  * On OS/2 you do not need to include direct.h and you
    should never take the code path under "#ifdef HAVE_DIRECT_H"
    later in the code, because it fails to compile and
    OS/2 code is actually in the #else part

  * On Cygwin there is no direct.h for me

  * On MinGW there is direct.h but it is seems not to be needed
    in my version. At least everything compiles fine. It may have
    been needed at some point.

  * Regardign MSVC I do not know. It doesn't seem impossible
    that it needs/needed direct.h but I did not yet find docs
    that state a non-underscored version is/was available.

  So I tested removing direct.h #inlcude completely and
putting the remaining "#ifdef HAVE_DIRECT_H" block under
"#ifdef WIN32". This is identical to the patch Diego sent
and it works for me on Linux, Cygwin and MinGW. It should
surely work on OS/2 too.

> This patch is even more wrong than the previous ones: where are
> direct.h functions being used on this chunk of code?

  This is the most conservative solution I could think of.
It does not behave any different than before besides it
only does so on platforms where WIN32 is defined. So if
HAVE_DIRECT_H is defined on e.g. OS/2 it still will behaved
as if it was not defined. It therefore un-breaks OS/2 build
for MPlayer.

  I thought it might be of value in case we don't find testers
for all platforms involved.

  If we can safely drop HAVE_DIRECT_H that might be of course
the best solution.

  Alexander


More information about the libdvdcss-devel mailing list