diff options
-rw-r--r-- | ruby/lib/google/protobuf/repeated_field.rb | 2 | ||||
-rw-r--r-- | src/google/protobuf/generated_message_util.h | 2 | ||||
-rw-r--r-- | src/google/protobuf/stubs/common.cc | 13 |
3 files changed, 13 insertions, 4 deletions
diff --git a/ruby/lib/google/protobuf/repeated_field.rb b/ruby/lib/google/protobuf/repeated_field.rb index 831e0320..11d6c2eb 100644 --- a/ruby/lib/google/protobuf/repeated_field.rb +++ b/ruby/lib/google/protobuf/repeated_field.rb @@ -74,7 +74,7 @@ module Google :include?, :index, :inspect, :join, :pack, :permutation, :product, :pretty_print, :pretty_print_cycle, :rassoc, :repeated_combination, :repeated_permutation, :reverse, - :rindex, :rotate, :sample, :shuffle, :shelljoin, :slice, + :rindex, :rotate, :sample, :shuffle, :shelljoin, :to_s, :transpose, :uniq, :| diff --git a/src/google/protobuf/generated_message_util.h b/src/google/protobuf/generated_message_util.h index b1c49e37..19bac7dc 100644 --- a/src/google/protobuf/generated_message_util.h +++ b/src/google/protobuf/generated_message_util.h @@ -125,7 +125,7 @@ class ExplicitlyConstructed { // Default empty string object. Don't use this directly. Instead, call // GetEmptyString() to get the reference. -extern ExplicitlyConstructed< ::std::string> fixed_address_empty_string; +LIBPROTOBUF_EXPORT extern ExplicitlyConstructed< ::std::string> fixed_address_empty_string; LIBPROTOBUF_EXPORT extern ProtobufOnceType empty_string_once_init_; LIBPROTOBUF_EXPORT void InitEmptyString(); diff --git a/src/google/protobuf/stubs/common.cc b/src/google/protobuf/stubs/common.cc index 54dbafab..14655916 100644 --- a/src/google/protobuf/stubs/common.cc +++ b/src/google/protobuf/stubs/common.cc @@ -108,11 +108,17 @@ string VersionString(int version) { // =================================================================== // emulates google3/base/logging.cc +// If the minimum logging level is not set, we default to logging messages for +// all levels. +#ifndef GOOGLE_PROTOBUF_MIN_LOG_LEVEL +#define GOOGLE_PROTOBUF_MIN_LOG_LEVEL LOGLEVEL_INFO +#endif + namespace internal { + #if defined(__ANDROID__) inline void DefaultLogHandler(LogLevel level, const char* filename, int line, const string& message) { -#ifdef GOOGLE_PROTOBUF_MIN_LOG_LEVEL if (level < GOOGLE_PROTOBUF_MIN_LOG_LEVEL) { return; } @@ -143,11 +149,14 @@ inline void DefaultLogHandler(LogLevel level, const char* filename, int line, __android_log_write(ANDROID_LOG_FATAL, "libprotobuf-native", "terminating.\n"); } -#endif } + #else void DefaultLogHandler(LogLevel level, const char* filename, int line, const string& message) { + if (level < GOOGLE_PROTOBUF_MIN_LOG_LEVEL) { + return; + } static const char* level_names[] = { "INFO", "WARNING", "ERROR", "FATAL" }; // We use fprintf() instead of cerr because we want this to work at static |