blob: 8bde0aa4885ea786cb731a653e9e47fd43526404 [file] [log] [blame] [edit]
--- a/absl/base/internal/direct_mmap.h
+++ b/absl/base/internal/direct_mmap.h
@@ -20,7 +20,7 @@
#include "absl/base/config.h"
-#if ABSL_HAVE_MMAP
+#ifdef ABSL_HAVE_MMAP
#include <sys/mman.h>
@@ -35,6 +35,7 @@
#include <linux/unistd.h>
#include <unistd.h>
+
#include <cerrno>
#include <cstdarg>
#include <cstdint>
--- 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
+#if !defined(HAS_STRPTIME)
#include <iomanip>
#include <sstream>
#endif
@@ -56,7 +56,7 @@ namespace detail {
namespace {
-#if !HAS_STRPTIME
+#if !defined(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);
--- a/absl/base/internal/sysinfo.cc
+++ b/absl/base/internal/sysinfo.cc
@@ -81,7 +81,11 @@ static double GetNominalCPUFrequency() {
// API informing about CPU nominal frequency.
return 1.0;
#else
+
+#if defined(_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/randen_detect.cc
+++ b/absl/random/internal/randen_detect.cc
@@ -40,7 +40,9 @@
#if defined(ABSL_INTERNAL_USE_X86_CPUID)
#if defined(_WIN32) || defined(_WIN64)
#include <intrin.h> // NOLINT(build/include_order)
+#if defined(_MSC_VER)
#pragma intrinsic(__cpuid)
+#endif
#else
// MSVC-equivalent __cpuid intrinsic function.
static void __cpuid(int cpu_info[4], int info_type) {
--- a/absl/random/internal/seed_material.cc
+++ b/absl/random/internal/seed_material.cc
@@ -43,7 +43,10 @@
#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>