From: "cron2 (Code Review)" Date: Sat, 2 Dec 2023 16:41:01 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <1fe3f08c92b029839898e153d8637691b63eda72-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="mOMGDy3/4Uc="; charset=UTF-8 Subject: [Openvpn-devel] [M] Change in openvpn[master]: Remove compat versionhelpers.h and remove cmake/configure check for it List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos Cc: flichtenheld , openvpn-devel --mOMGDy3/4Uc= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/44= 5?usp=3Demail ) Change subject: Remove compat versionhelpers.h and remove cmake/configure c= heck for it ...................................................................... Remove compat versionhelpers.h and remove cmake/configure check for it The cmake file defined that file to be never present in contrast to the old msvc-config.h that always had it present. Remove also the compat implementation taken from mingw. All our current build environments already have that header in place. Change-Id: I9c85ccab6d51064ebff2c391740ba8c2d044ed1a Acked-by: Frank Lichtenheld Signed-off-by: Arne Schwabe Message-Id: <20231128103950.62407-1-frank@...2641...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27= 573.html Signed-off-by: Gert Doering --- M CMakeLists.txt M config.h.cmake.in M configure.ac M src/compat/Makefile.am D src/compat/compat-versionhelpers.h M src/openvpn/win32.c M src/openvpnserv/interactive.c 7 files changed, 1 insertion(+), 131 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e4de309..577bc5d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -316,7 +316,6 @@ src/compat/compat-dirname.c src/compat/compat-gettimeofday.c src/compat/compat-strsep.c - src/compat/compat-versionhelpers.h src/openvpn/argv.c src/openvpn/argv.h src/openvpn/base64.c diff --git a/config.h.cmake.in b/config.h.cmake.in index 2af3810..baf9556 100644 --- a/config.h.cmake.in +++ b/config.h.cmake.in @@ -372,9 +372,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_VALGRIND_MEMCHECK_H -/* Define to 1 if you have the header file. */ -#undef HAVE_VERSIONHELPERS_H - /* Define to 1 if you have the `vfork' function. */ #undef HAVE_VFORK diff --git a/configure.ac b/configure.ac index 0f667dc..54f79ab 100644 --- a/configure.ac +++ b/configure.ac @@ -454,7 +454,6 @@ unistd.h dlfcn.h \ netinet/in.h \ netinet/tcp.h arpa/inet.h netdb.h \ - versionhelpers.h \ ]) AC_CHECK_HEADERS([ \ sys/time.h sys/ioctl.h sys/stat.h \ diff --git a/src/compat/Makefile.am b/src/compat/Makefile.am index f5de451..5298dd8 100644 --- a/src/compat/Makefile.am +++ b/src/compat/Makefile.am @@ -20,5 +20,4 @@ compat-basename.c \ compat-gettimeofday.c \ compat-daemon.c \ - compat-strsep.c \ - compat-versionhelpers.h + compat-strsep.c \ No newline at end of file diff --git a/src/compat/compat-versionhelpers.h b/src/compat/compat-version= helpers.h deleted file mode 100644 index b071602..0000000 --- a/src/compat/compat-versionhelpers.h +++ /dev/null @@ -1,116 +0,0 @@ -/** - * This file is part of the mingw-w64 runtime package. - * No warranty is given; refer to the file DISCLAIMER within this package. - */ - -#ifndef _INC_VERSIONHELPERS -#define _INC_VERSIONHELPERS - -#include - -#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && !defined(__WIDL__) - -#ifdef __cplusplus -#define VERSIONHELPERAPI inline bool -#else -#define VERSIONHELPERAPI FORCEINLINE BOOL -#endif - -#define _WIN32_WINNT_WINBLUE 0x0603 - -#ifndef _WIN32_WINNT_WINTHRESHOLD -#define _WIN32_WINNT_WINTHRESHOLD 0x0A00 /* Windows 10 */ -#endif - -VERSIONHELPERAPI -IsWindowsVersionOrGreater(WORD major, WORD minor, WORD servpack) -{ - OSVERSIONINFOEXW vi =3D {sizeof(vi), major, minor, 0, 0, {0}, servpack= }; - return VerifyVersionInfoW(&vi, VER_MAJORVERSION|VER_MINORVERSION|VER_S= ERVICEPACKMAJOR, - VerSetConditionMask(VerSetConditionMask(VerS= etConditionMask(0, - = VER_MAJORVERSION, VER_GREATER_EQUAL), - VER_= MINORVERSION, VER_GREATER_EQUAL), - VER_SERVICEPACKMAJOR, VE= R_GREATER_EQUAL)); -} - -VERSIONHELPERAPI -IsWindowsXPOrGreater(void) -{ - return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINXP), LOBYTE(_W= IN32_WINNT_WINXP), 0); -} - -VERSIONHELPERAPI -IsWindowsXPSP1OrGreater(void) -{ - return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINXP), LOBYTE(_W= IN32_WINNT_WINXP), 1); -} - -VERSIONHELPERAPI -IsWindowsXPSP2OrGreater(void) -{ - return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINXP), LOBYTE(_W= IN32_WINNT_WINXP), 2); -} - -VERSIONHELPERAPI -IsWindowsXPSP3OrGreater(void) -{ - return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINXP), LOBYTE(_W= IN32_WINNT_WINXP), 3); -} - -VERSIONHELPERAPI -IsWindowsVistaOrGreater(void) -{ - return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_VISTA), LOBYTE(_W= IN32_WINNT_VISTA), 0); -} - -VERSIONHELPERAPI -IsWindowsVistaSP1OrGreater(void) -{ - return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_VISTA), LOBYTE(_W= IN32_WINNT_VISTA), 1); -} - -VERSIONHELPERAPI -IsWindowsVistaSP2OrGreater(void) -{ - return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_VISTA), LOBYTE(_W= IN32_WINNT_VISTA), 2); -} - -VERSIONHELPERAPI -IsWindows7OrGreater(void) -{ - return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WIN7), LOBYTE(_WI= N32_WINNT_WIN7), 0); -} - -VERSIONHELPERAPI -IsWindows7SP1OrGreater(void) -{ - return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WIN7), LOBYTE(_WI= N32_WINNT_WIN7), 1); -} - -VERSIONHELPERAPI -IsWindows8OrGreater(void) -{ - return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WIN8), LOBYTE(_WI= N32_WINNT_WIN8), 0); -} - -VERSIONHELPERAPI -IsWindows8Point1OrGreater(void) -{ - return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINBLUE), LOBYTE(= _WIN32_WINNT_WINBLUE), 0); -} - -VERSIONHELPERAPI -IsWindows10OrGreater() -{ - return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINTHRESHOLD), LO= BYTE(_WIN32_WINNT_WINTHRESHOLD), 0); -} - -VERSIONHELPERAPI -IsWindowsServer(void) -{ - OSVERSIONINFOEXW vi =3D {sizeof(vi), 0, 0, 0, 0, {0}, 0, 0, 0, VER_NT_= WORKSTATION}; - return !VerifyVersionInfoW(&vi, VER_PRODUCT_TYPE, VerSetConditionMask(= 0, VER_PRODUCT_TYPE, VER_EQUAL)); -} - -#endif /* if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && !defined= (__WIDL__) */ -#endif /* ifndef _INC_VERSIONHELPERS */ diff --git a/src/openvpn/win32.c b/src/openvpn/win32.c index 47eb1fc..e998d90 100644 --- a/src/openvpn/win32.c +++ b/src/openvpn/win32.c @@ -45,11 +45,7 @@ #include "memdbg.h" -#ifdef HAVE_VERSIONHELPERS_H #include -#else -#include "compat-versionhelpers.h" -#endif #include "block_dns.h" diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive.c index a47db8a..32c8996 100644 --- a/src/openvpnserv/interactive.c +++ b/src/openvpnserv/interactive.c @@ -34,11 +34,7 @@ #include #include -#ifdef HAVE_VERSIONHELPERS_H #include -#else -#include "compat-versionhelpers.h" -#endif #include "openvpn-msg.h" #include "validate.h" -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/445?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I9c85ccab6d51064ebff2c391740ba8c2d044ed1a Gerrit-Change-Number: 445 Gerrit-PatchSet: 3 Gerrit-Owner: plaisthos Gerrit-Reviewer: flichtenheld Gerrit-CC: openvpn-devel Gerrit-MessageType: merged --mOMGDy3/4Uc= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 submitted this change.

