Fix warning on clang.
[apps/agl-service-can-low-level.git] / pb_decode.h
index e9f8ced..35de0a2 100644 (file)
@@ -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;