diff options
author | Feng Xiao <xfxyjwf@gmail.com> | 2017-05-05 10:45:23 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-05 10:45:23 -0700 |
commit | 3c369dc07cd0b5fa5b874e42af6191f518ee4bae (patch) | |
tree | 4d8e71b139fec55d8cfa3ae7e2a837b452c422ee /src | |
parent | 99cf2efa8f82e799dfb2cc88f27a1b02f4f8d9c3 (diff) | |
parent | 7378ec2bc8da17ba4b1050dbb1ff05425f05537e (diff) | |
download | protobuf-3c369dc07cd0b5fa5b874e42af6191f518ee4bae.tar.gz protobuf-3c369dc07cd0b5fa5b874e42af6191f518ee4bae.tar.bz2 protobuf-3c369dc07cd0b5fa5b874e42af6191f518ee4bae.zip |
Merge pull request #3057 from xfxyjwf/3.3.x
Fix several C++ build issues.
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.am | 1 | ||||
-rw-r--r-- | src/google/protobuf/compiler/code_generator.h | 4 | ||||
-rw-r--r-- | src/google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc | 8 | ||||
-rw-r--r-- | src/google/protobuf/generated_message_table_driven.cc | 6 |
4 files changed, 14 insertions, 5 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index bfb875ac..5c19bcdc 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -250,6 +250,7 @@ libprotobuf_la_SOURCES = \ google/protobuf/extension_set_heavy.cc \ google/protobuf/field_mask.pb.cc \ google/protobuf/generated_message_reflection.cc \ + google/protobuf/generated_message_table_driven.cc \ google/protobuf/map_field.cc \ google/protobuf/message.cc \ google/protobuf/reflection_internal.h \ diff --git a/src/google/protobuf/compiler/code_generator.h b/src/google/protobuf/compiler/code_generator.h index b917d373..6ea5f18d 100644 --- a/src/google/protobuf/compiler/code_generator.h +++ b/src/google/protobuf/compiler/code_generator.h @@ -162,8 +162,8 @@ typedef GeneratorContext OutputDirectory; // "foo=bar,baz,qux=corge" // parses to the pairs: // ("foo", "bar"), ("baz", ""), ("qux", "corge") -extern void ParseGeneratorParameter(const string&, - std::vector<std::pair<string, string> >*); +LIBPROTOC_EXPORT void ParseGeneratorParameter( + const string&, std::vector<std::pair<string, string> >*); } // namespace compiler } // namespace protobuf diff --git a/src/google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc b/src/google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc index 4e44b578..5c54270e 100644 --- a/src/google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc +++ b/src/google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc @@ -134,6 +134,14 @@ class GenerateAndTest { }; TEST(CsharpBootstrapTest, GeneratedCsharpDescriptorMatches) { + // Skip this whole test if the csharp directory doesn't exist (i.e., a C++11 + // only distribution). + string descriptor_file_name = + "../csharp/src/Google.Protobuf/Reflection/Descriptor.cs"; + if (!File::Exists(TestSourceDir() + "/" + descriptor_file_name)) { + return; + } + MockErrorCollector error_collector; DiskSourceTree source_tree; Importer importer(&source_tree, &error_collector); diff --git a/src/google/protobuf/generated_message_table_driven.cc b/src/google/protobuf/generated_message_table_driven.cc index e281266d..f8fda9c6 100644 --- a/src/google/protobuf/generated_message_table_driven.cc +++ b/src/google/protobuf/generated_message_table_driven.cc @@ -74,7 +74,7 @@ inline Arena* GetArena(MessageLite* msg, int64 arena_offset) { template <typename Type> inline Type* AddField(MessageLite* msg, int64 offset) { #if LANG_CXX11 - static_assert(std::is_trivially_copy_assignable<Type>::value, + static_assert(google::protobuf::internal::has_trivial_copy<Type>::value, "Do not assign"); #endif @@ -94,7 +94,7 @@ inline string* AddField<string>(MessageLite* msg, int64 offset) { template <typename Type> inline void AddField(MessageLite* msg, int64 offset, Type value) { #if LANG_CXX11 - static_assert(std::is_trivially_copy_assignable<Type>::value, + static_assert(google::protobuf::internal::has_trivial_copy<Type>::value, "Do not assign"); #endif *AddField<Type>(msg, offset) = value; @@ -118,7 +118,7 @@ template <typename Type> inline void SetField(MessageLite* msg, uint32* has_bits, uint32 has_bit_index, int64 offset, Type value) { #if LANG_CXX11 - static_assert(std::is_trivially_copy_assignable<Type>::value, + static_assert(google::protobuf::internal::has_trivial_copy<Type>::value, "Do not assign"); #endif *MutableField<Type>(msg, has_bits, has_bit_index, offset) = value; |