View Change

Remove compat versionhelpers.h and remove cmak=
e/configure check for it

The cmake file defined that file to be neve= r present in contrast to the
old msvc-config.h that always had it presen= t.
Remove also the compat implementation taken from mingw. All our curre= nt
build environments already have that header in place.

Change-I= d: I9c85ccab6d51064ebff2c391740ba8c2d044ed1a
Acked-by: Frank Lichtenheld= <frank@...2641...>
Signed-off-by: Arne Schwabe <arne@...2477...= .>
Message-Id: <20231128103950.62407-1-frank@...2641...>
URL= : https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27573= .html
Signed-off-by: Gert Doering <gert@...1296...>
---
M CM= akeLists.txt
M config.h.cmake.in
M configure.ac
M src/compat/Makef= ile.am
D src/compat/compat-versionhelpers.h
M src/openvpn/win32.c
= M src/openvpnserv/interactive.c
7 files changed, 1 insertion(+), 131 del= etions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index e4de3= 09..577bc5d 100644
--- a/CMakeLists.txt
+++= b/CMakeLists.txt
@@ -316,7 +316,6 @@
= src/compat/compat-dirname.c
src/compat/compat-gettimeo= fday.c
src/compat/compat-strsep.c
- src/compat/compat-versionhelpers.h

