From 0a829a955581097cbf268b36e7c5464412025065 Mon Sep 17 00:00:00 2001 Message-Id: <0a829a955581097cbf268b36e7c5464412025065.1713571572.git.mdw@distorted.org.uk> From: Mark Wooding Date: Sat, 14 Mar 2009 11:33:35 +0000 Subject: [PATCH] Horrid hack to recover run-time endianness for testing. Organization: Straylight/Edgeware From: Richard Kettlewell --- .bzrignore | 1 + server/Makefile.am | 6 +++--- server/endian.c | 20 ++++++++++++++++++++ 3 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 server/endian.c diff --git a/.bzrignore b/.bzrignore index e5fb493..ec15e8e 100644 --- a/.bzrignore +++ b/.bzrignore @@ -201,3 +201,4 @@ plugins/index.html doc/disorder-choose.8 doc/disorder-choose.8.html config.aux/compile +server/endian diff --git a/server/Makefile.am b/server/Makefile.am index 6062826..5ed5def 100644 --- a/server/Makefile.am +++ b/server/Makefile.am @@ -19,7 +19,7 @@ sbin_PROGRAMS=disorderd disorder-deadlock disorder-rescan disorder-dump \ disorder-speaker disorder-decode disorder-normalize \ disorder-stats disorder-dbupgrade disorder-choose -noinst_PROGRAMS=trackname +noinst_PROGRAMS=trackname endian AM_CPPFLAGS=-I${top_srcdir}/lib -I../lib @@ -117,12 +117,12 @@ check-help: all ./disorder-choose --version > /dev/null # My sox doesn't know MP3 or FLAC unfortunately -check-decode: disorder-decode disorder-normalize +check-decode: disorder-decode disorder-normalize endian echo "speaker_backend network" > config echo "broadcast 127.255.255.255 discard" > config ./disorder-decode ${top_srcdir}/sounds/scratch.ogg | \ ./disorder-normalize --config config > decoded.raw - oggdec -b 16 -e 1 -R -s 1 -o oggdec.raw ${top_srcdir}/sounds/scratch.ogg + oggdec -b 16 -e `./endian` -R -s 1 -o oggdec.raw ${top_srcdir}/sounds/scratch.ogg cmp decoded.raw oggdec.raw sox ${top_srcdir}/sounds/scratch.ogg scratch.wav ./disorder-decode scratch.wav | \ diff --git a/server/endian.c b/server/endian.c new file mode 100644 index 0000000..2e4b152 --- /dev/null +++ b/server/endian.c @@ -0,0 +1,20 @@ +#include +#include + +int main(void) { +#if WORDS_BIGENDIAN + puts("1"); +#else + puts("0"); +#endif + return 0; +} + +/* +Local Variables: +c-basic-offset:2 +comment-column:40 +fill-column:79 +indent-tabs-mode:nil +End: +*/ -- [mdw]