shithub: libdvdcss

Download patch

ref: 77f561a53feaf5b2ebaf55e00e43189c8b9be237
parent: 84b0992477e07748f6a8cb5109ed56616d6b10cb
author: Diego Biurrun <diego@biurrun.de>
date: Wed Feb 13 17:50:00 EST 2013

build: win32: Surround Windows-specific code by appropriate ifdef

Also drop the now unnecessary direct.h configure.ac check.
That header file is always available on Windows.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>

--- a/configure.ac
+++ b/configure.ac
@@ -48,9 +48,6 @@
 
 dnl  for windoze
 AC_CHECK_HEADERS(windows.h,[
-  AC_CHECK_HEADERS(direct.h,,,[
-  #include <windows.h>
-  ])
   AC_CHECK_HEADERS(winioctl.h,[
     CAN_BUILD_LIBDVDCSS=1
   ],,[
--- a/msvc/config.h
+++ b/msvc/config.h
@@ -7,7 +7,6 @@
 /* #undef DVD_STRUCT_IN_SYS_CDIO_H */
 /* #undef DVD_STRUCT_IN_SYS_DVDIO_H */
 /* #undef HAVE_BSD_DVD_STRUCT */
-#define HAVE_DIRECT_H 1
 #define HAVE_DLFCN_H 1
 /* #undef HAVE_DVD_H */
 /* #undef HAVE_INTTYPES_H */
--- a/src/libdvdcss.c
+++ b/src/libdvdcss.c
@@ -120,10 +120,6 @@
 #   include <limits.h>
 #endif
 
-#ifdef HAVE_DIRECT_H
-#   include <direct.h>
-#endif
-
 #include "dvdcss/dvdcss.h"
 
 #include "common.h"
@@ -132,7 +128,8 @@
 #include "ioctl.h"
 #include "device.h"
 
-#if defined(WIN32)
+#if defined(WIN32) && !defined(__CYGWIN__)
+#include <direct.h>
 #define mkdir(a, b) _mkdir(a)
 #endif
 
@@ -242,7 +239,7 @@
      */
     if( psz_cache == NULL || psz_cache[0] == '\0' )
     {
-#ifdef HAVE_DIRECT_H
+#if defined(WIN32) && !defined(__CYGWIN__)
         typedef HRESULT( WINAPI *SHGETFOLDERPATH )
                        ( HWND, int, HANDLE, DWORD, LPTSTR );