src/openvpn/argv.c
src/openvpn/argv.= h
src/openvpn/base64.c
diff --git a/co= nfig.h.cmake.in b/config.h.cmake.in
index 2af3810..baf9556 = 100644
--- a/config.h.cmake.in
+++ b/config= .h.cmake.in
@@ -372,9 +372,6 @@
/* Define = to 1 if you have the <valgrind/memcheck.h> header file. */
= #undef HAVE_VALGRIND_MEMCHECK_H

-/* Define to 1 if you have the <versi= onhelpers.h> header file. */
-#undef HAVE_VERSIONHELPERS_H
-
/* Define to 1 if you have the `vfork= 9; function. */
#undef HAVE_VFORK
=
diff --git a/configure.ac b/configure.ac
index 0f= 667dc..54f79ab 100644
--- a/configure.ac
++= + b/configure.ac
@@ -454,7 +454,6 @@
unis= td.h dlfcn.h \
netinet/in.h \
netinet/t= cp.h arpa/inet.h netdb.h \
- versionhelpers.h \
])
AC_CHECK_HEAD= ERS([ \
sys/time.h sys/ioctl.h sys/stat.h \
diff --git a/src/compat/Makefile.am b/src/compat/Makefile.am
<= span>index f5de451..5298dd8 100644
--- a/src/compat/Makefil= e.am
+++ b/src/compat/Makefile.am
@@ -20,5 = +20,4 @@
compat-basename.c \
compat-get= timeofday.c \
compat-daemon.c \
- compat-strsep.c \
- compat-versionhelpers.h
+ compat-strsep.c
\ No newline= at end of file
diff --git a/src/compat/compat-versionhelpe= rs.h b/src/compat/compat-versionhelpers.h
deleted file mode= 100644
index b071602..0000000
--- a/src/co= mpat/compat-versionhelpers.h
+++ /dev/null
= @@ -1,116 +0,0 @@
-/**<= /span>
- * This file is part o= f the mingw-w64 runtime package.
- * No warranty is given; refer to the file DISCLAIMER within thi= s package.
- */<= br>-
-#ifndef _INC_VERSIONHELPERS
-#define _INC_VERSIONHELPERS
-

-#include <winapifamily.h>
-
-#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && !def= ined(__WIDL__)
-=
-#ifdef __cplusplus-#define VERSIONHELPERAPI inline= bool
-#else
= -#define VERSIONHELPERAPI FORCEIN= LINE BOOL
-#endif
-
-#define _WIN32_WINNT_WINBLUE 0x0603-
-#ifndef _WIN32_WINNT_WINTHRESHOLD
-#define _WIN32_WINNT_WINTHRESHOLD 0x0= A00 /* Windows 10 */
-#= endif
-
-VERSIONHELPERAPI

-IsWindowsVersionOrGreater(WORD major, WORD= minor, WORD servpack)
= -{
- OSVERSIONINFOEX= W vi =3D {sizeof(vi), major, minor, 0, 0, {0}, servpack};
- return VerifyVersionInfoW(&vi, = VER_MAJORVERSION|VER_MINORVERSION|VER_SERVICEPACKMAJOR,
- VerSetCondi= tionMask(VerSetConditionMask(VerSetConditionMask(0,
- = VER_MAJORVERSION, VER_GREATE= R_EQUAL),
- = VER_MINORVERSION,= VER_GREATER_EQUAL),
- = VER_SERVICEPACKMAJOR, VER_= GREATER_EQUAL));
-}

-
-VERSIONHELPERAPI
-IsWindowsXPOrGreater(void)
-{
- return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINXP), L= OBYTE(_WIN32_WINNT_WINXP), 0);
-}
-
= -VERSIONHELPERAPI
-IsWindowsXPSP1OrGreater(void)<= br>-{
- return IsWindowsVersionOrGreater(HIBYTE(_WIN3= 2_WINNT_WINXP), LOBYTE(_WIN32_WINNT_WINXP), 1);
-}
-
-VERSIONHELPERAP= I
-IsWindowsXPSP2OrGrea= ter(void)
-{
= - return IsWindowsVersionOrGre= ater(HIBYTE(_WIN32_WINNT_WINXP), LOBYTE(_WIN32_WINNT_WINXP), 2);
= -}
-
-VERSIONHELPERAPI
-IsW= indowsXPSP3OrGreater(void)
-{
- return IsWi= ndowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINXP), LOBYTE(_WIN32_WINNT_WINXP= ), 3);
-}
-
-VERSIONHELPERAPI
-IsWindowsVistaOrGreater(void)
-{
- return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_VISTA), LOBYTE(_= WIN32_WINNT_VISTA), 0);
-}
-
-VERSIONHELPERAPI
-IsWindowsVistaSP1OrGreater(void)
= -{
- return IsWindowsVersionOrGreater(HIBYTE(_WIN32_W= INNT_VISTA), LOBYTE(_WIN32_WINNT_VISTA), 1);
-}
-VERSIONHELPERAPI
-IsWindowsVistaSP2OrGrea= ter(void)
-{
= - return IsWindowsVersionOrGre= ater(HIBYTE(_WIN32_WINNT_VISTA), LOBYTE(_WIN32_WINNT_VISTA), 2);
= -}
-
-VERSIONHELPERAPI
-IsW= indows7OrGreater(void)
= -{
- return IsWindow= sVersionOrGreater(HIBYTE(_WIN32_WINNT_WIN7), LOBYTE(_WIN32_WINNT_WIN7), 0);=
-}
-
-VERSIONHELPERAPI
-IsWindows7SP1OrGreater(void)
-{
- r= eturn IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WIN7), LOBYTE(_WIN32_WI= NNT_WIN7), 1);
-}

