protobuf: Support encoding Enums

Encode enum values using their ordinal as a varint, similar to
what the proto compiler from Google would do.  This requires that
application developers carefully assign their enum orders in order
to maintain values already encoded in protobufs.

Change-Id: I1f40170c583125f425f4ff4a3aa7045ee0a820ca
Signed-off-by: Shawn O. Pearce <sop@google.com>
3 files changed