Discussion:
[libdvdcss-devel] [PATCH] Fix OS/2 in MPlayers libdvdcss.c
Dave Yeo
2013-01-23 04:00:27 UTC
Permalink
MPlayer now unconditionally defines HAVE_DIRECT_H to 1 if a system has direct.h. This causes Windows code to be used breaking MPlayers OS/2 support

libdvdcss/libdvdcss.c: In function 'dvdcss_open':
libdvdcss/libdvdcss.c:242: error: expected ')' before '*' token
libdvdcss/libdvdcss.c:249: error: 'MAX_PATH' undeclared (first use
in this function)
libdvdcss/libdvdcss.c:249: error: (Each undeclared identifier is
reported only once
libdvdcss/libdvdcss.c:249: error: for each function it appears in.)
libdvdcss/libdvdcss.c:250: error: 'HINSTANCE' undeclared (first use
in this function)
libdvdcss/libdvdcss.c:250: error: expected ';' before 'p_dll'
...
[more errors]

Simple fix attached
Dave
Diego Biurrun
2013-01-25 09:05:00 UTC
Permalink
Post by Dave Yeo
MPlayer now unconditionally defines HAVE_DIRECT_H to 1 if a system has direct.h. This causes Windows code to be used breaking MPlayers OS/2 support
libdvdcss/libdvdcss.c:242: error: expected ')' before '*' token
libdvdcss/libdvdcss.c:249: error: 'MAX_PATH' undeclared (first use
in this function)
libdvdcss/libdvdcss.c:249: error: (Each undeclared identifier is
reported only once
libdvdcss/libdvdcss.c:249: error: for each function it appears in.)
libdvdcss/libdvdcss.c:250: error: 'HINSTANCE' undeclared (first use
in this function)
libdvdcss/libdvdcss.c:250: error: expected ';' before 'p_dll'
...
[more errors]
Simple fix attached
Dave
--- src/libdvdcss.c (revision 256)
+++ src/libdvdcss.c (working copy)
@@ -238,7 +238,7 @@
*/
if( psz_cache == NULL || psz_cache[0] == '\0' )
{
-#ifdef HAVE_DIRECT_H
+#ifdef WIN32
typedef HRESULT( WINAPI *SHGETFOLDERPATH )
( HWND, int, HANDLE, DWORD, LPTSTR );
I believe this is correct, but I suspect the direct.h #include
could also be removed along with this change. That would require
testing on Windows and/or MSVC and/or MinGW though.

Diego
Jean-Baptiste Kempf
2013-01-25 11:19:07 UTC
Permalink
Post by Diego Biurrun
I believe this is correct, but I suspect the direct.h #include
could also be removed along with this change. That would require
testing on Windows and/or MSVC and/or MinGW though.
The patch is OK, but the code for Win32 is broken anyway...

Best regards,
--
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device
Jean-Baptiste Kempf
2013-01-30 17:21:28 UTC
Permalink
Post by Dave Yeo
MPlayer now unconditionally defines HAVE_DIRECT_H to 1 if a system has direct.h. This causes Windows code to be used breaking MPlayers OS/2 support
Where is mkdir defined on OS/2 ?

Best regards,
--
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device
Dave Yeo
2013-01-30 18:32:58 UTC
Permalink
Post by Jean-Baptiste Kempf
Post by Dave Yeo
MPlayer now unconditionally defines HAVE_DIRECT_H to 1 if a system has direct.h. This causes Windows code to be used breaking MPlayers OS/2 support
Where is mkdir defined on OS/2 ?
For kLIBC and EMX stdlib.h, direct.h and with the right defines sys/stat.h.
Dave
Dave

Loading...