summaryrefslogtreecommitdiffstats
path: root/lib/system_win32.c
diff options
context:
space:
mode:
authorCurl Upstream <curl-library@cool.haxx.se>2018-09-04 21:49:50 (GMT)
committerBrad King <brad.king@kitware.com>2018-10-22 12:24:16 (GMT)
commit18812a9c3d395b368d8f3d85394b346472c8e858 (patch)
treeab391413091d9538c9ee6b25ab3ff8e54f9cbac0 /lib/system_win32.c
parentd431136e029c652f5913bcebeaab3b9236b114c4 (diff)
downloadCMake-18812a9c3d395b368d8f3d85394b346472c8e858.zip
CMake-18812a9c3d395b368d8f3d85394b346472c8e858.tar.gz
CMake-18812a9c3d395b368d8f3d85394b346472c8e858.tar.bz2
curl 2018-09-04 (432eb5f5)
Code extracted from: https://github.com/curl/curl.git at commit 432eb5f5c254ee8383b2522ce597c9219877923e (curl-7_61_1).
Diffstat (limited to 'lib/system_win32.c')
-rw-r--r--lib/system_win32.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/system_win32.c b/lib/system_win32.c
index cfbbf32..6b8004e 100644
--- a/lib/system_win32.c
+++ b/lib/system_win32.c
@@ -26,6 +26,7 @@
#include <curl/curl.h>
#include "system_win32.h"
+#include "warnless.h"
/* The last #include files should be: */
#include "curl_memory.h"
@@ -134,8 +135,9 @@ bool Curl_verify_windows_version(const unsigned int majorVersion,
break;
case VERSION_LESS_THAN_EQUAL:
- if(osver.dwMajorVersion <= majorVersion &&
- osver.dwMinorVersion <= minorVersion)
+ if(osver.dwMajorVersion < majorVersion ||
+ (osver.dwMajorVersion == majorVersion &&
+ osver.dwMinorVersion <= minorVersion))
matched = TRUE;
break;
@@ -146,8 +148,9 @@ bool Curl_verify_windows_version(const unsigned int majorVersion,
break;
case VERSION_GREATER_THAN_EQUAL:
- if(osver.dwMajorVersion >= majorVersion &&
- osver.dwMinorVersion >= minorVersion)
+ if(osver.dwMajorVersion > majorVersion ||
+ (osver.dwMajorVersion == majorVersion &&
+ osver.dwMinorVersion >= minorVersion))
matched = TRUE;
break;
@@ -278,7 +281,9 @@ HMODULE Curl_load_library(LPCTSTR filename)
/* Attempt to find LoadLibraryEx() which is only available on Windows 2000
and above */
- pLoadLibraryEx = (LOADLIBRARYEX_FN) GetProcAddress(hKernel32, LOADLIBARYEX);
+ pLoadLibraryEx =
+ CURLX_FUNCTION_CAST(LOADLIBRARYEX_FN,
+ (GetProcAddress(hKernel32, LOADLIBARYEX)));
/* Detect if there's already a path in the filename and load the library if
there is. Note: Both back slashes and forward slashes have been supported