Browse code

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 <frank@lichtenheld.com>
Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <20231128103950.62407-1-frank@lichtenheld.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27573.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
(cherry picked from commit a68595a582b2c6c220b4f4502753d5f4154000d8)

Arne Schwabe authored on 2023/11/28 19:39:50
Showing 7 changed files
... ...
@@ -313,7 +313,6 @@ set(SOURCE_FILES
313 313
     src/compat/compat-dirname.c
314 314
     src/compat/compat-gettimeofday.c
315 315
     src/compat/compat-strsep.c
316
-    src/compat/compat-versionhelpers.h
317 316
     src/openvpn/argv.c
318 317
     src/openvpn/argv.h
319 318
     src/openvpn/base64.c
... ...
@@ -374,9 +374,6 @@ don't. */
374 374
 /* Define to 1 if you have the <valgrind/memcheck.h> header file. */
375 375
 #undef HAVE_VALGRIND_MEMCHECK_H
376 376
 
377
-/* Define to 1 if you have the <versionhelpers.h> header file. */
378
-#undef HAVE_VERSIONHELPERS_H
379
-
380 377
 /* Define to 1 if you have the `vfork' function. */
381 378
 #undef HAVE_VFORK
382 379
 
... ...
@@ -454,7 +454,6 @@ AC_CHECK_HEADERS([ \
454 454
 	unistd.h dlfcn.h \
455 455
 	netinet/in.h netinet/in_systm.h \
456 456
 	netinet/tcp.h arpa/inet.h netdb.h \
457
-	versionhelpers.h \
458 457
 ])
459 458
 AC_CHECK_HEADERS([ \
460 459
 	sys/time.h sys/ioctl.h sys/stat.h \
... ...
@@ -20,5 +20,4 @@ libcompat_la_SOURCES = \
20 20
 	compat-basename.c \
21 21
 	compat-gettimeofday.c \
22 22
 	compat-daemon.c \
23
-	compat-strsep.c \
24
-	compat-versionhelpers.h
23
+	compat-strsep.c
25 24
\ No newline at end of file
26 25
deleted file mode 100644
... ...
@@ -1,116 +0,0 @@
1
-/**
2
- * This file is part of the mingw-w64 runtime package.
3
- * No warranty is given; refer to the file DISCLAIMER within this package.
4
- */
5
-
6
-#ifndef _INC_VERSIONHELPERS
7
-#define _INC_VERSIONHELPERS
8
-
9
-#include <winapifamily.h>
10
-
11
-#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && !defined(__WIDL__)
12
-
13
-#ifdef __cplusplus
14
-#define VERSIONHELPERAPI inline bool
15
-#else
16
-#define VERSIONHELPERAPI FORCEINLINE BOOL
17
-#endif
18
-
19
-#define _WIN32_WINNT_WINBLUE    0x0603
20
-
21
-#ifndef _WIN32_WINNT_WINTHRESHOLD
22
-#define _WIN32_WINNT_WINTHRESHOLD    0x0A00 /* Windows 10 */
23
-#endif
24
-
25
-VERSIONHELPERAPI
26
-IsWindowsVersionOrGreater(WORD major, WORD minor, WORD servpack)
27
-{
28
-    OSVERSIONINFOEXW vi = {sizeof(vi), major, minor, 0, 0, {0}, servpack};
29
-    return VerifyVersionInfoW(&vi, VER_MAJORVERSION|VER_MINORVERSION|VER_SERVICEPACKMAJOR,
30
-                              VerSetConditionMask(VerSetConditionMask(VerSetConditionMask(0,
31
-                                                                                          VER_MAJORVERSION, VER_GREATER_EQUAL),
32
-                                                                      VER_MINORVERSION, VER_GREATER_EQUAL),
33
-                                                  VER_SERVICEPACKMAJOR, VER_GREATER_EQUAL));
34
-}
35
-
36
-VERSIONHELPERAPI
37
-IsWindowsXPOrGreater(void)
38
-{
39
-    return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINXP), LOBYTE(_WIN32_WINNT_WINXP), 0);
40
-}
41
-
42
-VERSIONHELPERAPI
43
-IsWindowsXPSP1OrGreater(void)
44
-{
45
-    return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINXP), LOBYTE(_WIN32_WINNT_WINXP), 1);
46
-}
47
-
48
-VERSIONHELPERAPI
49
-IsWindowsXPSP2OrGreater(void)
50
-{
51
-    return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINXP), LOBYTE(_WIN32_WINNT_WINXP), 2);
52
-}
53
-
54
-VERSIONHELPERAPI
55
-IsWindowsXPSP3OrGreater(void)
56
-{
57
-    return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINXP), LOBYTE(_WIN32_WINNT_WINXP), 3);
58
-}
59
-
60
-VERSIONHELPERAPI
61
-IsWindowsVistaOrGreater(void)
62
-{
63
-    return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_VISTA), LOBYTE(_WIN32_WINNT_VISTA), 0);
64
-}
65
-
66
-VERSIONHELPERAPI
67
-IsWindowsVistaSP1OrGreater(void)
68
-{
69
-    return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_VISTA), LOBYTE(_WIN32_WINNT_VISTA), 1);
70
-}
71
-
72
-VERSIONHELPERAPI
73
-IsWindowsVistaSP2OrGreater(void)
74
-{
75
-    return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_VISTA), LOBYTE(_WIN32_WINNT_VISTA), 2);
76
-}
77
-
78
-VERSIONHELPERAPI
79
-IsWindows7OrGreater(void)
80
-{
81
-    return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WIN7), LOBYTE(_WIN32_WINNT_WIN7), 0);
82
-}
83
-
84
-VERSIONHELPERAPI
85
-IsWindows7SP1OrGreater(void)
86
-{
87
-    return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WIN7), LOBYTE(_WIN32_WINNT_WIN7), 1);
88
-}
89
-
90
-VERSIONHELPERAPI
91
-IsWindows8OrGreater(void)
92
-{
93
-    return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WIN8), LOBYTE(_WIN32_WINNT_WIN8), 0);
94
-}
95
-
96
-VERSIONHELPERAPI
97
-IsWindows8Point1OrGreater(void)
98
-{
99
-    return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINBLUE), LOBYTE(_WIN32_WINNT_WINBLUE), 0);
100
-}
101
-
102
-VERSIONHELPERAPI
103
-IsWindows10OrGreater()
104
-{
105
-    return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINTHRESHOLD), LOBYTE(_WIN32_WINNT_WINTHRESHOLD), 0);
106
-}
107
-
108
-VERSIONHELPERAPI
109
-IsWindowsServer(void)
110
-{
111
-    OSVERSIONINFOEXW vi = {sizeof(vi), 0, 0, 0, 0, {0}, 0, 0, 0, VER_NT_WORKSTATION};
112
-    return !VerifyVersionInfoW(&vi, VER_PRODUCT_TYPE, VerSetConditionMask(0, VER_PRODUCT_TYPE, VER_EQUAL));
113
-}
114
-
115
-#endif /* if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && !defined(__WIDL__) */
116
-#endif /* ifndef _INC_VERSIONHELPERS */
... ...
@@ -45,11 +45,7 @@
45 45
 
46 46
 #include "memdbg.h"
47 47
 
48
-#ifdef HAVE_VERSIONHELPERS_H
49 48
 #include <versionhelpers.h>
50
-#else
51
-#include "compat-versionhelpers.h"
52
-#endif
53 49
 
54 50
 #include "block_dns.h"
55 51
 
... ...
@@ -34,11 +34,7 @@
34 34
 #include <shellapi.h>
35 35
 #include <mstcpip.h>
36 36
 
37
-#ifdef HAVE_VERSIONHELPERS_H
38 37
 #include <versionhelpers.h>
39
-#else
40
-#include "compat-versionhelpers.h"
41
-#endif
42 38
 
43 39
 #include "openvpn-msg.h"
44 40
 #include "validate.h"