}
static
-int memstream_write_fn_(void *c, const char *buf, int size) {
+/* of course these can't be the same */
+#ifdef HAVE_FOPENCOOKIE
+ssize_t memstream_write_fn_(void *c, const char *buf, size_t size)
+#else /* HAVE_FOPENCOOKIE */
+int memstream_write_fn_(void *c, const char *buf, int size)
+#endif /* HAVE_FOPENCOOKIE */
+{
struct memstream_cookie_ *cookie = c;
while ((size_t)size + cookie->offset > cookie->allocated) {
#ifdef HAVE_FOPENCOOKIE
/* linux-style memory stream */
- struct cookie_io_functions_t cookie_io_functions = {
+ cookie_io_functions_t cookie_io_functions = {
.read = NULL,
.write = memstream_write_fn_,
.seek = NULL,