summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-09-29 13:21:43 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2014-09-29 13:21:43 (GMT)
commitc38d9687caf34ce50a167b3187243b33a348ccb4 (patch)
tree9f05ee6cc60c760c226f1ec19b126bb2428ed8d3 /Source
parentea438b3a6d0f2bdcdb4c1cd44bc4ab58295e9b38 (diff)
parent208530090dd2707d39f2264b3a7dfe2c0428b583 (diff)
downloadCMake-c38d9687caf34ce50a167b3187243b33a348ccb4.zip
CMake-c38d9687caf34ce50a167b3187243b33a348ccb4.tar.gz
CMake-c38d9687caf34ce50a167b3187243b33a348ccb4.tar.bz2
Merge topic 'update-kwsys'
20853009 Merge branch 'upstream-kwsys' into update-kwsys a79ff0e4 KWSys 2014-09-25 (29ffaf43)
Diffstat (limited to 'Source')
-rw-r--r--Source/kwsys/ProcessWin32.c17
-rw-r--r--Source/kwsys/SystemInformation.cxx12
-rw-r--r--Source/kwsys/SystemTools.cxx10
3 files changed, 38 insertions, 1 deletions
diff --git a/Source/kwsys/ProcessWin32.c b/Source/kwsys/ProcessWin32.c
index c8ec754..ef71f26 100644
--- a/Source/kwsys/ProcessWin32.c
+++ b/Source/kwsys/ProcessWin32.c
@@ -36,6 +36,9 @@ a UNIX-style select system call.
#pragma warning (push, 1)
#endif
#include <windows.h> /* Windows API */
+#if defined(_MSC_VER) && _MSC_VER >= 1800
+# define KWSYS_WINDOWS_DEPRECATED_GetVersionEx
+#endif
#include <string.h> /* strlen, strdup */
#include <stdio.h> /* sprintf */
#include <io.h> /* _unlink */
@@ -335,7 +338,14 @@ kwsysProcess* kwsysProcess_New(void)
windows. */
ZeroMemory(&osv, sizeof(osv));
osv.dwOSVersionInfoSize = sizeof(osv);
+#ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx
+# pragma warning (push)
+# pragma warning (disable:4996)
+#endif
GetVersionEx(&osv);
+#ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx
+# pragma warning (pop)
+#endif
if(osv.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS)
{
/* Win9x no longer supported. */
@@ -2370,7 +2380,14 @@ static kwsysProcess_List* kwsysProcess_List_New(void)
/* Select an implementation. */
ZeroMemory(&osv, sizeof(osv));
osv.dwOSVersionInfoSize = sizeof(osv);
+#ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx
+# pragma warning (push)
+# pragma warning (disable:4996)
+#endif
GetVersionEx(&osv);
+#ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx
+# pragma warning (pop)
+#endif
self->NT4 = (osv.dwPlatformId == VER_PLATFORM_WIN32_NT &&
osv.dwMajorVersion < 5)? 1:0;
diff --git a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx
index 2521aac..84b5f39 100644
--- a/Source/kwsys/SystemInformation.cxx
+++ b/Source/kwsys/SystemInformation.cxx
@@ -60,6 +60,9 @@
#if defined(_WIN32)
# include <windows.h>
+# if defined(_MSC_VER) && _MSC_VER >= 1800
+# define KWSYS_WINDOWS_DEPRECATED_GetVersionEx
+# endif
# include <errno.h>
# if defined(KWSYS_SYS_HAS_PSAPI)
# include <psapi.h>
@@ -3786,7 +3789,7 @@ bool SystemInformationImplementation::QueryLinuxMemory()
return false;
}
- if( unameInfo.release!=0 && strlen(unameInfo.release)>=3 )
+ if( strlen(unameInfo.release)>=3 )
{
// release looks like "2.6.3-15mdk-i686-up-4GB"
char majorChar=unameInfo.release[0];
@@ -5063,6 +5066,10 @@ bool SystemInformationImplementation::QueryOSInformation()
// Try calling GetVersionEx using the OSVERSIONINFOEX structure.
ZeroMemory (&osvi, sizeof (OSVERSIONINFOEXW));
osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFOEXW);
+#ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx
+# pragma warning (push)
+# pragma warning (disable:4996)
+#endif
bOsVersionInfoEx = GetVersionExW ((OSVERSIONINFOW*)&osvi);
if (!bOsVersionInfoEx)
{
@@ -5072,6 +5079,9 @@ bool SystemInformationImplementation::QueryOSInformation()
return false;
}
}
+#ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx
+# pragma warning (pop)
+#endif
switch (osvi.dwPlatformId)
{
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index 8a61267..b1221e3 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -82,6 +82,9 @@
# ifndef INVALID_FILE_ATTRIBUTES
# define INVALID_FILE_ATTRIBUTES ((DWORD)-1)
# endif
+# if defined(_MSC_VER) && _MSC_VER >= 1800
+# define KWSYS_WINDOWS_DEPRECATED_GetVersionEx
+# endif
#elif defined (__CYGWIN__)
# include <windows.h>
# undef _WIN32
@@ -4629,6 +4632,10 @@ kwsys_stl::string SystemTools::GetOperatingSystemNameAndVersion()
ZeroMemory(&osvi, sizeof(OSVERSIONINFOEXA));
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXA);
+#ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx
+# pragma warning (push)
+# pragma warning (disable:4996)
+#endif
bOsVersionInfoEx = GetVersionEx((OSVERSIONINFO *)&osvi);
if (!bOsVersionInfoEx)
{
@@ -4638,6 +4645,9 @@ kwsys_stl::string SystemTools::GetOperatingSystemNameAndVersion()
return 0;
}
}
+#ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx
+# pragma warning (pop)
+#endif
switch (osvi.dwPlatformId)
{