From 402fec7d2baa182464129ab510e2b1fe266bfe48 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 9 Aug 2012 20:51:41 +0000 Subject: Use existing PAGE_SIZE if defined (fix compilation on Haiku). git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@4640 a436a847-0d15-0410-975c-d299462d15a1 --- src/util.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/util.c') diff --git a/src/util.c b/src/util.c index e9c0411..6286446 100644 --- a/src/util.c +++ b/src/util.c @@ -49,6 +49,10 @@ # include #endif +#ifndef PAGE_SIZE +# define PAGE_SIZE 4096 +#endif + char* lilv_strjoin(const char* first, ...) { @@ -274,9 +278,8 @@ lilv_copy_file(const char* src, const char* dst) return 2; } - static const size_t PAGE_SIZE = 4096; - char* page = (char*)malloc(PAGE_SIZE); - size_t n_read = 0; + char* page = (char*)malloc(PAGE_SIZE); + size_t n_read = 0; while ((n_read = fread(page, 1, PAGE_SIZE, in)) > 0) { if (fwrite(page, 1, n_read, out) != n_read) { LILV_ERRORF("write to %s failed (%s)\n", dst, strerror(errno)); -- cgit v1.2.1