summaryrefslogtreecommitdiff
path: root/apps/plugins/mikmod/mikmod_supp.h
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/mikmod/mikmod_supp.h')
-rw-r--r--apps/plugins/mikmod/mikmod_supp.h79
1 files changed, 79 insertions, 0 deletions
diff --git a/apps/plugins/mikmod/mikmod_supp.h b/apps/plugins/mikmod/mikmod_supp.h
new file mode 100644
index 0000000000..55963bf5d4
--- /dev/null
+++ b/apps/plugins/mikmod/mikmod_supp.h
@@ -0,0 +1,79 @@
1#include <string.h>
2#include "plugin.h"
3#include "inttypes.h"
4#include "codecs/lib/tlsf/src/tlsf.h"
5
6#ifndef MIKMOD_SUPP_H
7#define MIKMOD_SUPP_H
8
9#undef WIN32
10
11#ifndef NO_MMSUPP_DEFINES
12#define snprintf(...) rb->snprintf(__VA_ARGS__)
13#define fdprintf(...) rb->fdprintf(__VA_ARGS__)
14#define vsnprintf(...) rb->vsnprintf(__VA_ARGS__)
15
16#define srand(a) rb->srand(a)
17#define rand() rb->rand()
18#define qsort(a,b,c,d) rb->qsort(a,b,c,d)
19#define atoi(a) rb->atoi(a)
20
21#define strlen(a) rb->strlen(a)
22#define strcpy(a,b) rb->strcpy(a,b)
23#define strcat(a,b) rb->strcat(a,b)
24#define strncmp(a,b,c) rb->strncmp(a,b,c)
25#define strcasecmp(a,b) rb->strcasecmp(a,b)
26
27#undef open
28#define open(a,b) rb->open(a,b)
29#undef lseek
30#define lseek(a,b,c) rb->lseek(a,b,c)
31#undef close
32#define close(a) rb->close(a)
33#undef read
34#define read(a,b,c) rb->read(a,b,c)
35#undef write
36#define write(a,b,c) rb->write(a,b,c)
37#undef filesize
38#define filesize(a) rb->filesize(a)
39#endif
40
41#define malloc(x) tlsf_malloc(x)
42#define free(x) tlsf_free(x)
43#define realloc(x,y) tlsf_realloc(x,y)
44#define calloc(x,y) tlsf_calloc(x,y)
45
46#define strncat mmsupp_strncat
47#define printf mmsupp_printf
48#define sprintf mmsupp_sprintf
49
50#define fprintf(...)
51
52char* mmsupp_strncat(char *s1, const char *s2, size_t n);
53void mmsupp_printf(const char *fmt, ...);
54int mmsupp_sprintf(char *buf, const char *fmt, ... );
55
56extern const struct plugin_api * rb;
57
58
59#ifdef SIMULATOR
60#define SAMPLE_RATE SAMPR_44 /* Simulator requires 44100Hz */
61#else
62#if (HW_SAMPR_CAPS & SAMPR_CAP_22) /* use 22050Hz if we can */
63#define SAMPLE_RATE SAMPR_22 /* 22050 */
64#else
65#define SAMPLE_RATE SAMPR_44 /* 44100 */
66#endif
67#endif
68
69#define BUF_SIZE 4096*8
70#define NBUF 2
71
72/* LibMikMod defines */
73#define HAVE_SNPRINTF 1
74
75#ifndef INT_MAX
76#define INT_MAX 2147483647
77#endif
78
79#endif