Fix broken max macro on Windows (#9273)

This commit is contained in:
Alisa 2021-12-15 00:45:13 +08:00 committed by GitHub
parent 29b3d01572
commit 8c29dc2c4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -37,9 +37,6 @@
#include <limits>
#include <type_traits>
#include <utility>
#ifdef max
#undef max // Visual Studio defines this macro
#endif
#if defined(_MSC_VER) && !defined(_LIBCPP_STD_VER) && !_HAS_EXCEPTIONS
// Work around bugs in MSVC <typeinfo> header when _HAS_EXCEPTIONS=0.
#include <exception>

View File

@ -37,6 +37,8 @@
#include <algorithm>
#include <google/protobuf/port_def.inc>
namespace google {
namespace protobuf {
@ -82,4 +84,6 @@ inline char* string_as_array(std::string* str) {
} // namespace protobuf
} // namespace google
#include <google/protobuf/port_undef.inc>
#endif // GOOGLE_PROTOBUF_STUBS_STL_UTIL_H__