Improve the detection of missing required fields.

Now the limit of tracked fields is configurable at compile-time using
PB_MAX_REQUIRED_FIELDS. Added related test and updated documentation.

Fixes issue #18.
This commit is contained in:
Petteri Aimonen
2012-06-30 18:10:08 +03:00
parent 7bcf7ef579
commit 95eb4a5499
6 changed files with 229 additions and 24 deletions

6
pb.h
View File

@@ -22,6 +22,12 @@
#define UNUSED(x) (void)(x)
#endif
/* Number of required fields to keep track of
* (change here or on compiler command line). */
#ifndef PB_MAX_REQUIRED_FIELDS
#define PB_MAX_REQUIRED_FIELDS 64
#endif
/* List of possible field types. These are used in the autogenerated code.
* Least-significant 4 bits tell the scalar type
* Most-significant 4 bits specify repeated/required/packed etc.