From 163ca14e58be3efa7aa3b911968fd43524e5f6e6 Mon Sep 17 00:00:00 2001 From: Frank Gevaerts Date: Mon, 19 Jan 2015 21:20:34 +0100 Subject: Enable buflib and core_alloc for warble. Most of the work comes from http://gerrit.rockbox.org/r/#/c/1088/ by Thomas Jarosch. Change-Id: Iaa673dad2388d1e44fc95ffaa14bafadc6158101 --- lib/rbcodec/platform.h | 4 ++++ lib/rbcodec/rbcodecplatform-unix.h | 6 ++++++ lib/rbcodec/test/SOURCES | 3 +++ lib/rbcodec/test/warble.c | 12 ++++++++++++ 4 files changed, 25 insertions(+) (limited to 'lib/rbcodec') diff --git a/lib/rbcodec/platform.h b/lib/rbcodec/platform.h index 7a0c87fa9c..febda44ca0 100644 --- a/lib/rbcodec/platform.h +++ b/lib/rbcodec/platform.h @@ -66,6 +66,10 @@ size_t strlcpy(char *dst, const char *src, size_t siz); # define logf(...) do { } while (0) # endif +# ifndef panicf +# define panicf(...) do { } while (0) +# endif + #endif #ifndef ATTRIBUTE_PRINTF diff --git a/lib/rbcodec/rbcodecplatform-unix.h b/lib/rbcodec/rbcodecplatform-unix.h index 4ed25f44e8..2df0a50221 100644 --- a/lib/rbcodec/rbcodecplatform-unix.h +++ b/lib/rbcodec/rbcodecplatform-unix.h @@ -64,6 +64,12 @@ off_t filesize(int fd); putc('\n', stderr); \ } while (0) #endif +#ifndef panicf +#define panicf(...) do { fprintf(stderr, __VA_ARGS__); \ + putc('\n', stderr); \ + exit(-1); \ + } while (0) +#endif #endif */ diff --git a/lib/rbcodec/test/SOURCES b/lib/rbcodec/test/SOURCES index 7afee84ae6..7b535f0fe0 100644 --- a/lib/rbcodec/test/SOURCES +++ b/lib/rbcodec/test/SOURCES @@ -3,3 +3,6 @@ warble.c ../../../firmware/common/unicode.c ../../../firmware/common/structec.c ../../../firmware/common/pathfuncs.c +../../../firmware/common/crc32.c +../../../firmware/buflib.c +../../../firmware/core_alloc.c diff --git a/lib/rbcodec/test/warble.c b/lib/rbcodec/test/warble.c index 8f11b9b56e..9cb7cdfe07 100644 --- a/lib/rbcodec/test/warble.c +++ b/lib/rbcodec/test/warble.c @@ -33,6 +33,7 @@ #include #include "buffering.h" /* TYPE_PACKET_AUDIO */ #include "kernel.h" +#include "core_alloc.h" #include "codecs.h" #include "dsp_core.h" #include "metadata.h" @@ -70,6 +71,16 @@ void debugf(const char *fmt, ...) va_end(ap); } +void panicf(const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + vfprintf(stderr, fmt, ap); + va_end(ap); + + exit (-1); +} + int find_first_set_bit(uint32_t value) { if (value == 0) @@ -888,6 +899,7 @@ int main(int argc, char **argv) print_help(argv[0]); exit(1); } + core_allocator_init(); playback_init(); } else { if (argc > 1) -- cgit