shithub: libdvdcss

Download patch

ref: 618d5b8125a10c9a7e584a15f2cfac4ea12c7a7c
parent: fb0405ccb37a2f9bf9e78e734e15332013325c42
author: Steve Lhomme <robux@videolan.org>
date: Sun Sep 4 04:25:26 EDT 2005

* libdvdcss: MSVC7 compilation fixes (shouldn't break mingw32)

--- a/src/common.h
+++ b/src/common.h
@@ -46,11 +46,11 @@
 
 #if defined( WIN32 )
 
-#ifndef PATH_MAX
-#   define PATH_MAX MAX_PATH
-#endif
+#   ifndef PATH_MAX
+#      define PATH_MAX MAX_PATH
+#   endif
 
-#define lseek _lseeki64
+#   define lseek64 _lseeki64
 
 /* several type definitions */
 #   if defined( __MINGW32__ )
@@ -76,6 +76,10 @@
 #   ifndef snprintf
 #       define snprintf _snprintf  /* snprintf not defined in mingw32 (bug?) */
 #   endif
+
+#else
+
+#   define lseek64 lseek
 
 #endif
 
--- a/src/ioctl.h
+++ b/src/ioctl.h
@@ -318,8 +318,8 @@
  * win32 aspi specific
  *****************************************************************************/
 
-typedef WINAPI DWORD (*GETASPI32SUPPORTINFO)(VOID);
-typedef WINAPI DWORD (*SENDASPI32COMMAND)(LPVOID);
+typedef DWORD (CALLBACK *GETASPI32SUPPORTINFO)(VOID);
+typedef DWORD (CALLBACK *SENDASPI32COMMAND)(LPVOID);
 
 #define WIN2K               ( GetVersion() < 0x80000000 )
 #define ASPI_HAID           0
--- a/src/libdvdcss.h
+++ b/src/libdvdcss.h
@@ -78,6 +78,19 @@
  * Functions used across the library
  *****************************************************************************/
 #define print_error(dvdcss,msg) _print_error(dvdcss,msg)
+#if defined( _MSC_VER )
+#include <stdarg.h>
+__forceinline void print_debug(dvdcss_t dvdcss, const char *msg,...)
+{
+	va_list args;
+
+    fprintf( stderr, "libdvdcss debug: " );
+	va_start( args, msg );
+    vfprintf( stderr, msg, args );
+	va_end( args );
+    fprintf( stderr, "\n" );
+}
+#else
 #define print_debug(dvdcss,msg,args...) \
     if( dvdcss->b_debug ) \
     { \
@@ -85,6 +98,7 @@
         fprintf( stderr, msg, ##args ); \
         fprintf( stderr, "\n" ); \
     }
+#endif
 
 void _print_error ( dvdcss_t, char * );