skin engine: Relax the AA load width/height checks
[maemo-rb.git] / lib / rbcodec / platform.h
blobfe79358b21a517223b6ab8c0d7c9e6ab8d3b52f3
1 #ifndef PLATFORM_H_INCLUDED
2 #define PLATFORM_H_INCLUDED
4 #include "rbcodecconfig.h"
5 #include "rbcodecplatform.h"
7 /*
9 #ifndef ROCKBOX
10 # define __PCTOOL__
11 # define RBCODEC_NOT_ROCKBOX
12 # define ROCKBOX
13 #endif
15 #ifndef HAVE_STRLCPY
16 size_t strlcpy(char *dst, const char *src, size_t siz);
17 #endif
19 #ifndef ARRAYLEN
20 # define ARRAYLEN(a) (sizeof(a) / sizeof((a)[0]))
21 #endif
23 #ifndef MIN
24 # define MIN(x, y) ((x)<(y) ? (x) : (y))
25 #endif
27 #ifndef MAX
28 # define MAX(x, y) ((x)>(y) ? (x) : (y))
29 #endif
31 #ifndef BIT_N
32 # define BIT_N(n) (1U << (n))
33 #endif
35 #ifdef CODEC
37 # ifdef debugf
38 # undef debugf
39 # endif
41 # ifdef logf
42 # undef logf
43 # endif
45 #else
47 # ifndef DEBUGF
48 # define DEBUGF debugf
49 # endif
51 # ifndef debugf
52 # define debugf(...) do { } while (0)
53 # endif
55 # ifndef logf
56 # define logf(...) do { } while (0)
57 # endif
59 #endif
61 #ifndef ATTRIBUTE_PRINTF
62 # define ATTRIBUTE_PRINTF(fmt, arg1)
63 #endif
65 #ifndef LIKELY
66 # define LIKELY(x) (x)
67 #endif
69 #ifndef UNLIKELY
70 # define UNLIKELY(x) (x)
71 #endif
73 #ifndef CACHEALIGN_ATTR
74 # define CACHEALIGN_ATTR
75 #endif
77 #ifndef DATA_ATTR
78 # define DATA_ATTR
79 #endif
81 #ifndef IBSS_ATTR
82 # define IBSS_ATTR
83 #endif
85 #ifndef ICODE_ATTR
86 # define ICODE_ATTR
87 #endif
89 #ifndef ICONST_ATTR
90 # define ICONST_ATTR
91 #endif
93 #ifndef IDATA_ATTR
94 # define IDATA_ATTR
95 #endif
97 #ifndef INIT_ATTR
98 # define INIT_ATTR
99 #endif
101 #ifndef MEM_ALIGN_ATTR
102 # define MEM_ALIGN_ATTR
103 #endif
105 #ifndef CACHEALIGN_SIZE
106 # define CACHEALIGN_SIZE 1
107 #endif
109 #ifndef HAVE_CLIP_SAMPLE_16
110 static inline int32_t clip_sample_16(int32_t sample)
112 if ((int16_t)sample != sample)
113 sample = 0x7fff ^ (sample >> 31);
114 return sample;
116 #endif
118 #endif /* PLATFORM_H_INCLUDED */