diff options
Diffstat (limited to 'pb_decode.h')
-rw-r--r-- | pb_decode.h | 9 |
1 files changed, 9 insertions, 0 deletions
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; |