Add support for POINTER type in extensions

This commit is contained in:
Petteri Aimonen
2014-12-26 18:23:36 +02:00
parent 980f899dd5
commit 418f7d88b3
3 changed files with 24 additions and 3 deletions

6
pb.h
View File

@@ -456,9 +456,11 @@ struct pb_extension_s {
0, \
pb_membersize(st, m), 0, ptr}
#define PB_OPTEXT_POINTER(tag, st, m, fd, ltype, ptr) \
PB_OPTIONAL_POINTER(tag, st, m, fd, ltype, ptr)
#define PB_OPTEXT_CALLBACK(tag, st, m, fd, ltype, ptr) \
{tag, PB_ATYPE_CALLBACK | PB_HTYPE_OPTIONAL | ltype, \
0, 0, pb_membersize(st, m), 0, ptr}
PB_OPTIONAL_CALLBACK(tag, st, m, fd, ltype, ptr)
/* The mapping from protobuf types to LTYPEs is done using these macros. */
#define PB_LTYPE_MAP_BOOL PB_LTYPE_VARINT