diff --git a/compiler/capnpc-c.c b/compiler/capnpc-c.c index b4d7df5..dfdc436 100644 --- a/compiler/capnpc-c.c +++ b/compiler/capnpc-c.c @@ -5,6 +5,7 @@ * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ +#define _POSIX_C_SOURCE 200809L #include "schema.capnp.h" #include "str.h" @@ -12,6 +13,7 @@ #include #include #include +#include struct value { struct Type t; diff --git a/lib/capn-malloc.c b/lib/capn-malloc.c index 3290e79..569bef9 100644 --- a/lib/capn-malloc.c +++ b/lib/capn-malloc.c @@ -413,7 +413,7 @@ int64_t capn_size(struct capn *c) size_t headersz, datasz = 0; struct capn_ptr root; struct capn_segment *seg; - int i; + uint32_t i; if (c->segnum == 0) return -1; @@ -421,7 +421,7 @@ int64_t capn_size(struct capn *c) root = capn_root(c); seg = root.seg; - headersz = 8 * ((2 + c->segnum) / 2); + headersz = 8 * ((2 + c->segnum) / 2); for (i = 0; i < c->segnum; i++, seg = seg->next) { if (0 == seg)