MINGW-packages/mingw-w64-abseil-cpp/0001-abseil-Fix-compiler-warnings.patch
2022-09-22 04:56:46 +01:00

74 lines
2.0 KiB
Diff

--- a/absl/base/internal/sysinfo.cc
+++ b/absl/base/internal/sysinfo.cc
@@ -77,7 +77,9 @@
// 0 if the number of processors is not available or can not be computed.
// https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getlogicalprocessorinformation
int Win32NumCPUs() {
+#ifdef _MSC_VER
#pragma comment(lib, "kernel32.lib")
+#endif
using Info = SYSTEM_LOGICAL_PROCESSOR_INFORMATION;
DWORD info_size = sizeof(Info);
@@ -150,7 +152,9 @@
// API informing about CPU nominal frequency.
return 1.0;
#else
+#ifdef _MSC_VER
#pragma comment(lib, "advapi32.lib") // For Reg* functions.
+#endif
HKEY key;
// Use the Reg* functions rather than the SH functions because shlwapi.dll
// pulls in gdi32.dll which makes process destruction much more costly.
--- a/absl/debugging/symbolize_win32.inc
+++ b/absl/debugging/symbolize_win32.inc
@@ -18,12 +18,16 @@
#include <windows.h>
// MSVC header dbghelp.h has a warning for an ignored typedef.
+#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4091)
#include <dbghelp.h>
#pragma warning(pop)
#pragma comment(lib, "dbghelp.lib")
+#else
+#include <dbghelp.h>
+#endif
#include <algorithm>
#include <cstring>
--- a/absl/random/internal/seed_material.cc
+++ b/absl/random/internal/seed_material.cc
@@ -44,7 +44,9 @@
#include <windows.h>
#define ABSL_RANDOM_USE_BCRYPT 1
+#ifdef _MSC_VER
#pragma comment(lib, "bcrypt.lib")
+#endif
#elif defined(__Fuchsia__)
#include <zircon/syscalls.h>
--- a/absl/time/internal/cctz/src/time_zone_format.cc
+++ b/absl/time/internal/cctz/src/time_zone_format.cc
@@ -40,7 +40,7 @@
#include <limits>
#include <string>
#include <vector>
-#if !HAS_STRPTIME
+#ifndef HAS_STRPTIME
#include <iomanip>
#include <sstream>
#endif
@@ -56,7 +56,7 @@
namespace {
-#if !HAS_STRPTIME
+#ifndef HAS_STRPTIME
// Build a strptime() using C++11's std::get_time().
char* strptime(const char* s, const char* fmt, std::tm* tm) {
std::istringstream input(s);