summaryrefslogtreecommitdiff
path: root/lib/rbcodec/platform.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rbcodec/platform.h')
-rw-r--r--lib/rbcodec/platform.h122
1 files changed, 122 insertions, 0 deletions
diff --git a/lib/rbcodec/platform.h b/lib/rbcodec/platform.h
new file mode 100644
index 0000000000..47df8fe6a2
--- /dev/null
+++ b/lib/rbcodec/platform.h
@@ -0,0 +1,122 @@
1#ifndef PLATFORM_H_INCLUDED
2#define PLATFORM_H_INCLUDED
3
4#include "rbcodecconfig.h"
5#include "rbcodecplatform.h"
6
7/*
8
9#ifndef ROCKBOX
10# define __PCTOOL__
11# define RBCODEC_NOT_ROCKBOX
12# define ROCKBOX
13#endif
14
15#ifndef HAVE_STRLCPY
16size_t strlcpy(char *dst, const char *src, size_t siz);
17#endif
18*/
19#ifndef ARRAYLEN
20# define ARRAYLEN(a) (sizeof(a) / sizeof((a)[0]))
21#endif
22
23#ifndef MIN
24# define MIN(x, y) ((x)<(y) ? (x) : (y))
25#endif
26
27#ifndef MAX
28# define MAX(x, y) ((x)>(y) ? (x) : (y))
29#endif
30
31#ifndef BIT_N
32# define BIT_N(n) (1U << (n))
33#endif
34/*
35#ifdef CODEC
36
37# ifdef debugf
38# undef debugf
39# endif
40
41# ifdef logf
42# undef logf
43# endif
44
45#else
46
47# ifndef DEBUGF
48# define DEBUGF debugf
49# endif
50
51# ifndef debugf
52# define debugf(...) do { } while (0)
53# endif
54
55# ifndef logf
56# define logf(...) do { } while (0)
57# endif
58
59#endif
60
61#ifndef ATTRIBUTE_PRINTF
62# define ATTRIBUTE_PRINTF(fmt, arg1)
63#endif
64
65#ifndef LIKELY
66# define LIKELY(x) (x)
67#endif
68
69#ifndef UNLIKELY
70# define UNLIKELY(x) (x)
71#endif
72*/
73#ifndef CACHEALIGN_ATTR
74# define CACHEALIGN_ATTR
75#endif
76/*
77#ifndef DATA_ATTR
78# define DATA_ATTR
79#endif
80*/
81#ifndef IBSS_ATTR
82# define IBSS_ATTR
83#endif
84
85#ifndef ICODE_ATTR
86# define ICODE_ATTR
87#endif
88
89#ifndef ICONST_ATTR
90# define ICONST_ATTR
91#endif
92
93#ifndef IDATA_ATTR
94# define IDATA_ATTR
95#endif
96/*
97#ifndef INIT_ATTR
98# define INIT_ATTR
99#endif
100*/
101#ifndef MEM_ALIGN_ATTR
102# define MEM_ALIGN_ATTR
103#endif
104/*
105#ifndef STATICIRAM
106# define STATICIRAM
107#endif
108*/
109#ifndef CACHEALIGN_SIZE
110# define CACHEALIGN_SIZE 1
111#endif
112/*
113#ifndef HAVE_CLIP_SAMPLE_16
114static inline int32_t clip_sample_16(int32_t sample)
115{
116 if ((int16_t)sample != sample)
117 sample = 0x7fff ^ (sample >> 31);
118 return sample;
119}
120#endif
121*/
122#endif /* PLATFORM_H_INCLUDED */