Linux Audio

Check our new training course

Loading...
v4.17
 1/* SPDX-License-Identifier: GPL-2.0 */
 2#ifndef _TYPES_H_
 3#define _TYPES_H_
 4
 5#include <stdbool.h>
 6
 7#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
 8
 9typedef unsigned char		u8;
10typedef unsigned short		u16;
11typedef unsigned int		u32;
12typedef unsigned long long	u64;
13typedef signed char		s8;
14typedef short			s16;
15typedef int			s32;
16typedef long long		s64;
17
18/* required for opal-api.h */
19typedef u8  uint8_t;
20typedef u16 uint16_t;
21typedef u32 uint32_t;
22typedef u64 uint64_t;
23typedef s8  int8_t;
24typedef s16 int16_t;
25typedef s32 int32_t;
26typedef s64 int64_t;
27
28#define min(x,y) ({ \
29	typeof(x) _x = (x);	\
30	typeof(y) _y = (y);	\
31	(void) (&_x == &_y);	\
32	_x < _y ? _x : _y; })
33
34#define max(x,y) ({ \
35	typeof(x) _x = (x);	\
36	typeof(y) _y = (y);	\
37	(void) (&_x == &_y);	\
38	_x > _y ? _x : _y; })
39
40#define min_t(type, a, b) min(((type) a), ((type) b))
41#define max_t(type, a, b) max(((type) a), ((type) b))
42
43typedef int bool;
44
45#ifndef true
46#define true 1
47#endif
48
49#ifndef false
50#define false 0
51#endif
52#endif /* _TYPES_H_ */
v4.10.11
 
 1#ifndef _TYPES_H_
 2#define _TYPES_H_
 3
 4#include <stdbool.h>
 5
 6#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
 7
 8typedef unsigned char		u8;
 9typedef unsigned short		u16;
10typedef unsigned int		u32;
11typedef unsigned long long	u64;
12typedef signed char		s8;
13typedef short			s16;
14typedef int			s32;
15typedef long long		s64;
16
17/* required for opal-api.h */
18typedef u8  uint8_t;
19typedef u16 uint16_t;
20typedef u32 uint32_t;
21typedef u64 uint64_t;
22typedef s8  int8_t;
23typedef s16 int16_t;
24typedef s32 int32_t;
25typedef s64 int64_t;
26
27#define min(x,y) ({ \
28	typeof(x) _x = (x);	\
29	typeof(y) _y = (y);	\
30	(void) (&_x == &_y);	\
31	_x < _y ? _x : _y; })
32
33#define max(x,y) ({ \
34	typeof(x) _x = (x);	\
35	typeof(y) _y = (y);	\
36	(void) (&_x == &_y);	\
37	_x > _y ? _x : _y; })
38
39#define min_t(type, a, b) min(((type) a), ((type) b))
40#define max_t(type, a, b) max(((type) a), ((type) b))
41
42typedef int bool;
43
44#ifndef true
45#define true 1
46#endif
47
48#ifndef false
49#define false 0
50#endif
51#endif /* _TYPES_H_ */