summaryrefslogtreecommitdiff
path: root/absl/strings
diff options
context:
space:
mode:
Diffstat (limited to 'absl/strings')
-rw-r--r--absl/strings/BUILD.bazel2
-rw-r--r--absl/strings/internal/charconv_bigint.h14
-rw-r--r--absl/strings/internal/str_format/arg.h2
-rw-r--r--absl/strings/string_view.h8
4 files changed, 13 insertions, 13 deletions
diff --git a/absl/strings/BUILD.bazel b/absl/strings/BUILD.bazel
index 3b85f1b4..7635a619 100644
--- a/absl/strings/BUILD.bazel
+++ b/absl/strings/BUILD.bazel
@@ -15,7 +15,7 @@
#
load(
- "//absl:copts.bzl",
+ "//absl:copts/configure_copts.bzl",
"ABSL_DEFAULT_COPTS",
"ABSL_TEST_COPTS",
"ABSL_EXCEPTIONS_FLAG",
diff --git a/absl/strings/internal/charconv_bigint.h b/absl/strings/internal/charconv_bigint.h
index 5c579437..9d1a1bff 100644
--- a/absl/strings/internal/charconv_bigint.h
+++ b/absl/strings/internal/charconv_bigint.h
@@ -103,12 +103,12 @@ class BigUnsigned {
SetToZero();
return;
}
- size_ = std::min(size_ + word_shift, max_words);
+ size_ = (std::min)(size_ + word_shift, max_words);
count %= 32;
if (count == 0) {
std::copy_backward(words_, words_ + size_ - word_shift, words_ + size_);
} else {
- for (int i = std::min(size_, max_words - 1); i > word_shift; --i) {
+ for (int i = (std::min)(size_, max_words - 1); i > word_shift; --i) {
words_[i] = (words_[i - word_shift] << count) |
(words_[i - word_shift - 1] >> (32 - count));
}
@@ -267,7 +267,7 @@ class BigUnsigned {
void MultiplyBy(int other_size, const uint32_t* other_words) {
const int original_size = size_;
const int first_step =
- std::min(original_size + other_size - 2, max_words - 1);
+ (std::min)(original_size + other_size - 2, max_words - 1);
for (int step = first_step; step >= 0; --step) {
MultiplyStep(original_size, other_words, other_size, step);
}
@@ -286,7 +286,7 @@ class BigUnsigned {
value = 0;
}
}
- size_ = std::min(max_words, std::max(index + 1, size_));
+ size_ = (std::min)(max_words, (std::max)(index + 1, size_));
}
}
@@ -309,7 +309,7 @@ class BigUnsigned {
} else {
// Normally 32-bit AddWithCarry() sets size_, but since we don't call
// it when `high` is 0, do it ourselves here.
- size_ = std::min(max_words, std::max(index + 1, size_));
+ size_ = (std::min)(max_words, (std::max)(index + 1, size_));
}
}
}
@@ -348,7 +348,7 @@ class BigUnsigned {
// Returns -1 if lhs < rhs, 0 if lhs == rhs, and 1 if lhs > rhs.
template <int N, int M>
int Compare(const BigUnsigned<N>& lhs, const BigUnsigned<M>& rhs) {
- int limit = std::max(lhs.size(), rhs.size());
+ int limit = (std::max)(lhs.size(), rhs.size());
for (int i = limit - 1; i >= 0; --i) {
const uint32_t lhs_word = lhs.GetWord(i);
const uint32_t rhs_word = rhs.GetWord(i);
@@ -363,7 +363,7 @@ int Compare(const BigUnsigned<N>& lhs, const BigUnsigned<M>& rhs) {
template <int N, int M>
bool operator==(const BigUnsigned<N>& lhs, const BigUnsigned<M>& rhs) {
- int limit = std::max(lhs.size(), rhs.size());
+ int limit = (std::max)(lhs.size(), rhs.size());
for (int i = 0; i < limit; ++i) {
if (lhs.GetWord(i) != rhs.GetWord(i)) {
return false;
diff --git a/absl/strings/internal/str_format/arg.h b/absl/strings/internal/str_format/arg.h
index ec9e6f00..ebd40adc 100644
--- a/absl/strings/internal/str_format/arg.h
+++ b/absl/strings/internal/str_format/arg.h
@@ -80,7 +80,7 @@ ConvertResult<Conv::s> FormatConvertImpl(const AbslCord& value,
int precision = conv.precision();
if (precision >= 0)
- to_write = std::min(to_write, static_cast<size_t>(precision));
+ to_write = (std::min)(to_write, static_cast<size_t>(precision));
space_remaining = Excess(to_write, space_remaining);
diff --git a/absl/strings/string_view.h b/absl/strings/string_view.h
index 2cc10f52..8cd4fa24 100644
--- a/absl/strings/string_view.h
+++ b/absl/strings/string_view.h
@@ -355,7 +355,7 @@ class string_view {
string_view substr(size_type pos, size_type n = npos) const {
if (ABSL_PREDICT_FALSE(pos > length_))
base_internal::ThrowStdOutOfRange("absl::string_view::substr");
- n = std::min(n, length_ - pos);
+ n = (std::min)(n, length_ - pos);
return string_view(ptr_ + pos, n);
}
@@ -368,7 +368,7 @@ class string_view {
// on the respective sizes of the two `string_view`s to determine which is
// smaller, equal, or greater.
int compare(string_view x) const noexcept {
- auto min_length = std::min(length_, x.length_);
+ auto min_length = (std::min)(length_, x.length_);
if (min_length > 0) {
int r = memcmp(ptr_, x.ptr_, min_length);
if (r < 0) return -1;
@@ -517,7 +517,7 @@ inline bool operator!=(string_view x, string_view y) noexcept {
}
inline bool operator<(string_view x, string_view y) noexcept {
- auto min_size = std::min(x.size(), y.size());
+ auto min_size = (std::min)(x.size(), y.size());
const int r = min_size == 0 ? 0 : memcmp(x.data(), y.data(), min_size);
return (r < 0) || (r == 0 && x.size() < y.size());
}
@@ -547,7 +547,7 @@ namespace absl {
// Provided because std::string_view::substr throws if `pos > size()`
inline string_view ClippedSubstr(string_view s, size_t pos,
size_t n = string_view::npos) {
- pos = std::min(pos, static_cast<size_t>(s.size()));
+ pos = (std::min)(pos, static_cast<size_t>(s.size()));
return s.substr(pos, n);
}