Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nanopb/nanopb.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'pb_decode.h')
-rw-r--r--pb_decode.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/pb_decode.h b/pb_decode.h
index e9f8ced..35de0a2 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;