Fix broken max macro on Windows (#9273)

pull/9308/head
Alisa 3 years ago committed by GitHub
parent 29b3d01572
commit 8c29dc2c4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      src/google/protobuf/arena.h
  2. 4
      src/google/protobuf/stubs/stl_util.h

@ -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>

@ -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__

Loading…
Cancel
Save