diff --git a/libs/libks/libks.vcxproj b/libs/libks/libks.vcxproj
index 10378ffcaf..4a9206f47b 100644
--- a/libs/libks/libks.vcxproj
+++ b/libs/libks/libks.vcxproj
@@ -27,25 +27,25 @@
DynamicLibrary
true
- v140_xp
+ v140
Unicode
DynamicLibrary
false
- v140_xp
+ v140
Unicode
DynamicLibrary
true
- v140_xp
+ v140
Unicode
DynamicLibrary
false
- v140_xp
+ v140
Unicode
@@ -80,6 +80,8 @@
$(SolutionDir)$(Platform)\$(Configuration)\
$(SolutionDir);$(SolutionDir)\crypt;$(IncludePath)
$(LibraryPath)
+ C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Static Analysis Tools\Rule Sets\NativeRecommendedRules.ruleset
+ true
@@ -92,6 +94,8 @@
$(SolutionDir);$(SolutionDir)\crypt;$(IncludePath)
$(LibraryPath)
+ C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Static Analysis Tools\Rule Sets\NativeRecommendedRules.ruleset
+ true
$(SolutionDir);$(SolutionDir)\crypt;$(IncludePath)
@@ -110,6 +114,7 @@
4711;4574;4100;4127;4668;4255;4706;4710;4820;4090;4702
true
false
+ true
MachineX86
@@ -150,6 +155,7 @@
4711;4574;4100;4127;4668;4255;4706;4710;4820;4090;4702
true
false
+ true
Windows
diff --git a/libs/libks/src/include/ks_platform.h b/libs/libks/src/include/ks_platform.h
index 1be538f8e4..ff6ee2ba1f 100644
--- a/libs/libks/src/include/ks_platform.h
+++ b/libs/libks/src/include/ks_platform.h
@@ -46,6 +46,9 @@ KS_BEGIN_EXTERN_C
#if !defined(__WINDOWS__) && (defined(WIN32) || defined(WIN64) || defined(_MSC_VER) || defined(_WIN32))
#define __WINDOWS__
+#ifndef _WINSOCK_DEPRECATED_NO_WARNINGS
+#define _WINSOCK_DEPRECATED_NO_WARNINGS
+#endif
#endif
#ifndef _GNU_SOURCE
diff --git a/libs/libks/src/ks.c b/libs/libks/src/ks.c
index 6f493cceae..fc924ad865 100644
--- a/libs/libks/src/ks.c
+++ b/libs/libks/src/ks.c
@@ -81,7 +81,7 @@ KS_DECLARE(ks_status_t) ks_init(void)
WSADATA wsaData;
WORD wVersionRequested = MAKEWORD(2, 2);
- WSAStartup(wVersionRequested, &wsaData);
+ ks_assert(!WSAStartup(wVersionRequested, &wsaData));
#endif
return KS_STATUS_SUCCESS;
diff --git a/libs/libks/src/ks_mutex.c b/libs/libks/src/ks_mutex.c
index 14d84e3e84..93be5069b6 100644
--- a/libs/libks/src/ks_mutex.c
+++ b/libs/libks/src/ks_mutex.c
@@ -17,11 +17,6 @@
*
*/
-#ifdef WIN32
-/* required for TryEnterCriticalSection definition. Must be defined before windows.h include */
-#define _WIN32_WINNT 0x0400
-#endif
-
#include "ks.h"
#ifdef WIN32
diff --git a/libs/libks/src/ks_time.c b/libs/libks/src/ks_time.c
index e1fc207a34..2ba82ca7b2 100644
--- a/libs/libks/src/ks_time.c
+++ b/libs/libks/src/ks_time.c
@@ -34,6 +34,8 @@
#include
#ifdef WIN32
+#include
+
static CRITICAL_SECTION timer_section;
static ks_time_t win32_tick_time_since_start = -1;
static DWORD win32_last_get_time_tick = 0;
@@ -51,9 +53,10 @@ static inline void win32_init_timers(void)
version_info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
/* Check if we should use timeGetTime() (pre-Vista) or QueryPerformanceCounter() (Vista and later) */
-
- if (GetVersionEx((OSVERSIONINFO*) &version_info)) {
- if (version_info.dwPlatformId == VER_PLATFORM_WIN32_NT && version_info.dwMajorVersion >= 6) {
+
+ //if (GetVersionEx((OSVERSIONINFO*) &version_info)) {
+ if (IsWindowsVistaOrGreater()) {
+ //if (version_info.dwPlatformId == VER_PLATFORM_WIN32_NT && version_info.dwMajorVersion >= 6) {
if (QueryPerformanceFrequency((LARGE_INTEGER*)&win32_qpc_freq) && win32_qpc_freq > 0) {
/* At least Vista, and QueryPerformanceFrequency() suceeded, enable qpc */
win32_use_qpc = 1;
@@ -61,10 +64,10 @@ static inline void win32_init_timers(void)
/* At least Vista, but QueryPerformanceFrequency() failed, disable qpc */
win32_use_qpc = 0;
}
- } else {
+ //} else {
/* Older then Vista, disable qpc */
- win32_use_qpc = 0;
- }
+ //win32_use_qpc = 0;
+ //}
} else {
/* Unknown version - we want at least Vista, disable qpc */
win32_use_qpc = 0;
diff --git a/libs/libks/test/test_thread_pools.vcxproj b/libs/libks/test/test_thread_pools.vcxproj
index 4d4af37be5..5e488c5dff 100644
--- a/libs/libks/test/test_thread_pools.vcxproj
+++ b/libs/libks/test/test_thread_pools.vcxproj
@@ -28,26 +28,26 @@
Application
true
- v140_xp
+ v140
Unicode
Application
false
- v140_xp
+ v140
true
Unicode
Application
true
- v140_xp
+ v140
Unicode
Application
false
- v140_xp
+ v140
true
Unicode
diff --git a/libs/libks/test/testacl.vcxproj b/libs/libks/test/testacl.vcxproj
index 4cbc5ab29b..ae3e3ddb35 100644
--- a/libs/libks/test/testacl.vcxproj
+++ b/libs/libks/test/testacl.vcxproj
@@ -28,26 +28,26 @@
Application
true
- v140_xp
+ v140
Unicode
Application
false
- v140_xp
+ v140
true
Unicode
Application
true
- v140_xp
+ v140
Unicode
Application
false
- v140_xp
+ v140
true
Unicode
diff --git a/libs/libks/test/testhash.vcxproj b/libs/libks/test/testhash.vcxproj
index 7c4db0e22f..9c4b409f6d 100644
--- a/libs/libks/test/testhash.vcxproj
+++ b/libs/libks/test/testhash.vcxproj
@@ -28,26 +28,26 @@
Application
true
- v140_xp
+ v140
Unicode
Application
false
- v140_xp
+ v140
true
Unicode
Application
true
- v140_xp
+ v140
Unicode
Application
false
- v140_xp
+ v140
true
Unicode
diff --git a/libs/libks/test/testpools.vcxproj b/libs/libks/test/testpools.vcxproj
index ac1d580a1c..c1743b4f1d 100644
--- a/libs/libks/test/testpools.vcxproj
+++ b/libs/libks/test/testpools.vcxproj
@@ -28,26 +28,26 @@
Application
true
- v140_xp
+ v140
Unicode
Application
false
- v140_xp
+ v140
true
Unicode
Application
true
- v140_xp
+ v140
Unicode
Application
false
- v140_xp
+ v140
true
Unicode
diff --git a/libs/libks/test/testq.vcxproj b/libs/libks/test/testq.vcxproj
index f85ecf08bc..45cccc2657 100644
--- a/libs/libks/test/testq.vcxproj
+++ b/libs/libks/test/testq.vcxproj
@@ -28,26 +28,26 @@
Application
true
- v140_xp
+ v140
Unicode
Application
false
- v140_xp
+ v140
true
Unicode
Application
true
- v140_xp
+ v140
Unicode
Application
false
- v140_xp
+ v140
true
Unicode
diff --git a/libs/libks/test/testsock.vcxproj b/libs/libks/test/testsock.vcxproj
index 0d8492b3be..7ab1e57b2c 100644
--- a/libs/libks/test/testsock.vcxproj
+++ b/libs/libks/test/testsock.vcxproj
@@ -28,26 +28,26 @@
Application
true
- v140_xp
+ v140
Unicode
Application
false
- v140_xp
+ v140
true
Unicode
Application
true
- v140_xp
+ v140
Unicode
Application
false
- v140_xp
+ v140
true
Unicode
diff --git a/libs/libks/test/testthreadmutex.vcxproj b/libs/libks/test/testthreadmutex.vcxproj
index 5d78c95075..be33681798 100644
--- a/libs/libks/test/testthreadmutex.vcxproj
+++ b/libs/libks/test/testthreadmutex.vcxproj
@@ -28,26 +28,26 @@
Application
true
- v140_xp
+ v140
Unicode
Application
false
- v140_xp
+ v140
true
Unicode
Application
true
- v140_xp
+ v140
Unicode
Application
false
- v140_xp
+ v140
true
Unicode
diff --git a/libs/libks/test/testtime.vcxproj b/libs/libks/test/testtime.vcxproj
index 03d3e9e5f8..e1c73e2706 100644
--- a/libs/libks/test/testtime.vcxproj
+++ b/libs/libks/test/testtime.vcxproj
@@ -28,26 +28,26 @@
Application
true
- v140_xp
+ v140
Unicode
Application
false
- v140_xp
+ v140
true
Unicode
Application
true
- v140_xp
+ v140
Unicode
Application
false
- v140_xp
+ v140
true
Unicode
diff --git a/libs/libks/test/testwebsock.vcxproj b/libs/libks/test/testwebsock.vcxproj
index 357fc065f2..8648b71308 100644
--- a/libs/libks/test/testwebsock.vcxproj
+++ b/libs/libks/test/testwebsock.vcxproj
@@ -28,26 +28,26 @@
Application
true
- v140_xp
+ v140
Unicode
Application
false
- v140_xp
+ v140
true
Unicode
Application
true
- v140_xp
+ v140
Unicode
Application
false
- v140_xp
+ v140
true
Unicode