X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=pb_decode.h;h=35de0a2264318984304938494f217296e05fcfa7;hb=6f3740f74ed48daf51908676b203f1889455c17d;hp=e9f8ced899a1e121ab64dd4a03edde52cce4911f;hpb=3aaa4ad8c290af87d9bb9e24447f9cd6f9a79eab;p=apps%2Fagl-service-can-low-level.git diff --git a/pb_decode.h b/pb_decode.h index e9f8ced8..35de0a22 100644 --- a/pb_decode.h +++ b/pb_decode.h @@ -32,7 +32,16 @@ extern "C" { */ struct _pb_istream_t { +#ifdef PB_BUFFER_ONLY + /* Callback pointer is not used in buffer-only configuration. + * Having an int pointer here allows binary compatibility but + * gives an error if someone tries to assign callback function. + */ + int *callback; +#else bool (*callback)(pb_istream_t *stream, uint8_t *buf, size_t count); +#endif + void *state; /* Free field for use by callback implementation */ size_t bytes_left;