diff --git a/.cvsignore b/.cvsignore index e69de29..03fc912 100644 --- a/.cvsignore +++ b/.cvsignore @@ -0,0 +1 @@ +protobuf-2.0.2.tar.bz2 diff --git a/ftdetect-proto.vim b/ftdetect-proto.vim new file mode 100644 index 0000000..e9b063e --- /dev/null +++ b/ftdetect-proto.vim @@ -0,0 +1,4 @@ +augroup filetype + au! BufRead,BufNewFile *.proto setfiletype proto +augroup end + diff --git a/import.log b/import.log new file mode 100644 index 0000000..37b2468 --- /dev/null +++ b/import.log @@ -0,0 +1 @@ +protobuf-2_0_2-4_fc8:HEAD:protobuf-2.0.2-4.fc8.src.rpm:1227638780 diff --git a/protobuf-fedora-gtest.patch b/protobuf-fedora-gtest.patch new file mode 100644 index 0000000..dd4f701 --- /dev/null +++ b/protobuf-fedora-gtest.patch @@ -0,0 +1,111 @@ +diff --git a/configure.ac b/configure.ac +index 32edd48..69d1ed8 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -27,6 +27,7 @@ AC_CHECK_HEADERS([fcntl.h inttypes.h limits.h stdlib.h unistd.h]) + AC_FUNC_MEMCMP + AC_FUNC_STRTOD + AC_CHECK_FUNCS([ftruncate memset mkdir strchr strerror strtol]) ++GTEST_LIB_CHECK + + ACX_PTHREAD + AC_CXX_STL_HASH +diff --git a/src/Makefile.am b/src/Makefile.am +index c2729da..0d2583f 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -163,12 +163,7 @@ EXTRA_DIST = \ + google/protobuf/testdata/text_format_unittest_extensions_data.txt \ + google/protobuf/package_info.h \ + google/protobuf/io/package_info.h \ +- google/protobuf/compiler/package_info.h \ +- gtest/CHANGES \ +- gtest/CONTRIBUTORS \ +- gtest/COPYING \ +- gtest/README \ +- gtest/gen_gtest_pred_impl.py ++ google/protobuf/compiler/package_info.h + + protoc_outputs = \ + google/protobuf/unittest.pb.cc \ +@@ -205,7 +200,9 @@ unittest_proto_middleman: protoc$(EXEEXT) $(protoc_inputs) + $(protoc_outputs): unittest_proto_middleman + + noinst_PROGRAMS = protobuf-test +-protobuf_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la ++protobuf_test_CPPFLAGS = $(GTEST_CPPFLAGS) ++protobuf_test_CXXFLAGS = $(GTEST_CXXFLAGS) ++protobuf_test_LDADD = $(PTHREAD_LIBS) $(GTEST_LDFLAGS) $(GTEST_LIBS) libprotobuf.la libprotoc.la + protobuf_test_SOURCES = \ + google/protobuf/stubs/common_unittest.cc \ + google/protobuf/stubs/strutil_unittest.cc \ +@@ -235,23 +232,7 @@ protobuf_test_SOURCES = \ + google/protobuf/testing/googletest.h \ + google/protobuf/testing/file.cc \ + google/protobuf/testing/file.h \ +- gtest/gtest.cc \ +- gtest/gtest.h \ +- gtest/gtest-death-test.cc \ +- gtest/gtest-death-test.h \ +- gtest/gtest-filepath.cc \ +- gtest/gtest-internal-inl.h \ +- gtest/gtest-message.h \ +- gtest/gtest-port.cc \ +- gtest/gtest-spi.h \ +- gtest/gtest_main.cc \ +- gtest/gtest_pred_impl.h \ +- gtest/gtest_prod.h \ +- gtest/internal/gtest-death-test-internal.h \ +- gtest/internal/gtest-filepath.h \ +- gtest/internal/gtest-internal.h \ +- gtest/internal/gtest-port.h \ +- gtest/internal/gtest-string.h ++ google/protobuf/testing/gtest_main.cc + + nodist_protobuf_test_SOURCES = $(protoc_outputs) + +diff --git a/src/google/protobuf/testing/gtest_main.cc b/src/google/protobuf/testing/gtest_main.cc +new file mode 100644 +index 0000000..d20c02f +--- /dev/null ++++ b/src/google/protobuf/testing/gtest_main.cc +@@ -0,0 +1,39 @@ ++// Copyright 2006, Google Inc. ++// All rights reserved. ++// ++// Redistribution and use in source and binary forms, with or without ++// modification, are permitted provided that the following conditions are ++// met: ++// ++// * Redistributions of source code must retain the above copyright ++// notice, this list of conditions and the following disclaimer. ++// * Redistributions in binary form must reproduce the above ++// copyright notice, this list of conditions and the following disclaimer ++// in the documentation and/or other materials provided with the ++// distribution. ++// * Neither the name of Google Inc. nor the names of its ++// contributors may be used to endorse or promote products derived from ++// this software without specific prior written permission. ++// ++// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ++// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ++// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ++// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT ++// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ++// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ++// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ++// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ++// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ++// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ ++#include ++ ++#include ++ ++int main(int argc, char **argv) { ++ std::cout << "Running main() from gtest_main.cc\n"; ++ ++ testing::InitGoogleTest(&argc, argv); ++ return RUN_ALL_TESTS(); ++} diff --git a/protobuf-gcc-4.3.0.patch b/protobuf-gcc-4.3.0.patch new file mode 100644 index 0000000..26c9181 --- /dev/null +++ b/protobuf-gcc-4.3.0.patch @@ -0,0 +1,799 @@ +Index: src/google/protobuf/descriptor.pb.cc +=================================================================== +--- src/google/protobuf/descriptor.pb.cc (revision 69) ++++ src/google/protobuf/descriptor.pb.cc (revision 70) +@@ -76,11 +76,14 @@ + void protobuf_BuildDesc_google_2fprotobuf_2fdescriptor_2eproto_AssignGlobalDescriptors(const ::google::protobuf::FileDescriptor* file) { + FileDescriptorSet_descriptor_ = file->message_type(0); + FileDescriptorSet::default_instance_ = new FileDescriptorSet(); ++ static const int FileDescriptorSet_offsets_[1] = { ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorSet, file_), ++ }; + FileDescriptorSet_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + FileDescriptorSet_descriptor_, + FileDescriptorSet::default_instance_, +- FileDescriptorSet::_offsets_, ++ FileDescriptorSet_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorSet, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorSet, _unknown_fields_), + -1, +@@ -89,11 +92,21 @@ + FileDescriptorSet_descriptor_, FileDescriptorSet::default_instance_); + FileDescriptorProto_descriptor_ = file->message_type(1); + FileDescriptorProto::default_instance_ = new FileDescriptorProto(); ++ static const int FileDescriptorProto_offsets_[8] = { ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, name_), ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, package_), ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, dependency_), ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, message_type_), ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, enum_type_), ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, service_), ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, extension_), ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, options_), ++ }; + FileDescriptorProto_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + FileDescriptorProto_descriptor_, + FileDescriptorProto::default_instance_, +- FileDescriptorProto::_offsets_, ++ FileDescriptorProto_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, _unknown_fields_), + -1, +@@ -102,22 +115,35 @@ + FileDescriptorProto_descriptor_, FileDescriptorProto::default_instance_); + DescriptorProto_descriptor_ = file->message_type(2); + DescriptorProto::default_instance_ = new DescriptorProto(); ++ static const int DescriptorProto_offsets_[7] = { ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, name_), ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, field_), ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, extension_), ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, nested_type_), ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, enum_type_), ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, extension_range_), ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, options_), ++ }; + DescriptorProto_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + DescriptorProto_descriptor_, + DescriptorProto::default_instance_, +- DescriptorProto::_offsets_, ++ DescriptorProto_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool()); + DescriptorProto_ExtensionRange_descriptor_ = DescriptorProto_descriptor_->nested_type(0); + DescriptorProto_ExtensionRange::default_instance_ = new DescriptorProto_ExtensionRange(); ++ static const int DescriptorProto_ExtensionRange_offsets_[2] = { ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto_ExtensionRange, start_), ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto_ExtensionRange, end_), ++ }; + DescriptorProto_ExtensionRange_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + DescriptorProto_ExtensionRange_descriptor_, + DescriptorProto_ExtensionRange::default_instance_, +- DescriptorProto_ExtensionRange::_offsets_, ++ DescriptorProto_ExtensionRange_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto_ExtensionRange, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto_ExtensionRange, _unknown_fields_), + -1, +@@ -128,11 +154,21 @@ + DescriptorProto_descriptor_, DescriptorProto::default_instance_); + FieldDescriptorProto_descriptor_ = file->message_type(3); + FieldDescriptorProto::default_instance_ = new FieldDescriptorProto(); ++ static const int FieldDescriptorProto_offsets_[8] = { ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, name_), ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, number_), ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, label_), ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, type_), ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, type_name_), ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, extendee_), ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, default_value_), ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, options_), ++ }; + FieldDescriptorProto_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + FieldDescriptorProto_descriptor_, + FieldDescriptorProto::default_instance_, +- FieldDescriptorProto::_offsets_, ++ FieldDescriptorProto_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, _unknown_fields_), + -1, +@@ -143,11 +179,16 @@ + FieldDescriptorProto_descriptor_, FieldDescriptorProto::default_instance_); + EnumDescriptorProto_descriptor_ = file->message_type(4); + EnumDescriptorProto::default_instance_ = new EnumDescriptorProto(); ++ static const int EnumDescriptorProto_offsets_[3] = { ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumDescriptorProto, name_), ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumDescriptorProto, value_), ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumDescriptorProto, options_), ++ }; + EnumDescriptorProto_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + EnumDescriptorProto_descriptor_, + EnumDescriptorProto::default_instance_, +- EnumDescriptorProto::_offsets_, ++ EnumDescriptorProto_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumDescriptorProto, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumDescriptorProto, _unknown_fields_), + -1, +@@ -156,11 +197,16 @@ + EnumDescriptorProto_descriptor_, EnumDescriptorProto::default_instance_); + EnumValueDescriptorProto_descriptor_ = file->message_type(5); + EnumValueDescriptorProto::default_instance_ = new EnumValueDescriptorProto(); ++ static const int EnumValueDescriptorProto_offsets_[3] = { ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueDescriptorProto, name_), ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueDescriptorProto, number_), ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueDescriptorProto, options_), ++ }; + EnumValueDescriptorProto_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + EnumValueDescriptorProto_descriptor_, + EnumValueDescriptorProto::default_instance_, +- EnumValueDescriptorProto::_offsets_, ++ EnumValueDescriptorProto_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueDescriptorProto, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueDescriptorProto, _unknown_fields_), + -1, +@@ -169,11 +215,16 @@ + EnumValueDescriptorProto_descriptor_, EnumValueDescriptorProto::default_instance_); + ServiceDescriptorProto_descriptor_ = file->message_type(6); + ServiceDescriptorProto::default_instance_ = new ServiceDescriptorProto(); ++ static const int ServiceDescriptorProto_offsets_[3] = { ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceDescriptorProto, name_), ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceDescriptorProto, method_), ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceDescriptorProto, options_), ++ }; + ServiceDescriptorProto_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + ServiceDescriptorProto_descriptor_, + ServiceDescriptorProto::default_instance_, +- ServiceDescriptorProto::_offsets_, ++ ServiceDescriptorProto_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceDescriptorProto, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceDescriptorProto, _unknown_fields_), + -1, +@@ -182,11 +233,17 @@ + ServiceDescriptorProto_descriptor_, ServiceDescriptorProto::default_instance_); + MethodDescriptorProto_descriptor_ = file->message_type(7); + MethodDescriptorProto::default_instance_ = new MethodDescriptorProto(); ++ static const int MethodDescriptorProto_offsets_[4] = { ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, name_), ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, input_type_), ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, output_type_), ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, options_), ++ }; + MethodDescriptorProto_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + MethodDescriptorProto_descriptor_, + MethodDescriptorProto::default_instance_, +- MethodDescriptorProto::_offsets_, ++ MethodDescriptorProto_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, _unknown_fields_), + -1, +@@ -195,11 +252,18 @@ + MethodDescriptorProto_descriptor_, MethodDescriptorProto::default_instance_); + FileOptions_descriptor_ = file->message_type(8); + FileOptions::default_instance_ = new FileOptions(); ++ static const int FileOptions_offsets_[5] = { ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, java_package_), ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, java_outer_classname_), ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, java_multiple_files_), ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, optimize_for_), ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, uninterpreted_option_), ++ }; + FileOptions_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + FileOptions_descriptor_, + FileOptions::default_instance_, +- FileOptions::_offsets_, ++ FileOptions_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, _unknown_fields_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, _extensions_), +@@ -209,11 +273,15 @@ + FileOptions_descriptor_, FileOptions::default_instance_); + MessageOptions_descriptor_ = file->message_type(9); + MessageOptions::default_instance_ = new MessageOptions(); ++ static const int MessageOptions_offsets_[2] = { ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MessageOptions, message_set_wire_format_), ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MessageOptions, uninterpreted_option_), ++ }; + MessageOptions_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + MessageOptions_descriptor_, + MessageOptions::default_instance_, +- MessageOptions::_offsets_, ++ MessageOptions_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MessageOptions, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MessageOptions, _unknown_fields_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MessageOptions, _extensions_), +@@ -222,11 +290,16 @@ + MessageOptions_descriptor_, MessageOptions::default_instance_); + FieldOptions_descriptor_ = file->message_type(10); + FieldOptions::default_instance_ = new FieldOptions(); ++ static const int FieldOptions_offsets_[3] = { ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, ctype_), ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, experimental_map_key_), ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, uninterpreted_option_), ++ }; + FieldOptions_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + FieldOptions_descriptor_, + FieldOptions::default_instance_, +- FieldOptions::_offsets_, ++ FieldOptions_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, _unknown_fields_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, _extensions_), +@@ -236,11 +309,14 @@ + FieldOptions_descriptor_, FieldOptions::default_instance_); + EnumOptions_descriptor_ = file->message_type(11); + EnumOptions::default_instance_ = new EnumOptions(); ++ static const int EnumOptions_offsets_[1] = { ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumOptions, uninterpreted_option_), ++ }; + EnumOptions_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + EnumOptions_descriptor_, + EnumOptions::default_instance_, +- EnumOptions::_offsets_, ++ EnumOptions_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumOptions, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumOptions, _unknown_fields_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumOptions, _extensions_), +@@ -249,11 +325,14 @@ + EnumOptions_descriptor_, EnumOptions::default_instance_); + EnumValueOptions_descriptor_ = file->message_type(12); + EnumValueOptions::default_instance_ = new EnumValueOptions(); ++ static const int EnumValueOptions_offsets_[1] = { ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueOptions, uninterpreted_option_), ++ }; + EnumValueOptions_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + EnumValueOptions_descriptor_, + EnumValueOptions::default_instance_, +- EnumValueOptions::_offsets_, ++ EnumValueOptions_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueOptions, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueOptions, _unknown_fields_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueOptions, _extensions_), +@@ -262,11 +341,14 @@ + EnumValueOptions_descriptor_, EnumValueOptions::default_instance_); + ServiceOptions_descriptor_ = file->message_type(13); + ServiceOptions::default_instance_ = new ServiceOptions(); ++ static const int ServiceOptions_offsets_[1] = { ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceOptions, uninterpreted_option_), ++ }; + ServiceOptions_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + ServiceOptions_descriptor_, + ServiceOptions::default_instance_, +- ServiceOptions::_offsets_, ++ ServiceOptions_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceOptions, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceOptions, _unknown_fields_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceOptions, _extensions_), +@@ -275,11 +357,14 @@ + ServiceOptions_descriptor_, ServiceOptions::default_instance_); + MethodOptions_descriptor_ = file->message_type(14); + MethodOptions::default_instance_ = new MethodOptions(); ++ static const int MethodOptions_offsets_[1] = { ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodOptions, uninterpreted_option_), ++ }; + MethodOptions_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + MethodOptions_descriptor_, + MethodOptions::default_instance_, +- MethodOptions::_offsets_, ++ MethodOptions_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodOptions, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodOptions, _unknown_fields_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodOptions, _extensions_), +@@ -288,22 +373,34 @@ + MethodOptions_descriptor_, MethodOptions::default_instance_); + UninterpretedOption_descriptor_ = file->message_type(15); + UninterpretedOption::default_instance_ = new UninterpretedOption(); ++ static const int UninterpretedOption_offsets_[6] = { ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, name_), ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, identifier_value_), ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, positive_int_value_), ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, negative_int_value_), ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, double_value_), ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, string_value_), ++ }; + UninterpretedOption_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + UninterpretedOption_descriptor_, + UninterpretedOption::default_instance_, +- UninterpretedOption::_offsets_, ++ UninterpretedOption_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, _unknown_fields_), + -1, + ::google::protobuf::DescriptorPool::generated_pool()); + UninterpretedOption_NamePart_descriptor_ = UninterpretedOption_descriptor_->nested_type(0); + UninterpretedOption_NamePart::default_instance_ = new UninterpretedOption_NamePart(); ++ static const int UninterpretedOption_NamePart_offsets_[2] = { ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption_NamePart, name_part_), ++ GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption_NamePart, is_extension_), ++ }; + UninterpretedOption_NamePart_reflection_ = + new ::google::protobuf::internal::GeneratedMessageReflection( + UninterpretedOption_NamePart_descriptor_, + UninterpretedOption_NamePart::default_instance_, +- UninterpretedOption_NamePart::_offsets_, ++ UninterpretedOption_NamePart_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption_NamePart, _has_bits_[0]), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption_NamePart, _unknown_fields_), + -1, +@@ -442,10 +539,6 @@ + // =================================================================== + + +-const int FileDescriptorSet::_offsets_[1] = { +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorSet, file_), +-}; +- + FileDescriptorSet::FileDescriptorSet() + : ::google::protobuf::Message(), + _cached_size_(0) { +@@ -617,17 +710,6 @@ + + + +-const int FileDescriptorProto::_offsets_[8] = { +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, name_), +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, package_), +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, dependency_), +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, message_type_), +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, enum_type_), +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, service_), +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, extension_), +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, options_), +-}; +- + FileDescriptorProto::FileDescriptorProto() + : ::google::protobuf::Message(), + _cached_size_(0), +@@ -1032,11 +1114,6 @@ + + + +-const int DescriptorProto_ExtensionRange::_offsets_[2] = { +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto_ExtensionRange, start_), +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto_ExtensionRange, end_), +-}; +- + DescriptorProto_ExtensionRange::DescriptorProto_ExtensionRange() + : ::google::protobuf::Message(), + _cached_size_(0), +@@ -1244,16 +1321,6 @@ + + + +-const int DescriptorProto::_offsets_[7] = { +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, name_), +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, field_), +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, extension_), +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, nested_type_), +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, enum_type_), +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, extension_range_), +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, options_), +-}; +- + DescriptorProto::DescriptorProto() + : ::google::protobuf::Message(), + _cached_size_(0), +@@ -1703,17 +1770,6 @@ + const ::std::string FieldDescriptorProto::_default_extendee_; + const ::std::string FieldDescriptorProto::_default_default_value_; + +-const int FieldDescriptorProto::_offsets_[8] = { +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, name_), +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, number_), +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, label_), +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, type_), +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, type_name_), +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, extendee_), +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, default_value_), +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, options_), +-}; +- + FieldDescriptorProto::FieldDescriptorProto() + : ::google::protobuf::Message(), + _cached_size_(0), +@@ -2137,12 +2193,6 @@ + const ::std::string EnumDescriptorProto::_default_name_; + + +-const int EnumDescriptorProto::_offsets_[3] = { +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumDescriptorProto, name_), +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumDescriptorProto, value_), +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumDescriptorProto, options_), +-}; +- + EnumDescriptorProto::EnumDescriptorProto() + : ::google::protobuf::Message(), + _cached_size_(0), +@@ -2388,12 +2438,6 @@ + const ::std::string EnumValueDescriptorProto::_default_name_; + + +-const int EnumValueDescriptorProto::_offsets_[3] = { +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueDescriptorProto, name_), +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueDescriptorProto, number_), +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueDescriptorProto, options_), +-}; +- + EnumValueDescriptorProto::EnumValueDescriptorProto() + : ::google::protobuf::Message(), + _cached_size_(0), +@@ -2639,12 +2683,6 @@ + const ::std::string ServiceDescriptorProto::_default_name_; + + +-const int ServiceDescriptorProto::_offsets_[3] = { +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceDescriptorProto, name_), +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceDescriptorProto, method_), +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceDescriptorProto, options_), +-}; +- + ServiceDescriptorProto::ServiceDescriptorProto() + : ::google::protobuf::Message(), + _cached_size_(0), +@@ -2891,13 +2929,6 @@ + const ::std::string MethodDescriptorProto::_default_input_type_; + const ::std::string MethodDescriptorProto::_default_output_type_; + +-const int MethodDescriptorProto::_offsets_[4] = { +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, name_), +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, input_type_), +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, output_type_), +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, options_), +-}; +- + MethodDescriptorProto::MethodDescriptorProto() + : ::google::protobuf::Message(), + _cached_size_(0), +@@ -3205,14 +3236,6 @@ + + + +-const int FileOptions::_offsets_[5] = { +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, java_package_), +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, java_outer_classname_), +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, java_multiple_files_), +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, optimize_for_), +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, uninterpreted_option_), +-}; +- + FileOptions::FileOptions() + : ::google::protobuf::Message(), + _extensions_(&FileOptions_descriptor_, +@@ -3539,11 +3562,6 @@ + + + +-const int MessageOptions::_offsets_[2] = { +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MessageOptions, message_set_wire_format_), +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MessageOptions, uninterpreted_option_), +-}; +- + MessageOptions::MessageOptions() + : ::google::protobuf::Message(), + _extensions_(&MessageOptions_descriptor_, +@@ -3784,12 +3802,6 @@ + + const ::std::string FieldOptions::_default_experimental_map_key_; + +-const int FieldOptions::_offsets_[3] = { +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, ctype_), +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, experimental_map_key_), +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, uninterpreted_option_), +-}; +- + FieldOptions::FieldOptions() + : ::google::protobuf::Message(), + _extensions_(&FieldOptions_descriptor_, +@@ -4049,10 +4061,6 @@ + // =================================================================== + + +-const int EnumOptions::_offsets_[1] = { +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumOptions, uninterpreted_option_), +-}; +- + EnumOptions::EnumOptions() + : ::google::protobuf::Message(), + _extensions_(&EnumOptions_descriptor_, +@@ -4236,10 +4244,6 @@ + // =================================================================== + + +-const int EnumValueOptions::_offsets_[1] = { +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueOptions, uninterpreted_option_), +-}; +- + EnumValueOptions::EnumValueOptions() + : ::google::protobuf::Message(), + _extensions_(&EnumValueOptions_descriptor_, +@@ -4423,10 +4427,6 @@ + // =================================================================== + + +-const int ServiceOptions::_offsets_[1] = { +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceOptions, uninterpreted_option_), +-}; +- + ServiceOptions::ServiceOptions() + : ::google::protobuf::Message(), + _extensions_(&ServiceOptions_descriptor_, +@@ -4610,10 +4610,6 @@ + // =================================================================== + + +-const int MethodOptions::_offsets_[1] = { +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodOptions, uninterpreted_option_), +-}; +- + MethodOptions::MethodOptions() + : ::google::protobuf::Message(), + _extensions_(&MethodOptions_descriptor_, +@@ -4798,11 +4794,6 @@ + + const ::std::string UninterpretedOption_NamePart::_default_name_part_; + +-const int UninterpretedOption_NamePart::_offsets_[2] = { +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption_NamePart, name_part_), +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption_NamePart, is_extension_), +-}; +- + UninterpretedOption_NamePart::UninterpretedOption_NamePart() + : ::google::protobuf::Message(), + _cached_size_(0), +@@ -5012,15 +5003,6 @@ + + + const ::std::string UninterpretedOption::_default_string_value_; +-const int UninterpretedOption::_offsets_[6] = { +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, name_), +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, identifier_value_), +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, positive_int_value_), +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, negative_int_value_), +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, double_value_), +- GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, string_value_), +-}; +- + UninterpretedOption::UninterpretedOption() + : ::google::protobuf::Message(), + _cached_size_(0), +Index: src/google/protobuf/compiler/cpp/cpp_message.cc +=================================================================== +--- src/google/protobuf/compiler/cpp/cpp_message.cc (revision 69) ++++ src/google/protobuf/compiler/cpp/cpp_message.cc (revision 70) +@@ -508,8 +508,6 @@ + + if (descriptor_->field_count() > 0) { + printer->Print(vars, +- "static const int _offsets_[$field_count$];\n" +- "\n" + "::google::protobuf::uint32 _has_bits_[($field_count$ + 31) / 32];\n"); + } else { + // Zero-size arrays aren't technically allowed, and MSVC in particular +@@ -517,8 +515,6 @@ + // other code compile. Since this is an uncommon case, we'll just declare + // them with size 1 and waste some space. Oh well. + printer->Print( +- "static const int _offsets_[1];\n" +- "\n" + "::google::protobuf::uint32 _has_bits_[1];\n"); + } + +@@ -598,13 +594,16 @@ + printer->Print(vars, + "$classname$::default_instance_ = new $classname$();\n"); + ++ // Generate the offsets. ++ GenerateOffsets(printer); ++ + // Construct the reflection object. + printer->Print(vars, + "$classname$_reflection_ =\n" + " new ::google::protobuf::internal::GeneratedMessageReflection(\n" + " $classname$_descriptor_,\n" + " $classname$::default_instance_,\n" +- " $classname$::_offsets_,\n" ++ " $classname$_offsets_,\n" + " GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET($classname$, _has_bits_[0]),\n" + " GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(" + "$classname$, _unknown_fields_),\n"); +@@ -672,9 +671,6 @@ + extension_generators_[i]->GenerateDefinition(printer); + } + +- GenerateOffsets(printer); +- printer->Print("\n"); +- + GenerateStructors(printer); + printer->Print("\n"); + +@@ -718,7 +714,7 @@ + void MessageGenerator:: + GenerateOffsets(io::Printer* printer) { + printer->Print( +- "const int $classname$::_offsets_[$field_count$] = {\n", ++ "static const int $classname$_offsets_[$field_count$] = {\n", + "classname", classname_, + "field_count", SimpleItoa(max(1, descriptor_->field_count()))); + printer->Indent(); +Index: src/google/protobuf/descriptor.pb.h +=================================================================== +--- src/google/protobuf/descriptor.pb.h (revision 69) ++++ src/google/protobuf/descriptor.pb.h (revision 70) +@@ -169,8 +169,6 @@ + ::google::protobuf::RepeatedPtrField< ::google::protobuf::FileDescriptorProto > file_; + friend void protobuf_BuildDesc_google_2fprotobuf_2fdescriptor_2eproto_AssignGlobalDescriptors( + const ::google::protobuf::FileDescriptor* file); +- static const int _offsets_[1]; +- + ::google::protobuf::uint32 _has_bits_[(1 + 31) / 32]; + + // WHY DOES & HAVE LOWER PRECEDENCE THAN != !? +@@ -325,8 +323,6 @@ + ::google::protobuf::FileOptions* options_; + friend void protobuf_BuildDesc_google_2fprotobuf_2fdescriptor_2eproto_AssignGlobalDescriptors( + const ::google::protobuf::FileDescriptor* file); +- static const int _offsets_[8]; +- + ::google::protobuf::uint32 _has_bits_[(8 + 31) / 32]; + + // WHY DOES & HAVE LOWER PRECEDENCE THAN != !? +@@ -414,8 +410,6 @@ + ::google::protobuf::int32 end_; + friend void protobuf_BuildDesc_google_2fprotobuf_2fdescriptor_2eproto_AssignGlobalDescriptors( + const ::google::protobuf::FileDescriptor* file); +- static const int _offsets_[2]; +- + ::google::protobuf::uint32 _has_bits_[(2 + 31) / 32]; + + // WHY DOES & HAVE LOWER PRECEDENCE THAN != !? +@@ -558,8 +552,6 @@ + ::google::protobuf::MessageOptions* options_; + friend void protobuf_BuildDesc_google_2fprotobuf_2fdescriptor_2eproto_AssignGlobalDescriptors( + const ::google::protobuf::FileDescriptor* file); +- static const int _offsets_[7]; +- + ::google::protobuf::uint32 _has_bits_[(7 + 31) / 32]; + + // WHY DOES & HAVE LOWER PRECEDENCE THAN != !? +@@ -748,8 +740,6 @@ + ::google::protobuf::FieldOptions* options_; + friend void protobuf_BuildDesc_google_2fprotobuf_2fdescriptor_2eproto_AssignGlobalDescriptors( + const ::google::protobuf::FileDescriptor* file); +- static const int _offsets_[8]; +- + ::google::protobuf::uint32 _has_bits_[(8 + 31) / 32]; + + // WHY DOES & HAVE LOWER PRECEDENCE THAN != !? +@@ -850,8 +840,6 @@ + ::google::protobuf::EnumOptions* options_; + friend void protobuf_BuildDesc_google_2fprotobuf_2fdescriptor_2eproto_AssignGlobalDescriptors( + const ::google::protobuf::FileDescriptor* file); +- static const int _offsets_[3]; +- + ::google::protobuf::uint32 _has_bits_[(3 + 31) / 32]; + + // WHY DOES & HAVE LOWER PRECEDENCE THAN != !? +@@ -949,8 +937,6 @@ + ::google::protobuf::EnumValueOptions* options_; + friend void protobuf_BuildDesc_google_2fprotobuf_2fdescriptor_2eproto_AssignGlobalDescriptors( + const ::google::protobuf::FileDescriptor* file); +- static const int _offsets_[3]; +- + ::google::protobuf::uint32 _has_bits_[(3 + 31) / 32]; + + // WHY DOES & HAVE LOWER PRECEDENCE THAN != !? +@@ -1051,8 +1037,6 @@ + ::google::protobuf::ServiceOptions* options_; + friend void protobuf_BuildDesc_google_2fprotobuf_2fdescriptor_2eproto_AssignGlobalDescriptors( + const ::google::protobuf::FileDescriptor* file); +- static const int _offsets_[3]; +- + ::google::protobuf::uint32 _has_bits_[(3 + 31) / 32]; + + // WHY DOES & HAVE LOWER PRECEDENCE THAN != !? +@@ -1163,8 +1147,6 @@ + ::google::protobuf::MethodOptions* options_; + friend void protobuf_BuildDesc_google_2fprotobuf_2fdescriptor_2eproto_AssignGlobalDescriptors( + const ::google::protobuf::FileDescriptor* file); +- static const int _offsets_[4]; +- + ::google::protobuf::uint32 _has_bits_[(4 + 31) / 32]; + + // WHY DOES & HAVE LOWER PRECEDENCE THAN != !? +@@ -1379,8 +1361,6 @@ + ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption > uninterpreted_option_; + friend void protobuf_BuildDesc_google_2fprotobuf_2fdescriptor_2eproto_AssignGlobalDescriptors( + const ::google::protobuf::FileDescriptor* file); +- static const int _offsets_[5]; +- + ::google::protobuf::uint32 _has_bits_[(5 + 31) / 32]; + + // WHY DOES & HAVE LOWER PRECEDENCE THAN != !? +@@ -1553,8 +1533,6 @@ + ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption > uninterpreted_option_; + friend void protobuf_BuildDesc_google_2fprotobuf_2fdescriptor_2eproto_AssignGlobalDescriptors( + const ::google::protobuf::FileDescriptor* file); +- static const int _offsets_[2]; +- + ::google::protobuf::uint32 _has_bits_[(2 + 31) / 32]; + + // WHY DOES & HAVE LOWER PRECEDENCE THAN != !? +@@ -1752,8 +1730,6 @@ + ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption > uninterpreted_option_; + friend void protobuf_BuildDesc_google_2fprotobuf_2fdescriptor_2eproto_AssignGlobalDescriptors( + const ::google::protobuf::FileDescriptor* file); +- static const int _offsets_[3]; +- + ::google::protobuf::uint32 _has_bits_[(3 + 31) / 32]; + + // WHY DOES & HAVE LOWER PRECEDENCE THAN != !? +@@ -1919,8 +1895,6 @@ + ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption > uninterpreted_option_; + friend void protobuf_BuildDesc_google_2fprotobuf_2fdescriptor_2eproto_AssignGlobalDescriptors( + const ::google::protobuf::FileDescriptor* file); +- static const int _offsets_[1]; +- + ::google::protobuf::uint32 _has_bits_[(1 + 31) / 32]; + + // WHY DOES & HAVE LOWER PRECEDENCE THAN != !? +@@ -2086,8 +2060,6 @@ + ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption > uninterpreted_option_; + friend void protobuf_BuildDesc_google_2fprotobuf_2fdescriptor_2eproto_AssignGlobalDescriptors( + const ::google::protobuf::FileDescriptor* file); +- static const int _offsets_[1]; +- + ::google::protobuf::uint32 _has_bits_[(1 + 31) / 32]; + + // WHY DOES & HAVE LOWER PRECEDENCE THAN != !? +@@ -2253,8 +2225,6 @@ + ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption > uninterpreted_option_; + friend void protobuf_BuildDesc_google_2fprotobuf_2fdescriptor_2eproto_AssignGlobalDescriptors( + const ::google::protobuf::FileDescriptor* file); +- static const int _offsets_[1]; +- + ::google::protobuf::uint32 _has_bits_[(1 + 31) / 32]; + + // WHY DOES & HAVE LOWER PRECEDENCE THAN != !? +@@ -2420,8 +2390,6 @@ + ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption > uninterpreted_option_; + friend void protobuf_BuildDesc_google_2fprotobuf_2fdescriptor_2eproto_AssignGlobalDescriptors( + const ::google::protobuf::FileDescriptor* file); +- static const int _offsets_[1]; +- + ::google::protobuf::uint32 _has_bits_[(1 + 31) / 32]; + + // WHY DOES & HAVE LOWER PRECEDENCE THAN != !? +@@ -2512,8 +2480,6 @@ + bool is_extension_; + friend void protobuf_BuildDesc_google_2fprotobuf_2fdescriptor_2eproto_AssignGlobalDescriptors( + const ::google::protobuf::FileDescriptor* file); +- static const int _offsets_[2]; +- + ::google::protobuf::uint32 _has_bits_[(2 + 31) / 32]; + + // WHY DOES & HAVE LOWER PRECEDENCE THAN != !? +@@ -2641,8 +2607,6 @@ + static const ::std::string _default_string_value_; + friend void protobuf_BuildDesc_google_2fprotobuf_2fdescriptor_2eproto_AssignGlobalDescriptors( + const ::google::protobuf::FileDescriptor* file); +- static const int _offsets_[6]; +- + ::google::protobuf::uint32 _has_bits_[(6 + 31) / 32]; + + // WHY DOES & HAVE LOWER PRECEDENCE THAN != !? diff --git a/protobuf-java-notests.patch b/protobuf-java-notests.patch new file mode 100644 index 0000000..251e1c1 --- /dev/null +++ b/protobuf-java-notests.patch @@ -0,0 +1,78 @@ +--- java/pom.xml.orig 2008-10-12 13:17:47.000000000 +0400 ++++ java/pom.xml 2008-10-12 13:32:22.000000000 +0400 +@@ -47,26 +47,6 @@ + true + + +- +- +- junit +- junit +- 4.4 +- test +- +- +- org.easymock +- easymock +- 2.2 +- test +- +- +- org.easymock +- easymockclassextension +- 2.2.1 +- test +- +- + + + +@@ -77,14 +57,6 @@ + + + +- maven-surefire-plugin +- +- +- **/*Test.java +- +- +- +- + maven-antrun-plugin + + +@@ -105,33 +77,6 @@ + run + + +- +- generate-test-sources +- generate-test-sources +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- target/generated-test-sources +- +- +- run +- +- + + + diff --git a/protobuf-pkgconfig-autotools.patch b/protobuf-pkgconfig-autotools.patch new file mode 100644 index 0000000..28afd3c --- /dev/null +++ b/protobuf-pkgconfig-autotools.patch @@ -0,0 +1,21 @@ +--- protobuf-2.0.2/configure.ac.orig 2008-10-03 17:54:31.000000000 +0000 ++++ protobuf-2.0.2/configure.ac 2008-10-06 08:31:06.000000000 +0000 +@@ -31,5 +31,5 @@ + ACX_PTHREAD + AC_CXX_STL_HASH + +-AC_CONFIG_FILES([Makefile src/Makefile ]) ++AC_CONFIG_FILES([Makefile src/Makefile protobuf.pc ]) + AC_OUTPUT +--- protobuf-2.0.0beta/Makefile.am.orig 2008-07-03 15:41:02.000000000 -0600 ++++ protobuf-2.0.0beta/Makefile.am 2008-08-13 10:09:59.000000000 -0600 +@@ -113,5 +113,9 @@ + Makefile.in \ + missing \ + mkinstalldirs \ + config.h.in \ + stamp.h.in ++ ++pkgconfigdir = $(libdir)/pkgconfig ++pkgconfig_DATA = protobuf.pc ++ diff --git a/protobuf.pc.in b/protobuf.pc.in new file mode 100644 index 0000000..e2cc3a3 --- /dev/null +++ b/protobuf.pc.in @@ -0,0 +1,15 @@ +############################################################################# +## Copyright (C) 2008 by Rick L. Vinyard, Jr. ## +## rvinyard@cs.nmsu.edu ## +############################################################################# +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: protobuf +Description: Protocol Buffers are a way of encoding structured data +Requires: +Version: 2.0.2 +Libs: -L${libdir} -lprotobuf +Cflags: -I${includedir}/google/ diff --git a/protobuf.spec b/protobuf.spec new file mode 100644 index 0000000..4dcd654 --- /dev/null +++ b/protobuf.spec @@ -0,0 +1,311 @@ +# don't build -python subpackage +%define with_python %{?_without_python: 0} %{?!_without_python: 1} +# don't build -java subpackages +%define with_java %{?_without_java: 0} %{?!_without_java: 1} +# don't require gtest for building +%define without_gtest %{?_without_gtest: 1} %{?!_without_gtest: 0} + +%if %{with_python} +%define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()") +%endif + +Summary: Protocol Buffers - Google's data interchange format +Name: protobuf +Version: 2.0.2 +Release: 4%{?dist} +License: BSD +Group: Development/Libraries +Source: http://protobuf.googlecode.com/files/%{name}-%{version}.tar.bz2 +Source1: protobuf.pc.in +Source2: ftdetect-proto.vim +Patch0: protobuf-pkgconfig-autotools.patch +Patch1: protobuf-fedora-gtest.patch +Patch2: protobuf-java-notests.patch +Patch3: protobuf-gcc-4.3.0.patch +URL: http://code.google.com/p/protobuf/ +BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) +BuildRequires: automake autoconf libtool pkgconfig +%if !%{without_gtest} +BuildRequires: gtest-devel +%endif + +%description +Protocol Buffers are a way of encoding structured data in an efficient +yet extensible format. Google uses Protocol Buffers for almost all of +its internal RPC protocols and file formats. + +Protocol buffers are a flexible, efficient, automated mechanism for +serializing structured data – think XML, but smaller, faster, and +simpler. You define how you want your data to be structured once, then +you can use special generated source code to easily write and read +your structured data to and from a variety of data streams and using a +variety of languages. You can even update your data structure without +breaking deployed programs that are compiled against the "old" format. + +%package compiler +Summary: Protocol Buffers compiler +Group: Development/Libraries +Requires: %{name} = %{version}-%{release} + +%description compiler +This package contains Protocol Buffers compiler for all programming +languages + +%package devel +Summary: Protocol Buffers C++ headers and libraries +Group: Development/Libraries +Requires: %{name} = %{version}-%{release} +Requires: %{name}-compiler = %{version}-%{release} +Requires: pkgconfig + +%description devel +This package contains Protocol Buffers compiler for all languages and +C++ headers and libraries + +%package static +Summary: Static development files for %{name} +Group: Development/Libraries +Requires: %{name} = %{version}-%{release} + +%description static +Static libraries for Protocol Buffers + +%if %{with_python} +%package python +Summary: Python bindings for Google Protocol Buffers +Group: Development/Languages +BuildRequires: python-devel +BuildRequires: python-setuptools-devel +Conflicts: %{name}-compiler > %{version} +Conflicts: %{name}-compiler < %{version} + +%description python +This package contains Python libraries for Google Protocol Buffers +%endif + +%package vim +Summary: Vim syntax highlighting for Google Protocol Buffers descriptions +Group: Development/Libraries +Requires: vim-enhanced + +%description vim +This package contains syntax highlighting for Google Protocol Buffers +descriptions in Vim editor + +%if %{with_java} +%package java +Summary: Java Protocol Buffers runtime library +Group: Development/Languages +BuildRequires: java-devel >= 1.6 +BuildRequires: jpackage-utils +BuildRequires: maven2 +BuildRequires: maven2-plugin-compiler +BuildRequires: maven2-plugin-install +BuildRequires: maven2-plugin-jar +BuildRequires: maven2-plugin-javadoc +BuildRequires: maven2-plugin-release +BuildRequires: maven2-plugin-resources +BuildRequires: maven2-plugin-surefire +BuildRequires: maven2-plugin-antrun +Requires: java +Requires: jpackage-utils +Requires(post): jpackage-utils +Requires(postun): jpackage-utils +Conflicts: %{name}-compiler > %{version} +Conflicts: %{name}-compiler < %{version} + +%description java +This package contains Java Protocol Buffers runtime library. + +%package javadoc +Summary: Javadocs for %{name}-java +Group: Documentation +Requires: jpackage-utils +Requires: %{name}-java = %{version}-%{release} + +%description javadoc +This package contains the API documentation for %{name}-java. + +%endif + +%prep +%setup -q +%patch0 -p1 +%if !%{without_gtest} +rm -rf src/gtest +%patch1 -p1 +%endif +cp -p %{SOURCE1} . +chmod 644 examples/* +%if %{with_java} +%patch2 +rm -rf java/src/test +%endif +%patch3 -p0 + +%build +./autogen.sh +%configure + +make %{?_smp_mflags} + +%if %{with_python} +pushd python +python ./setup.py build +sed -i -e 1d build/lib/google/protobuf/descriptor_pb2.py +popd +%endif + +%if %{with_java} +pushd java +export MAVEN_REPO_LOCAL=$(pwd)/.m2/repository +mkdir -p $MAVEN_REPO_LOCAL +mvn-jpp -Dmaven.repo.local=$MAVEN_REPO_LOCAL install javadoc:javadoc +popd +%endif + +%check +make %{?_smp_mflags} check + +%install +rm -rf %{buildroot} +make %{?_smp_mflags} install DESTDIR=%{buildroot} STRIPBINARIES=no INSTALL="%{__install} -p" CPPROG="cp -p" +find %{buildroot} -type f -name "*.la" -exec rm -f {} \; +%if %{with_python} +pushd python +python ./setup.py install --root=%{buildroot} --single-version-externally-managed --record=INSTALLED_FILES --optimize=1 +popd +%endif +install -p -m 644 -D %{SOURCE2} %{buildroot}%{_datadir}/vim/vimfiles/ftdetect/proto.vim +install -p -m 644 -D editors/proto.vim %{buildroot}%{_datadir}/vim/vimfiles/syntax/proto.vim + +%if %{with_java} +pushd java +install -d -m 755 %{buildroot}%{_javadir} +install -pm 644 target/%{name}-java-%{version}.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar + +install -d -m 755 %{buildroot}%{_javadocdir}/%{name} +cp -rp target/site/apidocs %{buildroot}%{_javadocdir}/%{name} + +install -d -m 755 %{buildroot}%{_datadir}/maven2/poms +install -pm 644 pom.xml %{buildroot}%{_datadir}/maven2/poms/JPP-%{name}.pom +%add_to_maven_depmap org.apache.maven %{name} %{version} JPP %{name} + +%endif + +%post -p /sbin/ldconfig +%postun -p /sbin/ldconfig + +%post compiler -p /sbin/ldconfig +%postun compiler -p /sbin/ldconfig + +%if %{with_java} +%post java +%update_maven_depmap + +%postun java +%update_maven_depmap +%endif + +%clean +rm -rf %{buildroot} + +%files +%defattr(-, root, root, -) +%{_libdir}/libprotobuf.so.* +%doc CHANGES.txt CONTRIBUTORS.txt COPYING.txt README.txt + +%files compiler +%defattr(-, root, root, -) +%{_bindir}/protoc +%{_libdir}/libprotoc.so.* +%doc COPYING.txt README.txt + +%files devel +%defattr(-, root, root, -) +%dir %{_includedir}/google +%{_includedir}/google/protobuf/ +%{_libdir}/libprotobuf.so +%{_libdir}/libprotoc.so +%{_libdir}/pkgconfig/protobuf.pc +%doc examples/add_person.cc examples/addressbook.proto examples/list_people.cc examples/Makefile examples/README.txt + +%files static +%defattr(-, root, root, -) +%{_libdir}/libprotobuf.a +%{_libdir}/libprotoc.a + +%if %{with_python} +%files python +%defattr(-, root, root, -) +%dir %{python_sitelib}/google +%{python_sitelib}/google/protobuf/ +%{python_sitelib}/protobuf-2.0.2-py2.5.egg-info/ +%{python_sitelib}/protobuf-2.0.2-py2.5-nspkg.pth +%doc python/README.txt +%doc examples/add_person.py examples/list_people.py examples/addressbook.proto +%endif + +%files vim +%defattr(-, root, root, -) +%{_datadir}/vim/vimfiles/ftdetect/proto.vim +%{_datadir}/vim/vimfiles/syntax/proto.vim + +%if %{with_java} +%files java +%defattr(-, root, root, -) +%{_datadir}/maven2/poms/JPP-protobuf.pom +%{_mavendepmapfragdir}/protobuf +%{_javadir}/* +%doc examples/AddPerson.java examples/ListPeople.java + +%files javadoc +%defattr(-, root, root, -) +%{_javadocdir}/%{name} +%endif + +%changelog +* Sat Nov 22 2008 Lev Shamardin - 2.0.2-4 +- Added patch from subversion r70 to workaround gcc 4.3.0 bug (see + http://code.google.com/p/protobuf/issues/detail?id=45 for more + details). + +* Tue Nov 11 2008 Lev Shamardin - 2.0.2-3 +- Added conflicts to java and python subpackages to prevent using with + wrong compiler versions. +- Fixed license. +- Fixed BuildRequires for -python subpackage. +- Fixed Requires and Group for -javadoc subpackage. +- Fixed Requires for -devel subpackage. +- Fixed issue with wrong shebang in descriptor_pb2.py. +- Specify build options via --with/--without. +- Use Fedora-packaged gtest library instead of a bundled one by + default (optional). + +* Fri Oct 31 2008 Lev Shamardin - 2.0.2-2 +- Use python_sitelib macro instead of INSTALLED_FILES. +- Fix the license. +- Fix redundant requirement for -devel subpackage. +- Fix wrong dependences for -python subpackage. +- Fix typo in requirements for -javadoc subpackage. +- Use -p option for cp and install to preserve timestamps. +- Remove unneeded ldconfig call for post scripts of -devel subpackage. +- Fix directories ownership. + +* Sun Oct 12 2008 Lev Shamardin - 2.0.2-1 +- Update to version 2.0.2 +- New -java and -javadoc subpackages. +- Options to disable building of -python and -java* subpackages + +* Mon Sep 15 2008 Lev Shamardin - 2.0.1-2 +- Added -p switch to install commands to preserve timestamps. +- Fixed Version and Libs in pkgconfig script. +- Added pkgconfig requires for -devel package. +- Removed libtool archives from -devel package. + +* Thu Sep 04 2008 Lev Shamardin - 2.0.1-1 +- Updated to 2.0.1 version. + +* Wed Aug 13 2008 Lev Shamardin - 2.0.0-0.1.beta +- Initial package version. Credits for vim subpackage and pkgconfig go + to Rick L Vinyard Jr diff --git a/sources b/sources index e69de29..0054cc6 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +6674270b1d63c2c4b292644f48fede4e protobuf-2.0.2.tar.bz2