浏览代码

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 年之前
父节点
当前提交
d862c7040a
共有 1 个文件被更改,包括 8 次插入0 次删除
  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 dwBuild = 0;
 
+#ifdef _MSC_VER
+#pragma warning(push)
+// GetVersion was declared deprecated
+#pragma warning(disable: 4996)
+#endif
 	dwVersion = GetVersion();
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
 
 	dwMajorVersion = (DWORD)(LOBYTE(LOWORD(dwVersion)));
 	dwMinorVersion = (DWORD)(HIBYTE(LOWORD(dwVersion)));