]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Move direct.h header where it is used
authorArne Schwabe <arne@rfc2549.org>
Thu, 22 Apr 2021 15:29:36 +0000 (17:29 +0200)
committerGert Doering <gert@greenie.muc.de>
Mon, 3 May 2021 06:07:25 +0000 (08:07 +0200)
The direct.h header provides only a handful of functions [1] of which
we only use _wchdir. Directly included the direct.h file where it is
used and remove autoconf magic around it.

[1]
https://docs.microsoft.com/en-us/previous-versions/visualstudio/visual-stud
io-2012/as5kw0ze(v=vs.110)?redirectedfrom=MSDN

Patch V2: also remove from config-msvc.h

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20210422152939.2134046-3-arne@rfc2549.org>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg22202.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
config-msvc.h
configure.ac
src/openvpn/platform.c
src/openvpn/syshead.h

index 2d5e1a51ce139b56858bd5aa60f37166a556c454..9465491ddbb1bcc465309ef61b0242d6d06edeee 100644 (file)
@@ -30,7 +30,6 @@
 #define HAVE_WINSOCK2_H 1
 #define HAVE_WS2TCPIP_H 1
 #define HAVE_IO_H 1
-#define HAVE_DIRECT_H 1
 #define HAVE_SYS_TYPES_H 1
 #define HAVE_SYS_STAT_H 1
 #define HAVE_LZO_LZO1X_H 1
index 74732516471807ad50b788605cef76a16dfe37cd..b830abcc0d67f0c2305f0dbaea2eca6d76cfb70f 100644 (file)
@@ -414,7 +414,7 @@ AX_TYPE_SOCKLEN_T
 AC_CHECK_SIZEOF([unsigned int])
 AC_CHECK_SIZEOF([unsigned long])
 AC_CHECK_HEADERS([ \
-       fcntl.h io.h direct.h \
+       fcntl.h io.h \
        sys/types.h sys/socket.h \
        unistd.h dlfcn.h \
        netinet/in.h netinet/in_systm.h \
index 45ee5454143cc086b34641995773e2415a477754..c63c1d994c55893ce204ecb66b8e1031e5412856 100644 (file)
 
 #include "platform.h"
 
+#if _WIN32
+#include <direct.h>
+#endif
+
 /* Redefine the top level directory of the filesystem
  * to restrict access to files for security */
 void
index e7657b880c011a581cc6838896a0bd0f5369b69e..42465d01d4fc7fadf9554dc18288a326078495a1 100644 (file)
 #include <fcntl.h>
 #endif
 
-#ifdef HAVE_DIRECT_H
-#include <direct.h>
-#endif
-
 #ifdef HAVE_IO_H
 #include <io.h>
 #endif