aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYu Shan <shanyu@google.com>2018-07-27 10:55:14 -0700
committerandroid-build-merger <android-build-merger@google.com>2018-07-27 10:55:14 -0700
commit71cfe23cf7c1c79968b270c0027506a7f05c63cf (patch)
tree9781ad4afd302e7457422dca4f0e65f29f86538a
parent50d8eacc11c13f9e82c69fe6dae498e7fe86cdde (diff)
parenta566afc9e10066fffdce5206976108e3abf6dda1 (diff)
downloadnanopb-c-71cfe23cf7c1c79968b270c0027506a7f05c63cf.tar.gz
Add legacy macro definition for precompiled files.
am: a566afc9e1 Change-Id: I0a013233d9f38b83583b2eeb14e48b608e8da672
-rw-r--r--pb.h6
-rw-r--r--pb.h.patch27
2 files changed, 33 insertions, 0 deletions
diff --git a/pb.h b/pb.h
index 174a84b..52d24de 100644
--- a/pb.h
+++ b/pb.h
@@ -122,6 +122,11 @@
#define PB_STATIC_ASSERT_MSG(MSG, LINE, COUNTER) PB_STATIC_ASSERT_MSG_(MSG, LINE, COUNTER)
#define PB_STATIC_ASSERT_MSG_(MSG, LINE, COUNTER) pb_static_assertion_##MSG##LINE##COUNTER
#endif
+#ifndef STATIC_ASSERT
+#define STATIC_ASSERT PB_STATIC_ASSERT
+#define STATIC_ASSERT_MSG PB_STATIC_ASSERT_MSG
+#define STATIC_ASSERT_MSG_ PB_STATIC_ASSERT_MSG_
+#endif
#else
#define PB_STATIC_ASSERT(COND,MSG)
#endif
@@ -526,6 +531,7 @@ struct pb_extension_s {
PB_ ## rules ## _ ## allocation(tag, message, field, \
PB_DATAOFFSET_ ## placement(message, field, prevfield), \
PB_LTYPE_MAP_ ## type, ptr)
+#define PB_FIELD2 PB_FIELD
/* Field description for repeated static fixed count fields.*/
#define PB_REPEATED_FIXED_COUNT(tag, type, placement, message, field, prevfield, ptr) \
diff --git a/pb.h.patch b/pb.h.patch
new file mode 100644
index 0000000..f269b7d
--- /dev/null
+++ b/pb.h.patch
@@ -0,0 +1,27 @@
+diff --git a/pb.h b/pb.h
+index 174a84b..52d24de 100644
+--- a/pb.h
++++ b/pb.h
+@@ -122,6 +122,11 @@
+ #define PB_STATIC_ASSERT_MSG(MSG, LINE, COUNTER) PB_STATIC_ASSERT_MSG_(MSG, LINE, COUNTER)
+ #define PB_STATIC_ASSERT_MSG_(MSG, LINE, COUNTER) pb_static_assertion_##MSG##LINE##COUNTER
+ #endif
++#ifndef STATIC_ASSERT
++#define STATIC_ASSERT PB_STATIC_ASSERT
++#define STATIC_ASSERT_MSG PB_STATIC_ASSERT_MSG
++#define STATIC_ASSERT_MSG_ PB_STATIC_ASSERT_MSG_
++#endif
+ #else
+ #define PB_STATIC_ASSERT(COND,MSG)
+ #endif
+@@ -526,6 +531,7 @@ struct pb_extension_s {
+ PB_ ## rules ## _ ## allocation(tag, message, field, \
+ PB_DATAOFFSET_ ## placement(message, field, prevfield), \
+ PB_LTYPE_MAP_ ## type, ptr)
++#define PB_FIELD2 PB_FIELD
+
+ /* Field description for repeated static fixed count fields.*/
+ #define PB_REPEATED_FIXED_COUNT(tag, type, placement, message, field, prevfield, ptr) \
+--
+2.18.0.345.g5c9ce644c3-goog
+