diff options
33 files changed, 96 insertions, 65 deletions
diff --git a/Makefile.am b/Makefile.am index 4a29e1cf..6bda5157 100644 --- a/Makefile.am +++ b/Makefile.am @@ -35,38 +35,7 @@ clean-local: pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = protobuf.pc protobuf-lite.pc -EXTRA_DIST = \ - autogen.sh \ - generate_descriptor_proto.sh \ - README.md \ - INSTALL.txt \ - LICENSE \ - CONTRIBUTORS.txt \ - CHANGES.txt \ - editors/README.txt \ - editors/proto.vim \ - editors/protobuf-mode.el \ - vsprojects/config.h \ - vsprojects/extract_includes.bat \ - vsprojects/libprotobuf.vcproj \ - vsprojects/libprotobuf-lite.vcproj \ - vsprojects/libprotoc.vcproj \ - vsprojects/protobuf.sln \ - vsprojects/protoc.vcproj \ - vsprojects/readme.txt \ - vsprojects/test_plugin.vcproj \ - vsprojects/tests.vcproj \ - vsprojects/lite-test.vcproj \ - vsprojects/convert2008to2005.sh \ - examples/README.txt \ - examples/Makefile \ - examples/addressbook.proto \ - examples/add_person.cc \ - examples/list_people.cc \ - examples/AddPerson.java \ - examples/ListPeople.java \ - examples/add_person.py \ - examples/list_people.py \ +java_EXTRA_DIST= \ java/src/main/java/com/google/protobuf/AbstractMessage.java \ java/src/main/java/com/google/protobuf/AbstractMessageLite.java \ java/src/main/java/com/google/protobuf/AbstractParser.java \ @@ -182,7 +151,9 @@ EXTRA_DIST = \ java/src/test/java/com/google/protobuf/test_check_utf8_size.proto \ java/src/test/java/com/google/protobuf/test_custom_options.proto \ java/pom.xml \ - java/README.txt \ + java/README.txt + +python_EXTRA_DIST= \ python/google/protobuf/internal/api_implementation.cc \ python/google/protobuf/internal/api_implementation.py \ python/google/protobuf/internal/api_implementation_default_test.py \ @@ -267,6 +238,41 @@ EXTRA_DIST = \ python/stubout.py \ python/README.txt +all_EXTRA_DIST=$(java_EXTRA_DIST) $(python_EXTRA_DIST) + +EXTRA_DIST = $(@DIST_LANG@_EXTRA_DIST) \ + autogen.sh \ + generate_descriptor_proto.sh \ + README.md \ + INSTALL.txt \ + LICENSE \ + CONTRIBUTORS.txt \ + CHANGES.txt \ + editors/README.txt \ + editors/proto.vim \ + editors/protobuf-mode.el \ + vsprojects/config.h \ + vsprojects/extract_includes.bat \ + vsprojects/libprotobuf.vcproj \ + vsprojects/libprotobuf-lite.vcproj \ + vsprojects/libprotoc.vcproj \ + vsprojects/protobuf.sln \ + vsprojects/protoc.vcproj \ + vsprojects/readme.txt \ + vsprojects/test_plugin.vcproj \ + vsprojects/tests.vcproj \ + vsprojects/lite-test.vcproj \ + vsprojects/convert2008to2005.sh \ + examples/README.txt \ + examples/Makefile \ + examples/addressbook.proto \ + examples/add_person.cc \ + examples/list_people.cc \ + examples/AddPerson.java \ + examples/ListPeople.java \ + examples/add_person.py \ + examples/list_people.py + # Deletes all the files generated by autogen.sh. MAINTAINERCLEANFILES = \ aclocal.m4 \ diff --git a/configure.ac b/configure.ac index bd5b1959..034d0cdb 100644 --- a/configure.ac +++ b/configure.ac @@ -20,6 +20,14 @@ AC_CONFIG_SRCDIR(src/google/protobuf/message.cc) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_MACRO_DIR([m4]) +AC_ARG_VAR(DIST_LANG, [language to include in the distribution package (i.e., make dist)]) +case "$DIST_LANG" in + "") DIST_LANG=cpp ;; + all | cpp | java | python | javanano) ;; + *) AC_MSG_FAILURE([unknown language: $DIST_LANG]) ;; +esac +AC_SUBST(DIST_LANG) + # autoconf's default CXXFLAGS are usually "-g -O2". These aren't necessarily # the best choice for libprotobuf. AS_IF([test "x${ac_cv_env_CFLAGS_set}" = "x"], diff --git a/javanano/src/main/java/com/google/protobuf/nano/CodedInputByteBufferNano.java b/javanano/src/main/java/com/google/protobuf/nano/CodedInputByteBufferNano.java index c5fea5ae..b147f69d 100644 --- a/javanano/src/main/java/com/google/protobuf/nano/CodedInputByteBufferNano.java +++ b/javanano/src/main/java/com/google/protobuf/nano/CodedInputByteBufferNano.java @@ -1,6 +1,6 @@ // Protocol Buffers - Google's data interchange format // Copyright 2013 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ +// https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are diff --git a/javanano/src/main/java/com/google/protobuf/nano/CodedOutputByteBufferNano.java b/javanano/src/main/java/com/google/protobuf/nano/CodedOutputByteBufferNano.java index 88df38d7..37982b57 100644 --- a/javanano/src/main/java/com/google/protobuf/nano/CodedOutputByteBufferNano.java +++ b/javanano/src/main/java/com/google/protobuf/nano/CodedOutputByteBufferNano.java @@ -1,6 +1,6 @@ // Protocol Buffers - Google's data interchange format // Copyright 2013 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ +// https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are diff --git a/javanano/src/main/java/com/google/protobuf/nano/ExtendableMessageNano.java b/javanano/src/main/java/com/google/protobuf/nano/ExtendableMessageNano.java index 46cd86f3..b979390d 100644 --- a/javanano/src/main/java/com/google/protobuf/nano/ExtendableMessageNano.java +++ b/javanano/src/main/java/com/google/protobuf/nano/ExtendableMessageNano.java @@ -1,6 +1,6 @@ // Protocol Buffers - Google's data interchange format // Copyright 2013 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ +// https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are diff --git a/javanano/src/main/java/com/google/protobuf/nano/Extension.java b/javanano/src/main/java/com/google/protobuf/nano/Extension.java index a851daf8..5d18ae6e 100644 --- a/javanano/src/main/java/com/google/protobuf/nano/Extension.java +++ b/javanano/src/main/java/com/google/protobuf/nano/Extension.java @@ -1,6 +1,6 @@ // Protocol Buffers - Google's data interchange format // Copyright 2013 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ +// https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are diff --git a/javanano/src/main/java/com/google/protobuf/nano/FieldArray.java b/javanano/src/main/java/com/google/protobuf/nano/FieldArray.java index ab923a4d..cdb66da2 100644 --- a/javanano/src/main/java/com/google/protobuf/nano/FieldArray.java +++ b/javanano/src/main/java/com/google/protobuf/nano/FieldArray.java @@ -1,6 +1,6 @@ // Protocol Buffers - Google's data interchange format // Copyright 2014 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ +// https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are diff --git a/javanano/src/main/java/com/google/protobuf/nano/FieldData.java b/javanano/src/main/java/com/google/protobuf/nano/FieldData.java index e5b69aad..21ead88b 100644 --- a/javanano/src/main/java/com/google/protobuf/nano/FieldData.java +++ b/javanano/src/main/java/com/google/protobuf/nano/FieldData.java @@ -1,6 +1,6 @@ // Protocol Buffers - Google's data interchange format // Copyright 2014 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ +// https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are diff --git a/javanano/src/main/java/com/google/protobuf/nano/InternalNano.java b/javanano/src/main/java/com/google/protobuf/nano/InternalNano.java index 90ca11d5..e08bb4b7 100644 --- a/javanano/src/main/java/com/google/protobuf/nano/InternalNano.java +++ b/javanano/src/main/java/com/google/protobuf/nano/InternalNano.java @@ -1,6 +1,6 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ +// https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are diff --git a/javanano/src/main/java/com/google/protobuf/nano/InvalidProtocolBufferNanoException.java b/javanano/src/main/java/com/google/protobuf/nano/InvalidProtocolBufferNanoException.java index ff0af9df..3864d38a 100644 --- a/javanano/src/main/java/com/google/protobuf/nano/InvalidProtocolBufferNanoException.java +++ b/javanano/src/main/java/com/google/protobuf/nano/InvalidProtocolBufferNanoException.java @@ -1,6 +1,6 @@ // Protocol Buffers - Google's data interchange format // Copyright 2013 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ +// https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are diff --git a/javanano/src/main/java/com/google/protobuf/nano/MessageNano.java b/javanano/src/main/java/com/google/protobuf/nano/MessageNano.java index 164f317f..81e58571 100644 --- a/javanano/src/main/java/com/google/protobuf/nano/MessageNano.java +++ b/javanano/src/main/java/com/google/protobuf/nano/MessageNano.java @@ -1,6 +1,6 @@ // Protocol Buffers - Google's data interchange format // Copyright 2013 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ +// https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are diff --git a/javanano/src/main/java/com/google/protobuf/nano/MessageNanoPrinter.java b/javanano/src/main/java/com/google/protobuf/nano/MessageNanoPrinter.java index 4cca3d5e..dd43cdbb 100644 --- a/javanano/src/main/java/com/google/protobuf/nano/MessageNanoPrinter.java +++ b/javanano/src/main/java/com/google/protobuf/nano/MessageNanoPrinter.java @@ -1,6 +1,6 @@ // Protocol Buffers - Google's data interchange format // Copyright 2013 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ +// https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are diff --git a/javanano/src/main/java/com/google/protobuf/nano/UnknownFieldData.java b/javanano/src/main/java/com/google/protobuf/nano/UnknownFieldData.java index 2032e1a6..a17fccf3 100644 --- a/javanano/src/main/java/com/google/protobuf/nano/UnknownFieldData.java +++ b/javanano/src/main/java/com/google/protobuf/nano/UnknownFieldData.java @@ -1,6 +1,6 @@ // Protocol Buffers - Google's data interchange format // Copyright 2013 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ +// https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are diff --git a/javanano/src/main/java/com/google/protobuf/nano/WireFormatNano.java b/javanano/src/main/java/com/google/protobuf/nano/WireFormatNano.java index a3405e55..bbb6370a 100644 --- a/javanano/src/main/java/com/google/protobuf/nano/WireFormatNano.java +++ b/javanano/src/main/java/com/google/protobuf/nano/WireFormatNano.java @@ -1,6 +1,6 @@ // Protocol Buffers - Google's data interchange format // Copyright 2013 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ +// https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are diff --git a/javanano/src/test/java/com/google/protobuf/nano/NanoTest.java b/javanano/src/test/java/com/google/protobuf/nano/NanoTest.java index 5ac7edb6..442f0b74 100644 --- a/javanano/src/test/java/com/google/protobuf/nano/NanoTest.java +++ b/javanano/src/test/java/com/google/protobuf/nano/NanoTest.java @@ -1,6 +1,6 @@ // Protocol Buffers - Google's data interchange format // Copyright 2013 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ +// https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are diff --git a/javanano/src/test/java/com/google/protobuf/nano/unittest_accessors_nano.proto b/javanano/src/test/java/com/google/protobuf/nano/unittest_accessors_nano.proto index f1d4d343..6e5a40f6 100644 --- a/javanano/src/test/java/com/google/protobuf/nano/unittest_accessors_nano.proto +++ b/javanano/src/test/java/com/google/protobuf/nano/unittest_accessors_nano.proto @@ -1,6 +1,6 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ +// https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are diff --git a/javanano/src/test/java/com/google/protobuf/nano/unittest_enum_class_multiple_nano.proto b/javanano/src/test/java/com/google/protobuf/nano/unittest_enum_class_multiple_nano.proto index 8adb7560..e6246bb1 100644 --- a/javanano/src/test/java/com/google/protobuf/nano/unittest_enum_class_multiple_nano.proto +++ b/javanano/src/test/java/com/google/protobuf/nano/unittest_enum_class_multiple_nano.proto @@ -1,6 +1,6 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ +// https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are diff --git a/javanano/src/test/java/com/google/protobuf/nano/unittest_enum_class_nano.proto b/javanano/src/test/java/com/google/protobuf/nano/unittest_enum_class_nano.proto index 3727d68d..33a86225 100644 --- a/javanano/src/test/java/com/google/protobuf/nano/unittest_enum_class_nano.proto +++ b/javanano/src/test/java/com/google/protobuf/nano/unittest_enum_class_nano.proto @@ -1,6 +1,6 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ +// https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are diff --git a/javanano/src/test/java/com/google/protobuf/nano/unittest_has_nano.proto b/javanano/src/test/java/com/google/protobuf/nano/unittest_has_nano.proto index 289d08ae..bda1a6ef 100644 --- a/javanano/src/test/java/com/google/protobuf/nano/unittest_has_nano.proto +++ b/javanano/src/test/java/com/google/protobuf/nano/unittest_has_nano.proto @@ -1,6 +1,6 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ +// https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are diff --git a/javanano/src/test/java/com/google/protobuf/nano/unittest_import_nano.proto b/javanano/src/test/java/com/google/protobuf/nano/unittest_import_nano.proto index bcd4db7b..1a3ddc57 100644 --- a/javanano/src/test/java/com/google/protobuf/nano/unittest_import_nano.proto +++ b/javanano/src/test/java/com/google/protobuf/nano/unittest_import_nano.proto @@ -1,6 +1,6 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ +// https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are diff --git a/javanano/src/test/java/com/google/protobuf/nano/unittest_multiple_nameclash_nano.proto b/javanano/src/test/java/com/google/protobuf/nano/unittest_multiple_nameclash_nano.proto index f2f62c4e..9db2d3e3 100644 --- a/javanano/src/test/java/com/google/protobuf/nano/unittest_multiple_nameclash_nano.proto +++ b/javanano/src/test/java/com/google/protobuf/nano/unittest_multiple_nameclash_nano.proto @@ -1,6 +1,6 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ +// https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are diff --git a/javanano/src/test/java/com/google/protobuf/nano/unittest_multiple_nano.proto b/javanano/src/test/java/com/google/protobuf/nano/unittest_multiple_nano.proto index be84cad1..9dbf0de4 100644 --- a/javanano/src/test/java/com/google/protobuf/nano/unittest_multiple_nano.proto +++ b/javanano/src/test/java/com/google/protobuf/nano/unittest_multiple_nano.proto @@ -1,6 +1,6 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ +// https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are diff --git a/javanano/src/test/java/com/google/protobuf/nano/unittest_nano.proto b/javanano/src/test/java/com/google/protobuf/nano/unittest_nano.proto index cba52c02..4519533c 100644 --- a/javanano/src/test/java/com/google/protobuf/nano/unittest_nano.proto +++ b/javanano/src/test/java/com/google/protobuf/nano/unittest_nano.proto @@ -1,6 +1,6 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ +// https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are diff --git a/javanano/src/test/java/com/google/protobuf/nano/unittest_recursive_nano.proto b/javanano/src/test/java/com/google/protobuf/nano/unittest_recursive_nano.proto index 3d3a6aa4..69d05834 100644 --- a/javanano/src/test/java/com/google/protobuf/nano/unittest_recursive_nano.proto +++ b/javanano/src/test/java/com/google/protobuf/nano/unittest_recursive_nano.proto @@ -1,6 +1,6 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ +// https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are diff --git a/javanano/src/test/java/com/google/protobuf/nano/unittest_repeated_merge_nano.proto b/javanano/src/test/java/com/google/protobuf/nano/unittest_repeated_merge_nano.proto index aea48ef7..9bfc3ad1 100644 --- a/javanano/src/test/java/com/google/protobuf/nano/unittest_repeated_merge_nano.proto +++ b/javanano/src/test/java/com/google/protobuf/nano/unittest_repeated_merge_nano.proto @@ -1,6 +1,6 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ +// https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are diff --git a/javanano/src/test/java/com/google/protobuf/nano/unittest_repeated_packables_nano.proto b/javanano/src/test/java/com/google/protobuf/nano/unittest_repeated_packables_nano.proto index 1c78918f..a7ca7527 100644 --- a/javanano/src/test/java/com/google/protobuf/nano/unittest_repeated_packables_nano.proto +++ b/javanano/src/test/java/com/google/protobuf/nano/unittest_repeated_packables_nano.proto @@ -1,6 +1,6 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ +// https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are diff --git a/javanano/src/test/java/com/google/protobuf/nano/unittest_simple_nano.proto b/javanano/src/test/java/com/google/protobuf/nano/unittest_simple_nano.proto index 0c780c72..48333aba 100644 --- a/javanano/src/test/java/com/google/protobuf/nano/unittest_simple_nano.proto +++ b/javanano/src/test/java/com/google/protobuf/nano/unittest_simple_nano.proto @@ -1,6 +1,6 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ +// https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are diff --git a/javanano/src/test/java/com/google/protobuf/nano/unittest_single_nano.proto b/javanano/src/test/java/com/google/protobuf/nano/unittest_single_nano.proto index fcb1539d..025428d8 100644 --- a/javanano/src/test/java/com/google/protobuf/nano/unittest_single_nano.proto +++ b/javanano/src/test/java/com/google/protobuf/nano/unittest_single_nano.proto @@ -1,6 +1,6 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ +// https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are diff --git a/javanano/src/test/java/com/google/protobuf/nano/unittest_stringutf8_nano.proto b/javanano/src/test/java/com/google/protobuf/nano/unittest_stringutf8_nano.proto index 2bbf2b7b..21bd8c0c 100644 --- a/javanano/src/test/java/com/google/protobuf/nano/unittest_stringutf8_nano.proto +++ b/javanano/src/test/java/com/google/protobuf/nano/unittest_stringutf8_nano.proto @@ -1,6 +1,6 @@ // Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. -// http://code.google.com/p/protobuf/ +// https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are diff --git a/python/google/protobuf/pyext/descriptor.cc b/python/google/protobuf/pyext/descriptor.cc index 55bb0b72..7343c0b7 100644 --- a/python/google/protobuf/pyext/descriptor.cc +++ b/python/google/protobuf/pyext/descriptor.cc @@ -247,8 +247,10 @@ PyDescriptorPool* NewDescriptorPool() { } static void Dealloc(PyDescriptorPool* self) { - for (auto it : (*self->classes_by_descriptor)) { - Py_DECREF(it.second); + typedef PyDescriptorPool::ClassesByMessageMap::iterator iterator; + for (iterator it = self->classes_by_descriptor->begin(); + it != self->classes_by_descriptor->end(); ++it) { + Py_DECREF(it->second); } delete self->classes_by_descriptor; Py_TYPE(self)->tp_free(reinterpret_cast<PyObject*>(self)); @@ -300,7 +302,8 @@ const google::protobuf::Descriptor* RegisterMessageClass( return NULL; } Py_INCREF(message_class); - auto ret = self->classes_by_descriptor->insert( + typedef PyDescriptorPool::ClassesByMessageMap::iterator iterator; + std::pair<iterator, bool> ret = self->classes_by_descriptor->insert( make_pair(message_descriptor, message_class)); if (!ret.second) { // Update case: DECREF the previous value. @@ -323,7 +326,8 @@ const google::protobuf::Descriptor* RegisterMessageClass( // Retrieve the message class added to our database. PyObject *GetMessageClass(PyDescriptorPool* self, const Descriptor *message_descriptor) { - auto ret = self->classes_by_descriptor->find(message_descriptor); + typedef PyDescriptorPool::ClassesByMessageMap::iterator iterator; + iterator ret = self->classes_by_descriptor->find(message_descriptor); if (ret == self->classes_by_descriptor->end()) { PyErr_Format(PyExc_TypeError, "No message class registered for '%s'", message_descriptor->full_name().c_str()); diff --git a/python/setup.py b/python/setup.py index 7337260a..69ffcd1d 100755 --- a/python/setup.py +++ b/python/setup.py @@ -157,7 +157,7 @@ if __name__ == '__main__': "google/protobuf/pyext/repeated_scalar_container.cc", "google/protobuf/pyext/repeated_composite_container.cc" ], define_macros=[('GOOGLE_PROTOBUF_HAS_ONEOF', '1')], - include_dirs = [ ".", "../src"], + include_dirs = [ ".", "..", "../src"], libraries = [ "protobuf" ], library_dirs = [ '../src/.libs' ], )) diff --git a/src/google/protobuf/compiler/parser.cc b/src/google/protobuf/compiler/parser.cc index 4b3efe48..fe697acf 100644 --- a/src/google/protobuf/compiler/parser.cc +++ b/src/google/protobuf/compiler/parser.cc @@ -468,6 +468,10 @@ bool Parser::Parse(io::Tokenizer* input, FileDescriptorProto* file) { // Store the syntax into the file. if (file != NULL) file->set_syntax(syntax_identifier_); } else if (!stop_after_syntax_identifier_) { + GOOGLE_LOG(WARNING) << "No syntax specified for the proto file. " + << "Please use 'syntax = \"proto2\";' or " + << "'syntax = \"proto3\";' to specify a syntax " + << "version. (Defaulted to proto2 syntax.)"; syntax_identifier_ = "proto2"; } diff --git a/src/google/protobuf/compiler/parser_unittest.cc b/src/google/protobuf/compiler/parser_unittest.cc index 00112999..45f95df1 100644 --- a/src/google/protobuf/compiler/parser_unittest.cc +++ b/src/google/protobuf/compiler/parser_unittest.cc @@ -216,6 +216,15 @@ TEST_F(ParserTest, StopAfterSyntaxIdentifierWithErrors) { EXPECT_EQ("1:9: Expected syntax identifier.\n", error_collector_.text_); } +TEST_F(ParserTest, WarnIfSyntaxIdentifierOmmitted) { + SetupParser("message A {}"); + FileDescriptorProto file; + CaptureTestStderr(); + EXPECT_TRUE(parser_->Parse(input_.get(), &file)); + EXPECT_TRUE( + GetCapturedTestStderr().find("No syntax specified") != string::npos); +} + // =================================================================== typedef ParserTest ParseMessageTest; |