diff --git a/Makefile.am b/Makefile.am index fad35a0960..0e137c0e64 100644 --- a/Makefile.am +++ b/Makefile.am @@ -594,33 +594,38 @@ ruby_EXTRA_DIST= \ all_EXTRA_DIST=$(csharp_EXTRA_DIST) $(java_EXTRA_DIST) $(javanano_EXTRA_DIST) $(objectivec_EXTRA_DIST) $(python_EXTRA_DIST) $(ruby_EXTRA_DIST) -EXTRA_DIST = $(@DIST_LANG@_EXTRA_DIST) \ - autogen.sh \ - generate_descriptor_proto.sh \ - README.md \ - INSTALL.txt \ - LICENSE \ - CONTRIBUTORS.txt \ - CHANGES.txt \ - update_file_lists.sh \ - cmake/CMakeLists.txt \ - cmake/libprotobuf.cmake \ - cmake/libprotobuf-lite.cmake \ - cmake/libprotoc.cmake \ - cmake/protoc.cmake \ - cmake/README.md \ - cmake/tests.cmake \ - editors/README.txt \ - editors/proto.vim \ - editors/protobuf-mode.el \ - 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 \ +EXTRA_DIST = $(@DIST_LANG@_EXTRA_DIST) \ + autogen.sh \ + generate_descriptor_proto.sh \ + README.md \ + INSTALL.txt \ + LICENSE \ + CONTRIBUTORS.txt \ + CHANGES.txt \ + update_file_lists.sh \ + cmake/CMakeLists.txt \ + cmake/README.md \ + cmake/extract_includes.bat.in \ + cmake/install.cmake \ + cmake/libprotobuf.cmake \ + cmake/libprotobuf-lite.cmake \ + cmake/libprotoc.cmake \ + cmake/protobuf-config-version.cmake.in \ + cmake/protobuf-config.cmake.in \ + cmake/protobuf-module.cmake.in \ + cmake/protoc.cmake \ + cmake/tests.cmake \ + editors/README.txt \ + editors/proto.vim \ + editors/protobuf-mode.el \ + 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. diff --git a/cmake/tests.cmake b/cmake/tests.cmake index ef4dfe0221..65feca21cb 100644 --- a/cmake/tests.cmake +++ b/cmake/tests.cmake @@ -36,7 +36,6 @@ set(tests_protos google/protobuf/unittest_drop_unknown_fields.proto google/protobuf/unittest_embed_optimize_for.proto google/protobuf/unittest_empty.proto - google/protobuf/unittest_enormous_descriptor.proto google/protobuf/unittest_import.proto google/protobuf/unittest_import_public.proto google/protobuf/unittest_lite_imports_nonlite.proto diff --git a/src/google/protobuf/arena.h b/src/google/protobuf/arena.h index f06be4a3d7..074a9e5411 100644 --- a/src/google/protobuf/arena.h +++ b/src/google/protobuf/arena.h @@ -32,6 +32,9 @@ #define GOOGLE_PROTOBUF_ARENA_H__ #include +#ifdef max +#undef max // Visual Studio defines this macro +#endif #if __cplusplus >= 201103L #include #endif diff --git a/src/google/protobuf/compiler/cpp/cpp_unittest.cc b/src/google/protobuf/compiler/cpp/cpp_unittest.cc index e5ef6ecd48..7840cfaff6 100644 --- a/src/google/protobuf/compiler/cpp/cpp_unittest.cc +++ b/src/google/protobuf/compiler/cpp/cpp_unittest.cc @@ -55,7 +55,9 @@ #include #include #include +#if !defined(_MSC_VER) // Too large for visual studio to compile #include +#endif #include #include #include @@ -133,6 +135,7 @@ TEST(GeneratedDescriptorTest, IdenticalDescriptors) { generated_decsriptor_proto.DebugString()); } +#if !defined(_MSC_VER) // Test that generated code has proper descriptors: // Touch a descriptor generated from an enormous message to validate special // handling for descriptors exceeding the C++ standard's recommended minimum @@ -143,6 +146,7 @@ TEST(GeneratedDescriptorTest, EnormousDescriptor) { EXPECT_TRUE(generated_descriptor != NULL); } +#endif #endif // !PROTOBUF_TEST_NO_DESCRIPTORS diff --git a/src/google/protobuf/generated_message_reflection.h b/src/google/protobuf/generated_message_reflection.h index 85ce6e2eec..9ef7871075 100644 --- a/src/google/protobuf/generated_message_reflection.h +++ b/src/google/protobuf/generated_message_reflection.h @@ -417,12 +417,12 @@ class LIBPROTOBUF_EXPORT GeneratedMessageReflection : public Reflection { protected: void* MutableRawRepeatedField( Message* message, const FieldDescriptor* field, FieldDescriptor::CppType, - int ctype, const Descriptor* desc) const override; + int ctype, const Descriptor* desc) const; const void* GetRawRepeatedField( const Message& message, const FieldDescriptor* field, FieldDescriptor::CppType, int ctype, - const Descriptor* desc) const override; + const Descriptor* desc) const; virtual MessageFactory* GetMessageFactory() const; diff --git a/src/google/protobuf/map.h b/src/google/protobuf/map.h index c43df13ed7..8b61573dfa 100644 --- a/src/google/protobuf/map.h +++ b/src/google/protobuf/map.h @@ -592,7 +592,7 @@ class Map { typedef MapAllocator*> > Allocator; // Iterators - class LIBPROTOBUF_EXPORT const_iterator + class const_iterator : public std::iterator { typedef typename hash_map, equal_to, @@ -853,6 +853,29 @@ struct hash { return 0; } } + bool + operator()(const google::protobuf::MapKey& map_key1, + const google::protobuf::MapKey& map_key2) const { + switch (map_key1.type()) { +#define COMPARE_CPPTYPE(CPPTYPE, CPPTYPE_METHOD) \ + case google::protobuf::FieldDescriptor::CPPTYPE_##CPPTYPE: \ + return map_key1.Get##CPPTYPE_METHOD##Value() < \ + map_key2.Get##CPPTYPE_METHOD##Value(); + COMPARE_CPPTYPE(STRING, String) + COMPARE_CPPTYPE(INT64, Int64) + COMPARE_CPPTYPE(INT32, Int32) + COMPARE_CPPTYPE(UINT64, UInt64) + COMPARE_CPPTYPE(UINT32, UInt32) + COMPARE_CPPTYPE(BOOL, Bool) +#undef COMPARE_CPPTYPE + case google::protobuf::FieldDescriptor::CPPTYPE_DOUBLE: + case google::protobuf::FieldDescriptor::CPPTYPE_FLOAT: + case google::protobuf::FieldDescriptor::CPPTYPE_ENUM: + case google::protobuf::FieldDescriptor::CPPTYPE_MESSAGE: + GOOGLE_LOG(FATAL) << "Can't get here."; + return true; + } + } }; GOOGLE_PROTOBUF_HASH_NAMESPACE_DECLARATION_END diff --git a/src/google/protobuf/map_entry_lite.h b/src/google/protobuf/map_entry_lite.h index 0e6ee013e3..7cdf1b9379 100644 --- a/src/google/protobuf/map_entry_lite.h +++ b/src/google/protobuf/map_entry_lite.h @@ -292,7 +292,7 @@ class MapEntryLite : public MessageLite { // only takes references of given key and value. template - class LIBPROTOBUF_EXPORT MapEntryWrapper + class MapEntryWrapper : public MapEntryLite { typedef MapEntryLite Base; typedef typename Base::KeyMapEntryAccessorType KeyMapEntryAccessorType; @@ -326,7 +326,7 @@ class MapEntryLite : public MessageLite { // the temporary. template - class LIBPROTOBUF_EXPORT MapEnumEntryWrapper + class MapEnumEntryWrapper : public MapEntryLite { typedef MapEntryLite Base; typedef typename Base::KeyMapEntryAccessorType KeyMapEntryAccessorType; diff --git a/src/google/protobuf/map_field.cc b/src/google/protobuf/map_field.cc index d8879f24e9..eddc95c4ca 100644 --- a/src/google/protobuf/map_field.cc +++ b/src/google/protobuf/map_field.cc @@ -160,7 +160,7 @@ DynamicMapField::DynamicMapField(const Message* default_entry, DynamicMapField::~DynamicMapField() { // DynamicMapField owns map values. Need to delete them before clearing // the map. - for (typename Map::iterator iter = map_.begin(); + for (Map::iterator iter = map_.begin(); iter != map_.end(); ++iter) { iter->second.DeleteData(); } @@ -174,7 +174,7 @@ int DynamicMapField::size() const { bool DynamicMapField::ContainsMapKey( const MapKey& map_key) const { const Map& map = GetMap(); - typename Map::const_iterator iter = map.find(map_key); + Map::const_iterator iter = map.find(map_key); return iter != map.end(); } @@ -246,7 +246,7 @@ Map* DynamicMapField::MutableMap() { } void DynamicMapField::SetMapIteratorValue(MapIterator* map_iter) const { - typename Map::const_iterator iter = + Map::const_iterator iter = TypeDefinedMapFieldBase::InternalGetIterator( map_iter); if (iter == map_.end()) return; @@ -272,7 +272,7 @@ void DynamicMapField::SyncRepeatedFieldWithMapNoLock() const { MapFieldBase::repeated_field_->Clear(); - for (typename Map::const_iterator it = map_.begin(); + for (Map::const_iterator it = map_.begin(); it != map_.end(); ++it) { Message* new_entry = default_entry_->New(); MapFieldBase::repeated_field_->AddAllocated(new_entry); @@ -350,12 +350,12 @@ void DynamicMapField::SyncMapWithRepeatedFieldNoLock() const { default_entry_->GetDescriptor()->FindFieldByName("value"); // DynamicMapField owns map values. Need to delete them before clearing // the map. - for (typename Map::iterator iter = map->begin(); + for (Map::iterator iter = map->begin(); iter != map->end(); ++iter) { iter->second.DeleteData(); } map->clear(); - for (typename RepeatedPtrField::iterator it = + for (RepeatedPtrField::iterator it = MapFieldBase::repeated_field_->begin(); it != MapFieldBase::repeated_field_->end(); ++it) { MapKey map_key; @@ -424,7 +424,7 @@ int DynamicMapField::SpaceUsedExcludingSelfNoLock() const { size += sizeof(map_); int map_size = map_.size(); if (map_size) { - typename Map::const_iterator it = map_.begin(); + Map::const_iterator it = map_.begin(); size += sizeof(it->first) * map_size; size += sizeof(it->second) * map_size; // If key is string, add the allocated space. diff --git a/src/google/protobuf/map_field_inl.h b/src/google/protobuf/map_field_inl.h index 1a4ce93768..16c4a08ffc 100644 --- a/src/google/protobuf/map_field_inl.h +++ b/src/google/protobuf/map_field_inl.h @@ -153,7 +153,9 @@ void TypeDefinedMapFieldBase::CopyIterator( const MapIterator& that_iter) const { InternalGetIterator(this_iter) = InternalGetIterator(&that_iter); this_iter->key_.SetType(that_iter.key_.type()); - this_iter->value_.SetType(that_iter.value_.type()); + // MapValueRef::type() fails when containing data is null. However, if + // this_iter points to MapEnd, data can be null. + this_iter->value_.SetType((FieldDescriptor::CppType)that_iter.value_.type_); SetMapIteratorValue(this_iter); } diff --git a/src/google/protobuf/stubs/hash.h b/src/google/protobuf/stubs/hash.h index 0d94ad80d2..c6f210f0f7 100755 --- a/src/google/protobuf/stubs/hash.h +++ b/src/google/protobuf/stubs/hash.h @@ -103,8 +103,8 @@ # define GOOGLE_PROTOBUF_HAS_CXX11_HASH # define GOOGLE_PROTOBUF_HASH_COMPARE std::hash_compare # elif _MSC_VER >= 1500 // Since Visual Studio 2008 -# define GOOGLE_PROTOBUF_HAS_TR1 -# define GOOGLE_PROTOBUF_HASH_COMPARE stdext::hash_compare +# undef GOOGLE_PROTOBUF_HAVE_HASH_MAP +# undef GOOGLE_PROTOBUF_HAVE_HASH_SET # elif _MSC_VER >= 1310 # define GOOGLE_PROTOBUF_HASH_NAMESPACE stdext # include @@ -143,20 +143,10 @@ # define GOOGLE_PROTOBUF_HASH_SET_CLASS unordered_set #endif -#ifndef GOOGLE_PROTOBUF_HASH_NAMESPACE -# define GOOGLE_PROTOBUF_HASH_NAMESPACE_DECLARATION_START -# define GOOGLE_PROTOBUF_HASH_NAMESPACE_DECLARATION_END -#elif !defined(GOOGLE_PROTOBUF_HAS_CXX11_HASH) && \ - defined(GOOGLE_PROTOBUF_HAS_TR1) -# define GOOGLE_PROTOBUF_HASH_NAMESPACE_DECLARATION_START \ - namespace std { \ - namespace tr1 { +# define GOOGLE_PROTOBUF_HASH_NAMESPACE_DECLARATION_START \ + namespace google { \ + namespace protobuf { # define GOOGLE_PROTOBUF_HASH_NAMESPACE_DECLARATION_END }} -#else -# define GOOGLE_PROTOBUF_HASH_NAMESPACE_DECLARATION_START \ - namespace GOOGLE_PROTOBUF_HASH_NAMESPACE { -# define GOOGLE_PROTOBUF_HASH_NAMESPACE_DECLARATION_END } -#endif #undef GOOGLE_PROTOBUF_HAS_CXX11_HASH #undef GOOGLE_PROTOBUF_HAS_TR1 diff --git a/src/google/protobuf/stubs/int128.h b/src/google/protobuf/stubs/int128.h index 1e63037f0a..1499bb76d5 100644 --- a/src/google/protobuf/stubs/int128.h +++ b/src/google/protobuf/stubs/int128.h @@ -48,7 +48,7 @@ struct uint128_pod; #endif // An unsigned 128-bit integer type. Thread-compatible. -class uint128 { +class LIBPROTOBUF_EXPORT uint128 { public: UINT128_CONSTEXPR uint128(); // Sets to 0, but don't trust on this behavior. UINT128_CONSTEXPR uint128(uint64 top, uint64 bottom); @@ -84,7 +84,8 @@ class uint128 { friend uint64 Uint128High64(const uint128& v); // We add "std::" to avoid including all of port.h. - friend std::ostream& operator<<(std::ostream& o, const uint128& b); + LIBPROTOBUF_EXPORT friend std::ostream& operator<<(std::ostream& o, + const uint128& b); private: static void DivModImpl(uint128 dividend, uint128 divisor, @@ -115,10 +116,11 @@ struct uint128_pod { uint64 lo; }; -extern const uint128_pod kuint128max; +LIBPROTOBUF_EXPORT extern const uint128_pod kuint128max; // allow uint128 to be logged -extern std::ostream& operator<<(std::ostream& o, const uint128& b); +LIBPROTOBUF_EXPORT extern std::ostream& operator<<(std::ostream& o, + const uint128& b); // Methods to access low and high pieces of 128-bit value. // Defined externally from uint128 to facilitate conversion diff --git a/src/google/protobuf/stubs/mathutil.h b/src/google/protobuf/stubs/mathutil.h index 99c4d452f7..3a1ef8a8cb 100644 --- a/src/google/protobuf/stubs/mathutil.h +++ b/src/google/protobuf/stubs/mathutil.h @@ -45,9 +45,21 @@ bool IsNan(T value) { return false; } template<> -inline bool IsNan(float value) { return isnan(value); } +inline bool IsNan(float value) { +#ifdef _MSC_VER + return _isnan(value); +#else + return isnan(value); +#endif +} template<> -inline bool IsNan(double value) { return isnan(value); } +inline bool IsNan(double value) { +#ifdef _MSC_VER + return _isnan(value); +#else + return isnan(value); +#endif +} template bool AlmostEquals(T a, T b) { diff --git a/src/google/protobuf/stubs/status.cc b/src/google/protobuf/stubs/status.cc index 7314c563c9..dd1bd6141a 100644 --- a/src/google/protobuf/stubs/status.cc +++ b/src/google/protobuf/stubs/status.cc @@ -30,7 +30,6 @@ #include #include -#include #include #include #include diff --git a/src/google/protobuf/util/internal/datapiece.h b/src/google/protobuf/util/internal/datapiece.h index 30947252ce..2ab3fa8864 100644 --- a/src/google/protobuf/util/internal/datapiece.h +++ b/src/google/protobuf/util/internal/datapiece.h @@ -193,13 +193,13 @@ class LIBPROTOBUF_EXPORT DataPiece { // Stored piece of data. union { - const int32 i32_; - const int64 i64_; - const uint32 u32_; - const uint64 u64_; - const double double_; - const float float_; - const bool bool_; + int32 i32_; + int64 i64_; + uint32 u32_; + uint64 u64_; + double double_; + float float_; + bool bool_; StringPiecePod str_; }; }; diff --git a/src/google/protobuf/util/internal/default_value_objectwriter.h b/src/google/protobuf/util/internal/default_value_objectwriter.h index 2468c8d913..d454760170 100644 --- a/src/google/protobuf/util/internal/default_value_objectwriter.h +++ b/src/google/protobuf/util/internal/default_value_objectwriter.h @@ -57,7 +57,7 @@ namespace converter { // ObjectWriter when EndObject() is called on the root object. It also writes // out all non-repeated primitive fields that haven't been explicitly rendered // with their default values (0 for numbers, "" for strings, etc). -class DefaultValueObjectWriter : public ObjectWriter { +class LIBPROTOBUF_EXPORT DefaultValueObjectWriter : public ObjectWriter { public: DefaultValueObjectWriter(TypeResolver* type_resolver, const google::protobuf::Type& type, diff --git a/src/google/protobuf/util/internal/json_objectwriter.cc b/src/google/protobuf/util/internal/json_objectwriter.cc index d88a81f9d3..f81e3306ac 100644 --- a/src/google/protobuf/util/internal/json_objectwriter.cc +++ b/src/google/protobuf/util/internal/json_objectwriter.cc @@ -37,6 +37,7 @@ #include #include #include +#include #include namespace google { @@ -115,7 +116,9 @@ JsonObjectWriter* JsonObjectWriter::RenderUint64(StringPiece name, JsonObjectWriter* JsonObjectWriter::RenderDouble(StringPiece name, double value) { - if (isfinite(value)) return RenderSimple(name, SimpleDtoa(value)); + if (google::protobuf::MathLimits::IsFinite(value)) { + return RenderSimple(name, SimpleDtoa(value)); + } // Render quoted with NaN/Infinity-aware DoubleAsString. return RenderString(name, DoubleAsString(value)); @@ -123,7 +126,9 @@ JsonObjectWriter* JsonObjectWriter::RenderDouble(StringPiece name, JsonObjectWriter* JsonObjectWriter::RenderFloat(StringPiece name, float value) { - if (isfinite(value)) return RenderSimple(name, SimpleFtoa(value)); + if (google::protobuf::MathLimits::IsFinite(value)) { + return RenderSimple(name, SimpleFtoa(value)); + } // Render quoted with NaN/Infinity-aware FloatAsString. return RenderString(name, FloatAsString(value)); diff --git a/src/google/protobuf/util/internal/type_info.h b/src/google/protobuf/util/internal/type_info.h index e394e8cfde..d81331763a 100644 --- a/src/google/protobuf/util/internal/type_info.h +++ b/src/google/protobuf/util/internal/type_info.h @@ -44,7 +44,7 @@ namespace util { namespace converter { // Internal helper class for type resolving. Note that this class is not // thread-safe and should only be accessed in one thread. -class TypeInfo { +class LIBPROTOBUF_EXPORT TypeInfo { public: TypeInfo() {} virtual ~TypeInfo() {} diff --git a/src/google/protobuf/util/internal/utility.cc b/src/google/protobuf/util/internal/utility.cc index 9d80fa08af..5d7dcc8756 100644 --- a/src/google/protobuf/util/internal/utility.cc +++ b/src/google/protobuf/util/internal/utility.cc @@ -307,7 +307,7 @@ string DoubleAsString(double value) { } string FloatAsString(float value) { - if (isfinite(value)) return SimpleFtoa(value); + if (google::protobuf::MathLimits::IsFinite(value)) return SimpleFtoa(value); return DoubleAsString(value); } diff --git a/src/google/protobuf/util/json_util.h b/src/google/protobuf/util/json_util.h index 614564cc1a..1718bfb528 100644 --- a/src/google/protobuf/util/json_util.h +++ b/src/google/protobuf/util/json_util.h @@ -80,7 +80,7 @@ inline util::Status BinaryToJsonStream( JsonOptions()); } -util::Status BinaryToJsonString( +LIBPROTOBUF_EXPORT util::Status BinaryToJsonString( TypeResolver* resolver, const string& type_url, const string& binary_input, @@ -107,7 +107,7 @@ util::Status JsonToBinaryStream( io::ZeroCopyInputStream* json_input, io::ZeroCopyOutputStream* binary_output); -util::Status JsonToBinaryString( +LIBPROTOBUF_EXPORT util::Status JsonToBinaryString( TypeResolver* resolver, const string& type_url, const string& json_input, diff --git a/src/google/protobuf/util/time_util.h b/src/google/protobuf/util/time_util.h index 1126815728..58dbf8e6e4 100644 --- a/src/google/protobuf/util/time_util.h +++ b/src/google/protobuf/util/time_util.h @@ -31,13 +31,17 @@ #ifndef GOOGLE_PROTOBUF_UTIL_TIME_UTIL_H__ #define GOOGLE_PROTOBUF_UTIL_TIME_UTIL_H__ -#include - #include #include #include +#ifdef _MSC_VER +#include +#else +#include +#endif #include +#include #include namespace google { @@ -85,6 +89,9 @@ class LIBPROTOBUF_EXPORT TimeUtil { static string ToString(const Duration& duration); static bool FromString(const string& value, Duration* timestamp); +#ifdef GetCurrentTime +#undef GetCurrentTime // Visual Studio has macro GetCurrentTime +#endif // Gets the current UTC time. static Timestamp GetCurrentTime(); // Returns the Time representing "1970-01-01 00:00:00". @@ -153,12 +160,12 @@ namespace protobuf { // Overloaded operators for Duration. // // Assignment operators. -Duration& operator+=(Duration& d1, const Duration& d2); // NOLINT -Duration& operator-=(Duration& d1, const Duration& d2); // NOLINT -Duration& operator*=(Duration& d, int64 r); // NOLINT -Duration& operator*=(Duration& d, double r); // NOLINT -Duration& operator/=(Duration& d, int64 r); // NOLINT -Duration& operator/=(Duration& d, double r); // NOLINT +LIBPROTOBUF_EXPORT Duration& operator+=(Duration& d1, const Duration& d2); // NOLINT +LIBPROTOBUF_EXPORT Duration& operator-=(Duration& d1, const Duration& d2); // NOLINT +LIBPROTOBUF_EXPORT Duration& operator*=(Duration& d, int64 r); // NOLINT +LIBPROTOBUF_EXPORT Duration& operator*=(Duration& d, double r); // NOLINT +LIBPROTOBUF_EXPORT Duration& operator/=(Duration& d, int64 r); // NOLINT +LIBPROTOBUF_EXPORT Duration& operator/=(Duration& d, double r); // NOLINT // Overload for other integer types. template Duration& operator*=(Duration& d, T r) { // NOLINT @@ -170,7 +177,7 @@ Duration& operator/=(Duration& d, T r) { // NOLINT int64 x = r; return d /= x; } -Duration& operator%=(Duration& d1, const Duration& d2); // NOLINT +LIBPROTOBUF_EXPORT Duration& operator%=(Duration& d1, const Duration& d2); // NOLINT // Relational operators. inline bool operator<(const Duration& d1, const Duration& d2) { if (d1.seconds() == d2.seconds()) { @@ -221,7 +228,7 @@ template inline Duration operator/(Duration d, T r) { return d /= r; } -int64 operator/(const Duration& d1, const Duration& d2); +LIBPROTOBUF_EXPORT int64 operator/(const Duration& d1, const Duration& d2); inline Duration operator%(const Duration& d1, const Duration& d2) { Duration result = d1; @@ -236,7 +243,9 @@ inline ostream& operator<<(ostream& out, const Duration& d) { // Overloaded operators for Timestamp // // Assignement operators. +LIBPROTOBUF_EXPORT Timestamp& operator+=(Timestamp& t, const Duration& d); // NOLINT +LIBPROTOBUF_EXPORT Timestamp& operator-=(Timestamp& t, const Duration& d); // NOLINT // Relational operators. inline bool operator<(const Timestamp& t1, const Timestamp& t2) { @@ -273,7 +282,7 @@ inline Timestamp operator-(const Timestamp& t, const Duration& d) { Timestamp result = t; return result -= d; } -Duration operator-(const Timestamp& t1, const Timestamp& t2); +LIBPROTOBUF_EXPORT Duration operator-(const Timestamp& t1, const Timestamp& t2); inline ostream& operator<<(ostream& out, const Timestamp& t) { out << google::protobuf::util::TimeUtil::ToString(t); diff --git a/src/google/protobuf/util/type_resolver_util.h b/src/google/protobuf/util/type_resolver_util.h index 00cf9c1348..c0ef3c1af9 100644 --- a/src/google/protobuf/util/type_resolver_util.h +++ b/src/google/protobuf/util/type_resolver_util.h @@ -42,7 +42,7 @@ class TypeResolver; // Creates a TypeResolver that serves type information in the given descriptor // pool. Caller takes ownership of the returned TypeResolver. -TypeResolver* NewTypeResolverForDescriptorPool( +LIBPROTOBUF_EXPORT TypeResolver* NewTypeResolverForDescriptorPool( const string& url_prefix, const DescriptorPool* pool); } // namespace util diff --git a/update_file_lists.sh b/update_file_lists.sh index bc2911d2ae..d76a1610a3 100755 --- a/update_file_lists.sh +++ b/update_file_lists.sh @@ -27,6 +27,10 @@ get_source_files() { get_variable_value $@ | grep "cc$" } +get_proto_files_blacklisted() { + get_proto_files $@ | sed '/^google\/protobuf\/unittest_enormous_descriptor.proto$/d' +} + get_proto_files() { get_variable_value $@ | grep "pb.cc$" | sed "s/pb.cc/proto/" } @@ -53,6 +57,7 @@ LIBPROTOBUF_SOURCES=$(get_source_files $MAKEFILE libprotobuf_la_SOURCES) LIBPROTOC_SOURCES=$(get_source_files $MAKEFILE libprotoc_la_SOURCES) LITE_PROTOS=$(get_proto_files $MAKEFILE protoc_lite_outputs) PROTOS=$(get_proto_files $MAKEFILE protoc_outputs) +PROTOS_BLACKLISTED=$(get_proto_files_blacklisted $MAKEFILE protoc_outputs) WKT_PROTOS=$(get_variable_value $MAKEFILE nobase_dist_proto_DATA) COMMON_TEST_SOURCES=$(get_source_files $MAKEFILE COMMON_TEST_SOURCES) COMMON_LITE_TEST_SOURCES=$(get_source_files $MAKEFILE COMMON_LITE_TEST_SOURCES) @@ -112,7 +117,7 @@ set_cmake_value $CMAKE_DIR/libprotobuf-lite.cmake libprotobuf_lite_files $CMAKE_ set_cmake_value $CMAKE_DIR/libprotobuf.cmake libprotobuf_files $CMAKE_PREFIX $LIBPROTOBUF_SOURCES set_cmake_value $CMAKE_DIR/libprotoc.cmake libprotoc_files $CMAKE_PREFIX $LIBPROTOC_SOURCES set_cmake_value $CMAKE_DIR/tests.cmake lite_test_protos "" $LITE_PROTOS -set_cmake_value $CMAKE_DIR/tests.cmake tests_protos "" $PROTOS +set_cmake_value $CMAKE_DIR/tests.cmake tests_protos "" $PROTOS_BLACKLISTED set_cmake_value $CMAKE_DIR/tests.cmake common_test_files $CMAKE_PREFIX $COMMON_TEST_SOURCES set_cmake_value $CMAKE_DIR/tests.cmake common_lite_test_files $CMAKE_PREFIX $COMMON_LITE_TEST_SOURCES set_cmake_value $CMAKE_DIR/tests.cmake tests_files $CMAKE_PREFIX $TEST_SOURCES