Browse Source

Disabled deprecated warning

We actually have a legitimate use for GetVersion here as we would like
to know the runtime version of the Windows rather than the compile
time version.

The reason GetVersion is deprecated is because people use it to detect
the availablility of functions on newer versions of Windows. In that
case the symbols should be loaded from the kernel.dll in our case we
actually want to report the version number of Windows.
Matt Clarkson 10 years ago
parent
commit
d862c7040a
1 changed files with 8 additions and 0 deletions
  1. 8 0
      src/civetweb.c

+ 8 - 0
src/civetweb.c

@@ -9644,7 +9644,15 @@ static void get_system_name(char **sysName)
 	DWORD dwMinorVersion = 0;
 	DWORD dwMinorVersion = 0;
 	DWORD dwBuild = 0;
 	DWORD dwBuild = 0;
 
 
+#ifdef _MSC_VER
+#pragma warning(push)
+// GetVersion was declared deprecated
+#pragma warning(disable: 4996)
+#endif
 	dwVersion = GetVersion();
 	dwVersion = GetVersion();
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
 
 
 	dwMajorVersion = (DWORD)(LOBYTE(LOWORD(dwVersion)));
 	dwMajorVersion = (DWORD)(LOBYTE(LOWORD(dwVersion)));
 	dwMinorVersion = (DWORD)(HIBYTE(LOWORD(dwVersion)));
 	dwMinorVersion = (DWORD)(HIBYTE(LOWORD(dwVersion)));