summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.ac2
-rw-r--r--options.c1
-rw-r--r--win/config.h.in28
-rw-r--r--win/msvc.mak.in2
4 files changed, 30 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index d147d38..f904db4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -521,7 +521,7 @@ AC_CHECK_FUNCS(daemon chroot getpwnam setuid nice system getpid dup dup2 dnl
getpass strerror syslog openlog mlockall getgrnam setgid dnl
setgroups stat flock readv writev time dnl
setsid chdir putenv getpeername unlink dnl
- chsize ftruncate execve getpeereid umask basename dirname)
+ chsize ftruncate execve getpeereid umask basename dirname access)
# Windows use stdcall for winsock so we cannot auto detect these
m4_define([SOCKET_FUNCS], [socket recv recvfrom send sendto listen dnl
diff --git a/options.c b/options.c
index 67206aa..19792e9 100644
--- a/options.c
+++ b/options.c
@@ -52,7 +52,6 @@
#include "configure.h"
#include "forward.h"
#include <ctype.h>
-#include <unistd.h>
#include "memdbg.h"
diff --git a/win/config.h.in b/win/config.h.in
index e9df379..b5c31b8 100644
--- a/win/config.h.in
+++ b/win/config.h.in
@@ -223,6 +223,34 @@ typedef unsigned long in_addr_t;
/* Special Windows version of getpass() defined in io.c */
#define HAVE_GETPASS 1
+
+/* The POSIX access() function is available, but requires
+ * _CRT_NONSTDC_NO_WARNINGS and _CRT_SECURE_NO_WARNINGS
+ * to be defined
+ */
+#define HAVE_ACCESS 1
+
+/* Macros used by the POSIX access() function might not be available on Windows.
+ * Based on information found here:
+ * http://msdn.microsoft.com/en-us/library/1w06ktdy%28v=vs.80%29.aspx
+ */
+#ifndef R_OK
+#define R_OK 4
+#endif
+
+#ifndef W_OK
+#define W_OK 2
+#endif
+
+#ifndef X_OK
+#define X_OK 1
+#endif
+
+#ifndef F_OK
+#define F_OK 0
+#endif
+
+
/* Define to the full name and version of this package. */
#ifdef DEBUG_LABEL
#define PACKAGE_STRING PACKAGE_NAME " " PACKAGE_VERSION " " DEBUG_LABEL
diff --git a/win/msvc.mak.in b/win/msvc.mak.in
index 26d7a33..115e395 100644
--- a/win/msvc.mak.in
+++ b/win/msvc.mak.in
@@ -38,7 +38,7 @@ LIB_DIRS = -LIBPATH:$(OPENSSL)\lib -LIBPATH:$(POLARSSL)\build\library -LIBPATH:$
EXE = openvpn.exe
CPP=cl.exe
-CPP_ARG_COMMON=/nologo /W3 -DWIN32 -DWIN32_LEAN_AND_MEAN -D_CONSOLE -D_MBCS -D_CRT_SECURE_NO_DEPRECATE $(INCLUDE_DIRS) /FD /c
+CPP_ARG_COMMON=/nologo /W3 -DWIN32 -DWIN32_LEAN_AND_MEAN -D_CONSOLE -D_MBCS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS $(INCLUDE_DIRS) /FD /c
LINK32=link.exe