summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pb.h5
-rw-r--r--pb_decode.c1
-rw-r--r--pb_encode.c1
3 files changed, 5 insertions, 2 deletions
diff --git a/pb.h b/pb.h
index b12debe9..138c6bb8 100644
--- a/pb.h
+++ b/pb.h
@@ -8,9 +8,14 @@
#define NANOPB_VERSION nanopb-0.2.1-dev
+#ifdef PB_SYSTEM_HEADER
+#include PB_SYSTEM_HEADER
+#else
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
+#include <string.h>
+#endif
#ifdef __GNUC__
/* This just reduces memory requirements, but is not required. */
diff --git a/pb_decode.c b/pb_decode.c
index 91b68ea3..6e81b40b 100644
--- a/pb_decode.c
+++ b/pb_decode.c
@@ -14,7 +14,6 @@
#define NANOPB_INTERNALS
#include "pb.h"
#include "pb_decode.h"
-#include <string.h>
typedef bool (*pb_decoder_t)(pb_istream_t *stream, const pb_field_t *field, void *dest) checkreturn;
diff --git a/pb_encode.c b/pb_encode.c
index fd4b6ba5..7acee360 100644
--- a/pb_encode.c
+++ b/pb_encode.c
@@ -6,7 +6,6 @@
#define NANOPB_INTERNALS
#include "pb.h"
#include "pb_encode.h"
-#include <string.h>
/* The warn_unused_result attribute appeared first in gcc-3.4.0 */
#if !defined(__GNUC__) || ( __GNUC__ < 3) || (__GNUC__ == 3 && __GNUC_MINOR__ < 4)