• Paolo Borelli's avatar
    proto3 support · 8194f4d9
    Paolo Borelli authored
    This is a first cut at adding proto3 support.
    
    As far as I understand protobuf-c already has pretty much everything
    needed once it is built using a new version of protobuf itself.
    The only missing thing is that in proto3 all fields are optional and
    having to manually set has_foo is inconvenient.
    
    This patch special cases the proto3 syntax files so that structs for the
    bytes, enum and primitive fields do not emit the has_ field.
    
    It also adds PROTOBUF_C_LABEL_NONE to the label enum that is used for
    proto3 fields. When a fields has this label, the quantifier is not
    consulted and instead the field is packed/unpacked depending on
    whether it has a value different from NULL/0.
    8194f4d9
c_bytes_field.cc 6.55 KB