iamandi / nanopb

Automatically exported from code.google.com/p/nanopb
zlib License
0 stars 0 forks source link

Add #define for string defined size #87

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
...
    char requiredString[40];
...

Maybe it's possible to have a define like this
#define requiredString_size    40

Original issue reported on code.google.com by mss...@gmail.com on 11 Sep 2013 at 7:15

GoogleCodeExporter commented 9 years ago
I would suggest simply using:

    sizeof(mymessage.requiredString);

or if you do not yet have an instance of the struct, then:

    pb_membersize(MyMessage, requiredString);

Would this be ok or is there a specific reason why a #define is necessary?

Original comment by Petteri.Aimonen on 12 Sep 2013 at 6:28

GoogleCodeExporter commented 9 years ago

Original comment by Petteri.Aimonen on 18 Sep 2013 at 9:51