2012-02-29 21:12:12 +01:00
|
|
|
#include <config-msvc-version.h>
|
|
|
|
|
|
|
|
#define CONFIGURE_DEFINES "N/A"
|
|
|
|
|
|
|
|
#define ENABLE_PF 1
|
|
|
|
#define ENABLE_CRYPTO_OPENSSL 1
|
|
|
|
#define ENABLE_FRAGMENT 1
|
|
|
|
#define ENABLE_HTTP_PROXY 1
|
|
|
|
#define ENABLE_LZO 1
|
2016-02-25 22:14:42 +01:00
|
|
|
#define ENABLE_LZ4 1
|
2012-02-29 21:12:12 +01:00
|
|
|
#define ENABLE_MANAGEMENT 1
|
|
|
|
#define ENABLE_PKCS11 1
|
|
|
|
#define ENABLE_PLUGIN 1
|
|
|
|
#define ENABLE_PORT_SHARE 1
|
|
|
|
#define ENABLE_SOCKS 1
|
|
|
|
|
|
|
|
#define HAVE_FCNTL_H 1
|
|
|
|
#define HAVE_STDIO_H 1
|
|
|
|
#define HAVE_STDLIB_H 1
|
|
|
|
#define HAVE_STRERROR 1
|
|
|
|
#define HAVE_STRINGS_H 1
|
|
|
|
#define HAVE_STRING_H 1
|
2012-03-29 11:16:39 +02:00
|
|
|
#define HAVE_LIMITS_H 1
|
2012-02-29 21:12:12 +01:00
|
|
|
#define HAVE_SYSTEM 1
|
|
|
|
#define HAVE_TIME 1
|
|
|
|
#define HAVE_TIME_H 1
|
|
|
|
#define HAVE_WINDOWS_H 1
|
|
|
|
#define HAVE_WINSOCK2_H 1
|
|
|
|
#define HAVE_WS2TCPIP_H 1
|
|
|
|
#define HAVE_IO_H 1
|
|
|
|
#define HAVE_SYS_TYPES_H 1
|
|
|
|
#define HAVE_SYS_STAT_H 1
|
|
|
|
#define HAVE_LZO_LZO1X_H 1
|
|
|
|
#define HAVE_LZO_LZOUTIL_H 1
|
2015-12-29 22:02:37 +01:00
|
|
|
#define HAVE_VERSIONHELPERS_H 1
|
2012-02-29 21:12:12 +01:00
|
|
|
|
|
|
|
#define HAVE_ACCESS 1
|
|
|
|
#define HAVE_CHDIR 1
|
|
|
|
#define HAVE_CHSIZE 1
|
|
|
|
#define HAVE_IN_PKTINFO 1
|
|
|
|
|
|
|
|
#define HAVE_OPENSSL_ENGINE 1
|
2021-10-14 03:04:36 +02:00
|
|
|
|
2020-09-04 01:56:44 +02:00
|
|
|
#define HAVE_DIINSTALLDEVICE 1
|
2012-02-29 21:12:12 +01:00
|
|
|
|
|
|
|
#ifndef __cplusplus
|
|
|
|
#define inline __inline
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define TARGET_WIN32 1
|
|
|
|
#define TARGET_ALIAS "Windows-MSVC"
|
|
|
|
|
|
|
|
#define HAVE_DECL_SO_MARK 0
|
|
|
|
|
|
|
|
#define strncasecmp strnicmp
|
|
|
|
#define strcasecmp _stricmp
|
2015-10-02 13:46:41 +02:00
|
|
|
|
|
|
|
#if _MSC_VER<1900
|
2012-02-29 21:12:12 +01:00
|
|
|
#define snprintf _snprintf
|
2015-10-02 13:46:41 +02:00
|
|
|
#endif
|
2014-04-21 09:10:03 +02:00
|
|
|
|
|
|
|
#if _MSC_VER < 1800
|
2012-02-29 21:12:12 +01:00
|
|
|
#define strtoull strtoul
|
2014-04-21 09:10:03 +02:00
|
|
|
#endif
|
2012-02-29 21:12:12 +01:00
|
|
|
|
|
|
|
#define in_addr_t uint32_t
|
|
|
|
#define ssize_t SSIZE_T
|
|
|
|
|
2021-10-15 19:53:30 +02:00
|
|
|
#define S_IRUSR _S_IREAD
|
|
|
|
#define S_IWUSR _S_IWRITE
|
|
|
|
#define S_IRGRP (S_IRUSR >> 3)
|
2012-02-29 21:12:12 +01:00
|
|
|
#define R_OK 4
|
|
|
|
#define W_OK 2
|
|
|
|
#define X_OK 1
|
|
|
|
#define F_OK 0
|
|
|
|
|
|
|
|
#define SIGHUP 1
|
|
|
|
#define SIGINT 2
|
|
|
|
#define SIGUSR1 10
|
|
|
|
#define SIGUSR2 12
|
|
|
|
#define SIGTERM 15
|
|
|
|
|
Fix multiple problems when compiling with LLVM/Windows (clang-cl)
When using the LLVM clang compiler instead the MSVC cl.exe but with
the same build environment as MSVC, clang encounters a few errors:
src\openvpn\socket.c(3550,23): warning: assigning to 'CHAR *' (aka 'char
*') from 'uint8_t *' (aka 'unsigned char *') converts between pointers to
integer types with different sign [-Wpointer-sign]
wsabuf[0].buf = BPTR(&sock->reads.buf);
^ ~~~~~~~~~~~~~~~~~~~~~~
src\openvpn\socket.c(3670,23): warning: assigning to 'CHAR *' (aka 'char
*') from 'uint8_t *' (aka 'unsigned char *') converts between pointers to
integer types with different sign [-Wpointer-sign]
wsabuf[0].buf = BPTR(&sock->writes.buf);
^ ~~~~~~~~~~~~~~~~~~~~~~~
Use BSTR instead of BPTR, which casts to the correct type that is
expected.
src\compat\compat-gettimeofday.c(105,18): error: assignment to cast is
illegal, lvalue casts are not supported
tv->tv_sec = (long)last_sec = (long)sec;
Split into two assignments to avoid the illegal cast
include\stdint.h(18,28): error: typedef redefinition with different types
('signed char' vs 'char')
typedef signed char int8_t;
^
openvpn\config-msvc.h(162,16): note: previous definition is here
typedef __int8 int8_t;
Removes our custom int type typdefs from config-msvc.h and replace it
with an include of inttypes.h.
C:\Program Files (x86)\Windows
Kits\10\include\10.0.19041.0\shared\tcpmib.h(56,3): error: typedef
redefinition with different types ('enum MIB_TCP_STATE' vs 'int')
} MIB_TCP_STATE;
^
C:\Users\User\source\repos\openvpn\src\openvpn/syshead.h(369,13): note:
previous definition is here
typedef int MIB_TCP_STATE;
^
1 error generated.
This seems to be for mingw32 only, so guard this with a mingw32
compiler guard.
\src\openvpn\tun.c(3727,34): warning: passing 'char [256]' to parameter of
type 'LPBYTE' (aka 'unsigned char *') converts between pointers to integer
types with different sign [-Wpointer-sign]
net_cfg_instance_id,
^~~~~~~~~~~~~~~~~~~
C:\Program Files (x86)\Windows
Kits\10\include\10.0.19041.0\um\winreg.h(955,88): note: passing argument
to parameter 'lpData' here
This is windows specific code, use the Windows LPBTYE in the
definitions. (long pointer to BYTE (long pointer as far/near pointer
relict from windows 16 bit times, in moddern words (unsigned char *))
Fix also a few other char vs uint8/unisgned char/BYTE issues in tun.c
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20210319114631.20459-1-arne@rfc2549.org>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg21719.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
2021-03-19 12:46:31 +01:00
|
|
|
#include <inttypes.h>
|
2017-03-15 23:40:31 +01:00
|
|
|
typedef uint16_t in_port_t;
|
2012-02-29 21:12:12 +01:00
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_MSVC_LOCAL_H
|
|
|
|
#include <config-msvc-local.h>
|
|
|
|
#endif
|