aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/google/protobuf/compiler/subprocess.cc1
-rw-r--r--src/google/protobuf/extension_set.cc10
-rw-r--r--src/google/protobuf/extension_set.h6
-rw-r--r--src/google/protobuf/extension_set_heavy.cc4
4 files changed, 12 insertions, 9 deletions
diff --git a/src/google/protobuf/compiler/subprocess.cc b/src/google/protobuf/compiler/subprocess.cc
index b70c600d..de46a3e6 100644
--- a/src/google/protobuf/compiler/subprocess.cc
+++ b/src/google/protobuf/compiler/subprocess.cc
@@ -35,6 +35,7 @@
#ifndef _WIN32
#include <errno.h>
#include <sys/wait.h>
+#include <signal.h>
#endif
#include <algorithm>
diff --git a/src/google/protobuf/extension_set.cc b/src/google/protobuf/extension_set.cc
index dfecf9ea..6084885b 100644
--- a/src/google/protobuf/extension_set.cc
+++ b/src/google/protobuf/extension_set.cc
@@ -138,9 +138,9 @@ void ExtensionSet::RegisterEnumExtension(const MessageLite* containing_type,
EnumValidityFunc* is_valid) {
GOOGLE_CHECK_EQ(type, WireFormatLite::TYPE_ENUM);
ExtensionInfo info(type, is_repeated, is_packed);
- info.enum_is_valid = CallNoArgValidityFunc;
+ info.enum_validity_check.func = CallNoArgValidityFunc;
// See comment in CallNoArgValidityFunc() about why we use a c-style cast.
- info.enum_is_valid_arg = (void*)is_valid;
+ info.enum_validity_check.arg = (void*)is_valid;
Register(containing_type, number, info);
}
@@ -761,7 +761,8 @@ bool ExtensionSet::ParseField(uint32 tag, io::CodedInputStream* input,
int value;
if (!WireFormatLite::ReadPrimitive<int, WireFormatLite::TYPE_ENUM>(
input, &value)) return false;
- if (extension.enum_is_valid(extension.enum_is_valid_arg, value)) {
+ if (extension.enum_validity_check.func(
+ extension.enum_validity_check.arg, value)) {
AddEnum(number, WireFormatLite::TYPE_ENUM, true, value,
extension.descriptor);
}
@@ -814,7 +815,8 @@ bool ExtensionSet::ParseField(uint32 tag, io::CodedInputStream* input,
if (!WireFormatLite::ReadPrimitive<int, WireFormatLite::TYPE_ENUM>(
input, &value)) return false;
- if (!extension.enum_is_valid(extension.enum_is_valid_arg, value)) {
+ if (!extension.enum_validity_check.func(
+ extension.enum_validity_check.arg, value)) {
// Invalid value. Treat as unknown.
field_skipper->SkipUnknownEnum(number, value);
} else if (extension.is_repeated) {
diff --git a/src/google/protobuf/extension_set.h b/src/google/protobuf/extension_set.h
index b1a55338..e05de3fb 100644
--- a/src/google/protobuf/extension_set.h
+++ b/src/google/protobuf/extension_set.h
@@ -99,9 +99,9 @@ struct ExtensionInfo {
union {
struct {
- EnumValidityFuncWithArg* enum_is_valid;
- const void* enum_is_valid_arg;
- };
+ EnumValidityFuncWithArg* func;
+ const void* arg;
+ } enum_validity_check;
const MessageLite* message_prototype;
};
diff --git a/src/google/protobuf/extension_set_heavy.cc b/src/google/protobuf/extension_set_heavy.cc
index 426ec5f4..27f2bc8b 100644
--- a/src/google/protobuf/extension_set_heavy.cc
+++ b/src/google/protobuf/extension_set_heavy.cc
@@ -175,8 +175,8 @@ bool DescriptorPoolExtensionFinder::Find(int number, ExtensionInfo* output) {
<< "Extension factory's GetPrototype() returned NULL for extension: "
<< extension->full_name();
} else if (extension->cpp_type() == FieldDescriptor::CPPTYPE_ENUM) {
- output->enum_is_valid = ValidateEnumUsingDescriptor;
- output->enum_is_valid_arg = extension->enum_type();
+ output->enum_validity_check.func = ValidateEnumUsingDescriptor;
+ output->enum_validity_check.arg = extension->enum_type();
}
return true;