diff options
author | David Robillard <d@drobilla.net> | 2012-08-09 20:51:41 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-08-09 20:51:41 +0000 |
commit | 402fec7d2baa182464129ab510e2b1fe266bfe48 (patch) | |
tree | e1c3273671d8885e2285ad3de371b0ced436f978 /src | |
parent | 2b76b454da7a34828985f93bdf92e115a86630b6 (diff) | |
download | lilv-402fec7d2baa182464129ab510e2b1fe266bfe48.tar.gz lilv-402fec7d2baa182464129ab510e2b1fe266bfe48.tar.bz2 lilv-402fec7d2baa182464129ab510e2b1fe266bfe48.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/util.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -49,6 +49,10 @@ # include <sys/file.h> #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)); |