mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-15 16:57:29 +00:00
Fix use of min and max when Windows.h is imported (#4411)
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
2f2e4cced4
commit
513958ea72
@@ -1531,7 +1531,7 @@ class FlatBufferBuilder
|
||||
auto stra = reinterpret_cast<const String *>(buf_->data_at(a.o));
|
||||
auto strb = reinterpret_cast<const String *>(buf_->data_at(b.o));
|
||||
return strncmp(stra->c_str(), strb->c_str(),
|
||||
std::min(stra->size(), strb->size()) + 1) < 0;
|
||||
(std::min)(stra->size(), strb->size()) + 1) < 0;
|
||||
}
|
||||
const vector_downward *buf_;
|
||||
};
|
||||
@@ -1961,7 +1961,7 @@ inline const uint8_t *GetBufferStartFromRootPointer(const void *root) {
|
||||
auto table = reinterpret_cast<const Table *>(root);
|
||||
auto vtable = table->GetVTable();
|
||||
// Either the vtable is before the root or after the root.
|
||||
auto start = std::min(vtable, reinterpret_cast<const uint8_t *>(root));
|
||||
auto start = (std::min)(vtable, reinterpret_cast<const uint8_t *>(root));
|
||||
// Align to at least sizeof(uoffset_t).
|
||||
start = reinterpret_cast<const uint8_t *>(
|
||||
reinterpret_cast<uintptr_t>(start) & ~(sizeof(uoffset_t) - 1));
|
||||
|
||||
Reference in New Issue
Block a user