All kernel objects in code shared amongs targets (core, plugins, codecs) should be...
[kugel-rb.git] / apps / plugins / mikmod / mikmod_supp.h
blob55963bf5d49fbee6d845cb8b69ccfc4ee4b0df49
1 #include <string.h>
2 #include "plugin.h"
3 #include "inttypes.h"
4 #include "codecs/lib/tlsf/src/tlsf.h"
6 #ifndef MIKMOD_SUPP_H
7 #define MIKMOD_SUPP_H
9 #undef WIN32
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__)
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)
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)
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
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)
46 #define strncat mmsupp_strncat
47 #define printf mmsupp_printf
48 #define sprintf mmsupp_sprintf
50 #define fprintf(...)
52 char* mmsupp_strncat(char *s1, const char *s2, size_t n);
53 void mmsupp_printf(const char *fmt, ...);
54 int mmsupp_sprintf(char *buf, const char *fmt, ... );
56 extern const struct plugin_api * rb;
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
69 #define BUF_SIZE 4096*8
70 #define NBUF 2
72 /* LibMikMod defines */
73 #define HAVE_SNPRINTF 1
75 #ifndef INT_MAX
76 #define INT_MAX 2147483647
77 #endif
79 #endif