Discussion:
[libdvdcss-devel] [PATCH] build: Replace system-specific ifdeffery by proper _mkdir() check
Diego Biurrun
2013-02-14 00:22:27 UTC
Permalink
Signed-off-by: Diego Biurrun <***@biurrun.de>
---
configure.ac | 2 ++
src/libdvdcss.c | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index f9e6b84..9c2e9c5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -55,6 +55,8 @@ AC_CHECK_HEADERS(windows.h,[
])
])

+AC_CHECK_FUNCS(_mkdir)
+
dnl for Un*x and BeOS
AC_CHECK_HEADERS(sys/ioctl.h,[
CAN_BUILD_LIBDVDCSS=1
diff --git a/src/libdvdcss.c b/src/libdvdcss.c
index cd92326..3713c59 100644
--- a/src/libdvdcss.c
+++ b/src/libdvdcss.c
@@ -128,7 +128,7 @@
#include "ioctl.h"
#include "device.h"

-#if defined(WIN32) && !defined(__CYGWIN__)
+#ifdef HAVE__MKDIR
#include <direct.h>
#define mkdir(a, b) _mkdir(a)
#endif
--
1.7.9.5
Diego Biurrun
2013-02-14 00:42:16 UTC
Permalink
Post by Diego Biurrun
--- a/configure.ac
+++ b/configure.ac
@@ -55,6 +55,8 @@ AC_CHECK_HEADERS(windows.h,[
+AC_CHECK_FUNCS(_mkdir)
+
--- a/src/libdvdcss.c
+++ b/src/libdvdcss.c
@@ -128,7 +128,7 @@
#include "ioctl.h"
#include "device.h"
-#if defined(WIN32) && !defined(__CYGWIN__)
+#ifdef HAVE__MKDIR
#include <direct.h>
#define mkdir(a, b) _mkdir(a)
#endif
Fails on Cygwin, which has _mkdir(), but no direct.h.

Diego
Diego Biurrun
2013-02-14 01:02:37 UTC
Permalink
Signed-off-by: Diego Biurrun <***@biurrun.de>
---

Now checking for mkdir() instead of _mkdir(), this works on Cygwin.

configure.ac | 2 ++
src/libdvdcss.c | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index f9e6b84..4912dba 100644
--- a/configure.ac
+++ b/configure.ac
@@ -55,6 +55,8 @@ AC_CHECK_HEADERS(windows.h,[
])
])

+AC_CHECK_FUNCS(mkdir)
+
dnl for Un*x and BeOS
AC_CHECK_HEADERS(sys/ioctl.h,[
CAN_BUILD_LIBDVDCSS=1
diff --git a/src/libdvdcss.c b/src/libdvdcss.c
index cd92326..4c2aa23 100644
--- a/src/libdvdcss.c
+++ b/src/libdvdcss.c
@@ -128,7 +128,7 @@
#include "ioctl.h"
#include "device.h"

-#if defined(WIN32) && !defined(__CYGWIN__)
+#ifndef HAVE_MKDIR
#include <direct.h>
#define mkdir(a, b) _mkdir(a)
#endif
--
1.7.9.5
Jean-Baptiste Kempf
2013-02-14 01:04:40 UTC
Permalink
Post by Diego Biurrun
---
Now checking for mkdir() instead of _mkdir(), this works on Cygwin.
And breaks on MingW.
--
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device
Loading...