summaryrefslogtreecommitdiffstats
path: root/pb_encode.c
diff options
context:
space:
mode:
Diffstat (limited to 'pb_encode.c')
-rw-r--r--pb_encode.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/pb_encode.c b/pb_encode.c
index cef98861..cc372b8f 100644
--- a/pb_encode.c
+++ b/pb_encode.c
@@ -250,6 +250,17 @@ static bool checkreturn encode_basic_field(pb_ostream_t *stream,
return false;
break;
+ case PB_HTYPE_ONEOF:
+ if (*(const pb_size_t*)pSize == field->tag)
+ {
+ if (!pb_encode_tag_for_field(stream, field))
+ return false;
+
+ if (!func(stream, field, pData))
+ return false;
+ }
+ break;
+
default:
PB_RETURN_ERROR(stream, "invalid field type");
}