X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=pb.h;h=258ec925dfdf5130f210cc66a80564ba52f198de;hb=2c51fb7771687cdd75377094d09c6c01ef66e2cc;hp=6f8438540f8ae42a8756fba3c2cfc8a5a5b8507d;hpb=607cb998b5472ef1df461995b33694e9a54bef23;p=apps%2Fagl-service-can-low-level.git diff --git a/pb.h b/pb.h index 6f843854..258ec925 100644 --- a/pb.h +++ b/pb.h @@ -46,7 +46,7 @@ /* Version of the nanopb library. Just in case you want to check it in * your own program. */ -#define NANOPB_VERSION nanopb-0.2.7-dev +#define NANOPB_VERSION nanopb-0.2.8 /* Include all the system headers needed by nanopb. You will need the * definitions of the following: @@ -341,6 +341,10 @@ struct _pb_extension_t { * If this extension does not match a field, the next handler is * automatically called. */ pb_extension_t *next; + + /* The decoder sets this to true if the extension was found. + * Ignored for encoding. */ + bool found; }; /* Memory allocation functions to use. You can define pb_realloc and @@ -496,7 +500,11 @@ struct _pb_extension_t { * messages if not used. */ #ifdef PB_NO_ERRMSG -#define PB_RETURN_ERROR(stream,msg) return false +#define PB_RETURN_ERROR(stream,msg) \ + do {\ + UNUSED(stream); \ + return false; \ + } while(0) #define PB_GET_ERROR(stream) "(errmsg disabled)" #else #define PB_RETURN_ERROR(stream,msg) \