1 #ifndef PLATFORM_H_INCLUDED
2 #define PLATFORM_H_INCLUDED
4 #include "rbcodecconfig.h"
5 #include "rbcodecplatform.h"
11 # define RBCODEC_NOT_ROCKBOX
16 size_t strlcpy(char *dst, const char *src, size_t siz);
20 # define ARRAYLEN(a) (sizeof(a) / sizeof((a)[0]))
24 # define MIN(x, y) ((x)<(y) ? (x) : (y))
28 # define MAX(x, y) ((x)>(y) ? (x) : (y))
32 # define BIT_N(n) (1U << (n))
48 # define DEBUGF debugf
52 # define debugf(...) do { } while (0)
56 # define logf(...) do { } while (0)
61 #ifndef ATTRIBUTE_PRINTF
62 # define ATTRIBUTE_PRINTF(fmt, arg1)
66 # define LIKELY(x) (x)
70 # define UNLIKELY(x) (x)
73 #ifndef CACHEALIGN_ATTR
74 # define CACHEALIGN_ATTR
101 #ifndef MEM_ALIGN_ATTR
102 # define MEM_ALIGN_ATTR
105 #ifndef CACHEALIGN_SIZE
106 # define CACHEALIGN_SIZE 1
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);
118 #endif /* PLATFORM_H_INCLUDED */