chiark / gitweb /
Horrid hack to recover run-time endianness for testing.
authorRichard Kettlewell <rjk@greenend.org.uk>
Sat, 14 Mar 2009 11:33:35 +0000 (11:33 +0000)
committerRichard Kettlewell <rjk@greenend.org.uk>
Sat, 14 Mar 2009 11:33:35 +0000 (11:33 +0000)
.bzrignore
server/Makefile.am
server/endian.c [new file with mode: 0644]

index e5fb493..ec15e8e 100644 (file)
@@ -201,3 +201,4 @@ plugins/index.html
 doc/disorder-choose.8
 doc/disorder-choose.8.html
 config.aux/compile
+server/endian
index 6062826..5ed5def 100644 (file)
@@ -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 (file)
index 0000000..2e4b152
--- /dev/null
@@ -0,0 +1,20 @@
+#include <config.h>
+#include <stdio.h>
+
+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:
+*/