diff --git a/ortools/base/sysinfo.cc b/ortools/base/sysinfo.cc index 4418c3dc0e..bff963d519 100644 --- a/ortools/base/sysinfo.cc +++ b/ortools/base/sysinfo.cc @@ -17,7 +17,8 @@ #if defined(__APPLE__) && defined(__GNUC__) // MacOS #include #include -#elif (defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)) // [Free,Net,Open]BSD +#elif (defined(__FreeBSD__) || defined(__NetBSD__) || \ + defined(__OpenBSD__)) // [Free,Net,Open]BSD #include #include // Windows @@ -48,8 +49,9 @@ int64_t GetProcessMemoryUsage() { int64_t resident_memory = t_info.resident_size; return resident_memory; } -#elif defined(__GNUC__) && !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) && \ - !defined(__EMSCRIPTEN__) && !defined(_WIN32) // Linux +#elif defined(__GNUC__) && !defined(__FreeBSD__) && !defined(__NetBSD__) && \ + !defined(__OpenBSD__) && !defined(__EMSCRIPTEN__) && \ + !defined(_WIN32) // Linux int64_t GetProcessMemoryUsage() { unsigned size = 0; char buf[30]; @@ -61,7 +63,8 @@ int64_t GetProcessMemoryUsage() { fclose(pf); return int64_t{1024} * size; } -#elif (defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)) // [Free,Net,Open]BSD +#elif (defined(__FreeBSD__) || defined(__NetBSD__) || \ + defined(__OpenBSD__)) // [Free,Net,Open]BSD int64_t GetProcessMemoryUsage() { int who = RUSAGE_SELF; struct rusage rusage; diff --git a/ortools/flatzinc/presolve.cc b/ortools/flatzinc/presolve.cc index fb98500645..7b5984dee4 100644 --- a/ortools/flatzinc/presolve.cc +++ b/ortools/flatzinc/presolve.cc @@ -183,7 +183,7 @@ bool IsIncreasingAndContiguous(absl::Span values) { return true; } -bool AreOnesFollowedByMinusOne(const std::vector& coeffs) { +bool AreOnesFollowedByMinusOne(absl::Span coeffs) { CHECK(!coeffs.empty()); for (int i = 0; i < coeffs.size() - 1; ++i) { if (coeffs[i] != 1) { diff --git a/ortools/util/zvector.h b/ortools/util/zvector.h index e5e51f71ca..cf0cf9322b 100644 --- a/ortools/util/zvector.h +++ b/ortools/util/zvector.h @@ -14,8 +14,8 @@ #ifndef OR_TOOLS_UTIL_ZVECTOR_H_ #define OR_TOOLS_UTIL_ZVECTOR_H_ -#if (defined(__APPLE__) || \ - defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)) && \ +#if (defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || \ + defined(__OpenBSD__)) && \ defined(__GNUC__) #include #elif !defined(_MSC_VER) && !defined(__MINGW32__) && !defined(__MINGW64__)