-
-VERSIONHELPERAPI
-IsWindows8OrGreater(void)
-{
- return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WIN8), LOBYT= E(_WIN32_WINNT_WIN8), 0);
-}
-
-VERSIONHELPERAPI
-IsWindows8Point1OrGreater(void)
= -{
- return IsWindowsVersionOrGreater(HIBYTE(_WIN32_W= INNT_WINBLUE), LOBYTE(_WIN32_WINNT_WINBLUE), 0);
-}
-
-VERSIONHELPERA= PI
-IsWindows10OrGreate= r()
-{
- return IsWindowsVersionOrGreater(H= IBYTE(_WIN32_WINNT_WINTHRESHOLD), LOBYTE(_WIN32_WINNT_WINTHRESHOLD), 0);
-}
-
-VERSIONHELPERAPI
-IsWindowsServer(void)
-{
- OSVERSIONI= NFOEXW vi =3D {sizeof(vi), 0, 0, 0, 0, {0}, 0, 0, 0, VER_NT_WORKSTATION};
- return !VerifyVersi= onInfoW(&vi, VER_PRODUCT_TYPE, VerSetConditionMask(0, VER_PRODUCT_TYPE,= VER_EQUAL));
-}=
-
-#endif /* if WINAPI_FAMILY_PARTITION(WINAPI_PARTI= TION_DESKTOP) && !defined(__WIDL__) */
-#endif /* ifndef _INC_VERSIONHELPERS */
= diff --git a/src/openvpn/win32.c b/src/openvpn/win32.c
index 47eb1fc..e998d90 100644

--- a/src/openvpn/win32.c
+++ b/src/openvpn/win32.c
@@ -45,11 +45,7 @@=

#include "memdbg.h"
-#ifdef HAVE_V= ERSIONHELPERS_H
#include <versionhelpers.h>-#else
-#include "compat-versionhelpers.h"
-#endif
=
#include "block_dns.h"

diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/int= eractive.c
index a47db8a..32c8996 100644
--= - a/src/openvpnserv/interactive.c
+++ b/src/openvpnserv/int= eractive.c
@@ -34,11 +34,7 @@
#include <= ;shellapi.h>
#include <mstcpip.h>

-#ifdef HAVE_VERSION= HELPERS_H
#include <versionhelpers.h>
-#else
-#include "compat-versionhelpers.h"<= br>-#endif

#include "openvpn-msg.h"
#include &= quot;validate.h"

To view, visit change 445<= /a>. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I9c85ccab6d51064ebff2c391740= ba8c2d044ed1a
Gerrit-Change-Number: 445
Gerrit-PatchSet: 3
Gerrit-Owner: plaisthos <arne-openvpn@...1711...= 27...>
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-MessageType: merged
--mOMGDy3/4Uc=--