| Index: third_party/protobuf/patches/01_build_fixes.patch
|
| diff --git a/third_party/protobuf/patches/01_build_fixes.patch b/third_party/protobuf/patches/01_build_fixes.patch
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..35d6ecd6bbb2d52507a5b6e173e5ca7fa33c714c
|
| --- /dev/null
|
| +++ b/third_party/protobuf/patches/01_build_fixes.patch
|
| @@ -0,0 +1,47 @@
|
| +diff --git a/third_party/protobuf/README.chromium b/third_party/protobuf/README.chromium
|
| +index d845dfa..a3fb161 100644
|
| +--- a/third_party/protobuf/README.chromium
|
| ++++ b/third_party/protobuf/README.chromium
|
| +@@ -19,6 +19,9 @@ Steps used to create the current version:
|
| + will need to modify the README to include the correct revision, and modify
|
| + the buildfiles to reflect the actual files in the source tree, what they
|
| + #include, what warnings they trigger, etc.
|
| ++ 01: Miscellaneous build fixes to make the upstream sources compile. At this
|
| ++ point you should be able to build the protobuf_* and protoc targets (but
|
| ++ not necessarily anything depending on them).
|
| + (3) Generate descriptor_pb2.py using something like the following steps. Make
|
| + sure you've regenerated your buildfiles and will build protoc from the
|
| + newly-modified sources above.
|
| +diff --git a/third_party/protobuf/src/google/protobuf/arena.h b/third_party/protobuf/src/google/protobuf/arena.h
|
| +index 51149ba..ed9afc9 100644
|
| +--- a/third_party/protobuf/src/google/protobuf/arena.h
|
| ++++ b/third_party/protobuf/src/google/protobuf/arena.h
|
| +@@ -34,7 +34,16 @@
|
| + #if __cplusplus >= 201103L
|
| + #include <google/protobuf/stubs/type_traits.h>
|
| + #endif
|
| ++#if defined(_MSC_VER) && !_HAS_EXCEPTIONS
|
| ++// Work around bugs in MSVC <typeinfo> header when _HAS_EXCEPTIONS=0.
|
| ++#include <exception>
|
| + #include <typeinfo>
|
| ++namespace std {
|
| ++using type_info = ::type_info;
|
| ++}
|
| ++#else
|
| ++#include <typeinfo>
|
| ++#endif
|
| +
|
| + #include <google/protobuf/stubs/atomic_sequence_num.h>
|
| + #include <google/protobuf/stubs/atomicops.h>
|
| +diff --git a/third_party/protobuf/src/google/protobuf/stubs/time.cc b/third_party/protobuf/src/google/protobuf/stubs/time.cc
|
| +index 3319a24..49c0412 100644
|
| +--- a/third_party/protobuf/src/google/protobuf/stubs/time.cc
|
| ++++ b/third_party/protobuf/src/google/protobuf/stubs/time.cc
|
| +@@ -21,7 +21,6 @@ static const int64 kSecondsFromEraToEpoch = 62135596800LL;
|
| + static const int64 kMinTime = -62135596800LL; // 0001-01-01T00:00:00
|
| + static const int64 kMaxTime = 253402300799LL; // 9999-12-31T23:59:59
|
| +
|
| +-static const int kNanosPerSecond = 1000000000;
|
| + static const int kNanosPerMillisecond = 1000000;
|
| + static const int kNanosPerMicrosecond = 1000;
|
| +
|
|
|