system/ByteOrder: new library for byte ordering / endianess

Replacing GLib macros.
This commit is contained in:
Max Kellermann
2013-10-16 21:09:19 +02:00
parent 08eca827b6
commit 5e26e2ab1d
16 changed files with 289 additions and 109 deletions

View File

@@ -27,6 +27,7 @@
#include "util/Error.hxx"
#include "util/UriUtil.hxx"
#include "util/Macros.hxx"
#include "system/ByteOrder.hxx"
#include "CheckAudioFormat.hxx"
#include "tag/TagHandler.hxx"
#include "Log.hxx"
@@ -47,18 +48,10 @@
#define ov_time_seek_page(VF, S) (ov_time_seek_page(VF, (S)*1000))
#endif /* HAVE_TREMOR */
#include <glib.h>
#include <assert.h>
#include <errno.h>
#include <unistd.h>
#if G_BYTE_ORDER == G_BIG_ENDIAN
#define VORBIS_BIG_ENDIAN true
#else
#define VORBIS_BIG_ENDIAN false
#endif
struct vorbis_input_stream {
struct decoder *decoder;
@@ -248,7 +241,7 @@ vorbis_stream_decode(struct decoder *decoder,
#ifdef HAVE_TREMOR
long nbytes = ov_read(&vf, buffer, sizeof(buffer),
VORBIS_BIG_ENDIAN, 2, 1,
IsBigEndian(), 2, 1,
&current_section);
#else
float **per_channel;