opensourcerouting / c-capnproto

C library/compiler for the Cap'n Proto serialization/RPC protocol
MIT License
118 stars 40 forks source link

Allow field name to be 'p'. #45

Closed snar closed 1 year ago

snar commented 3 years ago

Without this change, when someone declares some field with name 'p' capnproto generates code that does not compile due to duplicate parameters with same name:

In file included from proj.capnp.c:1: ./proj.capnp.h:166:41: error: redefinition of parameter 'p' void Proj_set_p(Proj_ptr p, uint8_t p); ^ [....] proj.capnp.c:189:10: error: redefinition of 'p' with a different type: 'uint8_t' (aka 'unsigned char') vs 'Proj_ptr' uint8_t p; ^ proj.capnp.c:187:33: note: previous definition is here uint8_t Proj_get_p(Proj_ptr p) ^