[libdvdcss-devel] [PATCH] build: win32: Surround Windows-specific code by appropriate ifdef

Diego Biurrun diego at biurrun.de
Fri Feb 1 13:05:51 CET 2013


Also move the direct.h #include into that block and drop the direct.h
configure.ac check. That header file is always available on Windows.

Signed-off-by: Diego Biurrun <diego at biurrun.de>
---
 configure.ac    |    3 ---
 src/libdvdcss.c |    7 ++-----
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/configure.ac b/configure.ac
index ca2e708..326db26 100644
--- a/configure.ac
+++ b/configure.ac
@@ -57,9 +57,6 @@ CAN_BUILD_LIBDVDCSS=0
 
 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
   ],,[
diff --git a/src/libdvdcss.c b/src/libdvdcss.c
index 4a09084..0b2c20f 100644
--- 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"
@@ -242,7 +238,8 @@ LIBDVDCSS_EXPORT dvdcss_t dvdcss_open ( char *psz_target )
      */
     if( psz_cache == NULL || psz_cache[0] == '\0' )
     {
-#ifdef HAVE_DIRECT_H
+#if defined(WIN32)
+#include <direct.h>
         typedef HRESULT( WINAPI *SHGETFOLDERPATH )
                        ( HWND, int, HANDLE, DWORD, LPTSTR );
 
-- 
1.7.9.5



More information about the libdvdcss-devel mailing list