]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
win32: Introduced centralised verify windows version function
authorSteve Holme <steve_holme@hotmail.com>
Sat, 4 Jun 2016 19:06:56 +0000 (20:06 +0100)
committerSteve Holme <steve_holme@hotmail.com>
Sat, 4 Jun 2016 20:24:09 +0000 (21:24 +0100)
lib/system_win32.c
lib/system_win32.h

index 73d30b42193e326cb40ad47ae72fc4a025ad7f1a..53f2eeb4052db7745ba831a8bd5dafffe90f125f 100644 (file)
@@ -24,9 +24,6 @@
 
 #if defined(WIN32)
 
-#if defined(USE_WINDOWS_SSPI) || (!defined(CURL_DISABLE_TELNET) && \
-                                  defined(USE_WINSOCK))
-
 #include <curl/curl.h>
 #include "system_win32.h"
 
 #include "curl_memory.h"
 #include "memdebug.h"
 
+#if defined(USE_WINDOWS_SSPI) || (!defined(CURL_DISABLE_TELNET) && \
+                                  defined(USE_WINSOCK))
+
+
 #if !defined(LOAD_WITH_ALTERED_SEARCH_PATH)
 #define LOAD_WITH_ALTERED_SEARCH_PATH  0x00000008
 #endif
@@ -56,6 +57,41 @@ typedef HMODULE (APIENTRY *LOADLIBRARYEX_FN)(LPCTSTR, HANDLE, DWORD);
 #  define LOADLIBARYEX    "LoadLibraryExA"
 #endif
 
+#endif /* USE_WINDOWS_SSPI || (!CURL_DISABLE_TELNET && USE_WINSOCK) */
+
+/*
+ * Curl_verify_windows_version()
+ *
+ * This is used to verify if we are running on a specific windows version.
+ *
+ * Parameters:
+ *
+ * majorVersion [in] - The major version number.
+ * minorVersion [in] - The minor version number.
+ * platform     [in] - The optional platform identifer.
+ * condition    [in] - The test condition used to specifier whether we are
+ *                     checking a version less then, equal to or greater than
+ *                     what is specified in the major and minor version
+ *                     numbers.
+ *
+ * Returns TRUE if matched; otherwise FALSE.
+ */
+bool Curl_verify_windows_version(const unsigned int majorVersion,
+                                 const unsigned int minorVersion,
+                                 const PlatformIdentifier platform,
+                                 const VersionCondition condition)
+{
+  (void) majorVersion;
+  (void) minorVersion;
+  (void) platform;
+  (void) condition;
+
+  return FALSE;
+}
+
+#if defined(USE_WINDOWS_SSPI) || (!defined(CURL_DISABLE_TELNET) && \
+                                  defined(USE_WINSOCK))
+
 /*
  * Curl_load_library()
  *
index dec18899ab6f2894d682afe8215f2bb30ea195c9..1e772856b23db96dddf204a8b346ce1dcd868a6f 100644 (file)
 
 #if defined(WIN32)
 
+/* Version condition */
+typedef enum {
+  VERSION_LESS_THAN,
+  VERSION_LESS_THAN_EQUAL,
+  VERSION_EQUAL,
+  VERSION_GREATER_THAN_EQUAL,
+  VERSION_GREATER_THAN
+} VersionCondition;
+
+/* Platform identifier */
+typedef enum {
+  PLATFORM_DONT_CARE,
+  PLATFORM_WINDOWS,
+  PLATFORM_WINNT
+} PlatformIdentifier;
+
+/* This is used to verify if we are running on a specific windows version */
+bool Curl_verify_windows_version(const unsigned int majorVersion,
+                                 const unsigned int minorVersion,
+                                 const PlatformIdentifier platform,
+                                 const VersionCondition condition);
+
 #if defined(USE_WINDOWS_SSPI) || (!defined(CURL_DISABLE_TELNET) && \
                                   defined(USE_WINSOCK))