aboutsummaryrefslogtreecommitdiffstats
path: root/src/sink.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-12-11 22:11:22 +0000
committerDavid Robillard <d@drobilla.net>2011-12-11 22:11:22 +0000
commitea1936a594d7e4e656731223b76d355fc5431ef9 (patch)
tree87393e02793fba4cd44fb8da2db83f24380b509a /src/sink.c
parente08decb5992d6511e6896939a4cd9ad157831b78 (diff)
downloadserd-ea1936a594d7e4e656731223b76d355fc5431ef9.tar.gz
serd-ea1936a594d7e4e656731223b76d355fc5431ef9.tar.bz2
serd-ea1936a594d7e4e656731223b76d355fc5431ef9.zip
Move all #ifdef gunk to serd_internal.h.
Centralise file open and buffer allocation to localize platform tweaks. git-svn-id: http://svn.drobilla.net/serd/trunk@244 490d8e77-9747-427b-9fa3-0b8f29cee8a0
Diffstat (limited to 'src/sink.c')
-rw-r--r--src/sink.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/sink.c b/src/sink.c
index 3eb44b9a..3fa90e8c 100644
--- a/src/sink.c
+++ b/src/sink.c
@@ -14,14 +14,11 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#define _POSIX_C_SOURCE 201112L /* for posix_memalign */
+#include "serd_internal.h"
#include <stdlib.h>
#include <string.h>
-#include "serd_internal.h"
-#include "serd-config.h"
-
#ifndef MIN
# define MIN(a, b) (((a) < (b)) ? (a) : (b))
#endif
@@ -43,11 +40,7 @@ serd_bulk_sink_new(SerdSink sink, void* stream, size_t block_size)
bsink->stream = stream;
bsink->size = 0;
bsink->block_size = block_size;
-#ifdef HAVE_POSIX_MEMALIGN
- posix_memalign((void**)&bsink->buf, block_size, block_size);
-#else
- bsink->buf = (uint8_t*)malloc(block_size);
-#endif
+ bsink->buf = serd_bufalloc(block_size);
return bsink;
}