[tz] [PATCH] Fix MinGW builds by adding MKDIR_TAKES_ONE_ARG

esben.haabendal at gmail.com esben.haabendal at gmail.com
Tue Feb 23 10:21:31 UTC 2016


From: Esben Haabendal <esben at haabendal.dk>

On MinGW, we have non-standard mkdir() which only takes one argument.

Signed-off-by: Esben Haabendal <esben at haabendal.dk>
---
 Makefile  | 1 +
 private.h | 5 +++++
 2 files changed, 6 insertions(+)

diff --git a/Makefile b/Makefile
index 568f7f6..a789fee 100644
--- a/Makefile
+++ b/Makefile
@@ -125,6 +125,7 @@ LDLIBS=
 #  -DHAVE_SYS_WAIT_H=0 if your compiler lacks a "sys/wait.h"
 #  -DHAVE_TZSET=0 if your system lacks a tzset function
 #  -DHAVE_UNISTD_H=0 if your compiler lacks a "unistd.h" (Microsoft C++ 7?)
+#  -DMKDIR_TAKES_ONE_ARG if your mkdir takes one arg (MinGW)
 #  -DNO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU=1
 #	if you do not want run time warnings about formats that may cause
 #	year 2000 grief
diff --git a/private.h b/private.h
index 1c176e6..b2e7ecb 100644
--- a/private.h
+++ b/private.h
@@ -58,6 +58,11 @@
 #define HAVE_UTMPX_H		1
 #endif /* !defined HAVE_UTMPX_H */
 
+#ifdef MKDIR_TAKES_ONE_ARG
+#include <sys/stat.h>
+#define mkdir(path,mode) mkdir(path)
+#endif
+
 #ifndef NETBSD_INSPIRED
 # define NETBSD_INSPIRED 1
 #endif
-- 
2.7.1



More information about the tz mailing list