VSF Documented
stddef.h
Go to the documentation of this file.
1#ifndef __XBOOT_STDDEF_H__
2#define __XBOOT_STDDEF_H__
3
5
6#ifdef __cplusplus
7extern "C" {
8#endif
9
10#ifndef offsetof
11# define offsetof vsf_offset_of
12#endif
13
14#define clamp(v, a, b) min(max(a, v), b)
15
16#define ifloor(x) ((x) > 0 ? (int)(x) : (int)((x) - 0.9999999999))
17#define iround(x) ((x) > 0 ? (int)((x) + 0.5) : (int)((x) - 0.5))
18#define iceil(x) ((x) > 0 ? (int)((x) + 0.9999999999) : (int)(x))
19#define idiv255(x) ((((int)(x) + 1) * 257) >> 16)
20
21#ifdef __cplusplus
22}
23#endif
24
25#endif