+{
+ int64_t value = 0;
+
+ /* Cases 1 and 2 are for compilers that have smaller types for bool
+ * or enums. */
+ switch (field->data_size)
+ {
+ case 1: value = *(const int8_t*)src; break;
+ case 2: value = *(const int16_t*)src; break;
+ case 4: value = *(const int32_t*)src; break;
+ case 8: value = *(const int64_t*)src; break;
+ default: PB_RETURN_ERROR(stream, "invalid data_size");
+ }
+
+ return pb_encode_varint(stream, (uint64_t)value);
+}
+
+bool checkreturn pb_enc_uvarint(pb_ostream_t *stream, const pb_field_t *field, const void *src)