summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>2013-01-10 17:32:27 +0200
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2013-01-10 17:32:27 +0200
commitd2c1604d6d239cdab6b21f3daf6634eb112ae318 (patch)
treeb17e5aabb6d06f1cf7780ffb856016e86c7d3a67 /tests
parent93ffe14a0ae32eeda8275f48106e76ecc650168d (diff)
Add generator option for packed structs.
Usage is: message Foo { option (nanopb_msgopt).packed_struct = true; ... } Valid also in file scope. Update issue 49 Status: FixedInGit
Diffstat (limited to 'tests')
-rw-r--r--tests/options.expected1
-rw-r--r--tests/options.proto8
2 files changed, 9 insertions, 0 deletions
diff --git a/tests/options.expected b/tests/options.expected
index 93501430..e6179a27 100644
--- a/tests/options.expected
+++ b/tests/options.expected
@@ -4,3 +4,4 @@ char fieldsize\[40\];
pb_callback_t int32_callback;
\sEnumValue1 = 1
Message5_EnumValue1
+} pb_packed my_packed_struct;
diff --git a/tests/options.proto b/tests/options.proto
index 413d21b5..3e9383cd 100644
--- a/tests/options.proto
+++ b/tests/options.proto
@@ -54,3 +54,11 @@ message Message5
}
required Enum2 field = 1 [default = EnumValue1];
}
+
+// Packed structure
+message my_packed_struct
+{
+ option (nanopb_msgopt).packed_struct = true;
+ optional int32 myfield = 1;
+}
+