summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorFrank Gevaerts <frank@gevaerts.be>2015-01-19 21:20:34 +0100
committerFrank Gevaerts <frank@gevaerts.be>2015-01-19 21:30:03 +0100
commit163ca14e58be3efa7aa3b911968fd43524e5f6e6 (patch)
treead4926fe53c9d13dd68ecbf95d7af9d3f6e5078a /lib
parent3ae0f32ac3d6693a9528703c5f1b3586a9d79601 (diff)
downloadrockbox-163ca14e58be3efa7aa3b911968fd43524e5f6e6.tar.gz
rockbox-163ca14e58be3efa7aa3b911968fd43524e5f6e6.tar.bz2
rockbox-163ca14e58be3efa7aa3b911968fd43524e5f6e6.zip
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
Diffstat (limited to 'lib')
-rw-r--r--lib/rbcodec/platform.h4
-rw-r--r--lib/rbcodec/rbcodecplatform-unix.h6
-rw-r--r--lib/rbcodec/test/SOURCES3
-rw-r--r--lib/rbcodec/test/warble.c12
4 files changed, 25 insertions, 0 deletions
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 <unistd.h>
#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)