d1f81eb45e0665054c30ff04b807029c4ba5ff95
[retrobench] / src / util.h
1 #ifndef UTIL_H_
2 #define UTIL_H_
3
4 #ifdef NO_STDINT_H
5 typedef char int8_t;
6 typedef unsigned char uint8_t;
7 typedef short int16_t;
8 typedef unsigned short uint16_t;
9 typedef int int32_t;
10 typedef unsigned int uint32_t;
11 #else
12 #include <stdint.h>
13 #endif
14
15 extern int sinlut[];
16
17 #define SIN(x) sinlut[(x) & 0x3ff]
18 #define COS(x) sinlut[((x) + 256) & 0x3ff]
19
20 int mask_to_shift(unsigned int mask);
21
22 #endif  /* UTIL_H_ */