Which seems wrong because if I try to get the length of the list using capn_len I cannot compile my program because capn_len tries to access a member named p and struct capn_ptr doesn't have a member named p:
In file included from bufs/main.capnp.h:4:0,
from event.c:3:
event.c: In function 'event_tocapn':
../deps/build/usr/local/include/capnp_c.h:182:31: error: 'capn_ptr {aka struct capn_ptr}' has no member named 'p'
#define capn_len(list) ((list).p.type == CAPN_FAR_POINTER ? (capn_resolve(&(list).p), (list).p.len) : (list).p.len)
^
event.c:173:27: note: in expansion of macro 'capn_len'
printf("Len is %d\n", capn_len(ie->args));
^~~~~~~~
...
If I use a custom defined type as the list members (such as a struct containing only a Text field) everything is fine.
From looking at other examples, it looks like this field should be a capn_data struct or one of the capn_list structs?
I have a struct like this:
Which generates a struct like this:
Which seems wrong because if I try to get the length of the list using capn_len I cannot compile my program because
capn_len
tries to access a member namedp
andstruct capn_ptr
doesn't have a member namedp
:If I use a custom defined type as the list members (such as a struct containing only a Text field) everything is fine.
From looking at other examples, it looks like this field should be a
capn_data
struct or one of thecapn_list
structs?