mirror of
https://github.com/protobuf-c/protobuf-c.git
synced 2024-12-27 22:01:02 +08:00
f486c8ed66
Allows for generic oneof offset lookups based on the name of the oneof, instead of having to know the field name. All oneof fields should have the same offset, since they are members of a union. Fixes #204
16 lines
257 B
Protocol Buffer
16 lines
257 B
Protocol Buffer
import "protobuf-c/protobuf-c.proto";
|
|
|
|
option (pb_c_file).use_oneof_field_name = true;
|
|
|
|
message two_oneofs {
|
|
oneof first_oneof {
|
|
bool a = 10;
|
|
bool b = 11;
|
|
}
|
|
|
|
oneof second_oneof {
|
|
bool c = 20;
|
|
bool d = 21;
|
|
}
|
|
}
|