From: Arne Schwabe Date: Thu, 22 Apr 2021 15:29:36 +0000 (+0200) Subject: Move direct.h header where it is used X-Git-Tag: v2.6_beta1~516 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8c18d7c9323084d1b346ea303cf8cfd60d280e56;p=thirdparty%2Fopenvpn.git Move direct.h header where it is used 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 Acked-by: Gert Doering 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 --- diff --git a/config-msvc.h b/config-msvc.h index 2d5e1a51c..9465491dd 100644 --- a/config-msvc.h +++ b/config-msvc.h @@ -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 diff --git a/configure.ac b/configure.ac index 747325164..b830abcc0 100644 --- a/configure.ac +++ b/configure.ac @@ -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 \ diff --git a/src/openvpn/platform.c b/src/openvpn/platform.c index 45ee54541..c63c1d994 100644 --- a/src/openvpn/platform.c +++ b/src/openvpn/platform.c @@ -39,6 +39,10 @@ #include "platform.h" +#if _WIN32 +#include +#endif + /* Redefine the top level directory of the filesystem * to restrict access to files for security */ void diff --git a/src/openvpn/syshead.h b/src/openvpn/syshead.h index e7657b880..42465d01d 100644 --- a/src/openvpn/syshead.h +++ b/src/openvpn/syshead.h @@ -100,10 +100,6 @@ #include #endif -#ifdef HAVE_DIRECT_H -#include -#endif - #ifdef HAVE_IO_H #include #endif