File: limits.h

package info (click to toggle)
lttng-modules 2.14.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,808 kB
  • sloc: ansic: 74,851; sh: 548; makefile: 62
file content (63 lines) | stat: -rw-r--r-- 1,230 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only)
 *
 * wrapper/limits.h
 *
 * Copyright (C) 2020 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
 */

#ifndef _LTTNG_WRAPPER_LIMITS_H
#define _LTTNG_WRAPPER_LIMITS_H

#include <linux/kernel.h>

#ifndef SIZE_MAX
#define SIZE_MAX	(~(size_t)0)
#endif
#ifndef PHYS_ADDR_MAX
#define PHYS_ADDR_MAX	(~(phys_addr_t)0)
#endif

#ifndef U8_MAX
#define U8_MAX		((u8)~0U)
#endif
#ifndef S8_MAX
#define S8_MAX		((s8)(U8_MAX >> 1))
#endif
#ifndef S8_MIN
#define S8_MIN		((s8)(-S8_MAX - 1))
#endif
#ifndef U16_MAX
#define U16_MAX		((u16)~0U)
#endif
#ifndef S16_MAX
#define S16_MAX		((s16)(U16_MAX >> 1))
#endif
#ifndef S16_MIN
#define S16_MIN		((s16)(-S16_MAX - 1))
#endif
#ifndef U32_MAX
#define U32_MAX		((u32)~0U)
#endif
#ifndef U32_MIN
#define U32_MIN		((u32)0)
#endif
#ifndef S32_MAX
#define S32_MAX		((s32)(U32_MAX >> 1))
#endif
#ifndef S32_MIN
#define S32_MIN		((s32)(-S32_MAX - 1))
#endif
#ifndef U64_MAX
#define U64_MAX		((u64)~0ULL)
#endif
#ifndef S64_MAX
#define S64_MAX		((s64)(U64_MAX >> 1))
#endif
#ifndef S64_MIN
#define S64_MIN		((s64)(-S64_MAX - 1))
#endif
#ifndef SSIZE_MAX
#define SSIZE_MAX	((ssize_t)(SIZE_MAX >> 1))
#endif

#endif /* _LTTNG_WRAPPER_COMPILER_H */