mirror of
https://github.com/protobuf-c/protobuf-c.git
synced 2024-12-27 13:31:02 +08:00
Merge pull request #427 from protobuf-c/ilya-oneof
c_message.cc: Resolve name conflict (Fixes #389)
This commit is contained in:
commit
cc79026e82
@ -265,6 +265,15 @@ t/issue330/issue330.pb-c.c t/issue330/issue330.pb-c.h: $(top_builddir)/protoc-c/
|
||||
$(AM_V_GEN)@PROTOC@ --plugin=protoc-gen-c=$(top_builddir)/protoc-c/protoc-gen-c$(EXEEXT) -I$(top_srcdir) --c_out=$(top_builddir) $(top_srcdir)/t/issue330/issue330.proto
|
||||
BUILT_SOURCES += \
|
||||
t/issue330/issue330.pb-c.c t/issue330/issue330.pb-c.h
|
||||
|
||||
t_issue330_issue330_SOURCES += \
|
||||
t/issue389/issue389.pb-c.c # Tack onto issue330 since there is no need for a separate binary here
|
||||
t/issue389/issue389.pb-c.c t/issue389/issue389.pb-c.h: $(top_builddir)/protoc-c/protoc-gen-c$(EXEEXT) $(top_srcdir)/t/issue389/issue389.proto
|
||||
$(AM_V_GEN)@PROTOC@ --plugin=protoc-gen-c=$(top_builddir)/protoc-c/protoc-gen-c$(EXEEXT) -I$(top_srcdir) --c_out=$(top_builddir) $(top_srcdir)/t/issue389/issue389.proto
|
||||
BUILT_SOURCES += \
|
||||
t/issue389/issue389.pb-c.c t/issue389/issue389.pb-c.h
|
||||
EXTRA_DIST += \
|
||||
t/issue389/issue389.proto
|
||||
endif # BUILD_PROTO3
|
||||
EXTRA_DIST += \
|
||||
t/issue330/issue330.proto
|
||||
|
@ -169,7 +169,7 @@ GenerateStructDefinition(io::Printer* printer) {
|
||||
}
|
||||
printer->Print(vars, "$ucclassname$__$oneofname$_$fieldname$ = $fieldnum$$opt_comma$\n");
|
||||
}
|
||||
printer->Print(vars, " PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE($ucclassname$__$oneofname$)\n");
|
||||
printer->Print(vars, " PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE($ucclassname$__$oneofname$__CASE)\n");
|
||||
printer->Outdent();
|
||||
printer->Print(vars, "} $foneofname$Case;\n\n");
|
||||
}
|
||||
|
@ -8,6 +8,6 @@ int main(void)
|
||||
{
|
||||
assert(_MESSAGE_TYPE1__FLAG_IS_INT_SIZE == INT_MAX);
|
||||
assert(_MESSAGE_TYPE2__ANOTHER_FLAG_IS_INT_SIZE == INT_MAX);
|
||||
assert(_TOP_LEVEL__SUBMESSAGES_IS_INT_SIZE == INT_MAX);
|
||||
assert(_TOP_LEVEL__SUBMESSAGES__CASE_IS_INT_SIZE == INT_MAX);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
12
t/issue389/issue389.proto
Normal file
12
t/issue389/issue389.proto
Normal file
@ -0,0 +1,12 @@
|
||||
syntax = "proto3";
|
||||
|
||||
message EnumIntTest {
|
||||
enum Label {
|
||||
LABEL_1 = 0;
|
||||
LABEL_2 = 1;
|
||||
}
|
||||
oneof label {
|
||||
Label label_label = 123;
|
||||
uint64 label_uint64 = 124;
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user