diff options
author | Yu Shan <shanyu@google.com> | 2018-07-26 20:00:48 -0400 |
---|---|---|
committer | Yu Shan <shanyu@google.com> | 2018-08-03 23:56:55 +0000 |
commit | ba65bcbacd1707eed64045a84b1716a34b0e1d56 (patch) | |
tree | a59f0b9620389ebb642366debccffc2cd0455d79 | |
parent | 1f399cdc4c3cdb9328f63db0b0ef3d4e6552b6d5 (diff) | |
download | nanopb-c-ba65bcbacd1707eed64045a84b1716a34b0e1d56.tar.gz |
Revert revert "Add legacy macro definition for precompiled files."
This reverts commit d2fd0b0afe3b5e8aafcf6f97d98b1045368d69bc.
Bug: b/111798740
Test: Local build tests.
Change-Id: Ibff509f2cf7688ed804c54ee20ce9c7ff658d7ee
-rw-r--r-- | patches/pb.h.patch | 27 | ||||
-rw-r--r-- | pb.h | 6 |
2 files changed, 33 insertions, 0 deletions
diff --git a/patches/pb.h.patch b/patches/pb.h.patch new file mode 100644 index 0000000..f269b7d --- /dev/null +++ b/patches/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 + @@ -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) \ |