Toggle navigation
Documentation
The friendly Operating System for the Internet of Things
Main Page
Related Pages
Supported Boards
Modules
Namespaces
Namespace List
Namespace Members
All
Functions
Variables
Enumerations
Data Structures
Data Structures
Class Hierarchy
Data Fields
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
w
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
Enumerator
Related Symbols
Files
File List
Globals
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Typedefs
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
_
a
b
c
d
e
f
g
h
i
k
l
m
n
p
q
r
s
t
u
v
w
x
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
►
RIOT OS
•
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
Loading...
Searching...
No Matches
utils.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2023 Otto-von-Guericke-Universität Magdeburg
3
*
4
* This file is subject to the terms and conditions of the GNU Lesser
5
* General Public License v2.1. See the file LICENSE in the top level
6
* directory for more details.
7
*/
8
19
#ifndef MACROS_UTILS_H
20
#define MACROS_UTILS_H
21
22
#ifdef __cplusplus
23
extern
"C"
{
24
#endif
25
29
#define CONCAT(a, b) a ## b
30
34
#define CONCAT3(a, b, c) a ## b ## c
35
39
#define CONCAT4(a, b, c, d) a ## b ## c ## d
40
41
/* For compatibility with vendor headers, only provide MAX() and MIN() if not
42
* provided. (The alternative approach of using #undef has the downside that
43
* vendor header files may provide a smarter version of MAX() / MIN() that does
44
* not evaluate the argument twice and rely on this).
45
*/
46
#ifndef MAX
53
#define MAX(a, b) ((a) > (b) ? (a) : (b))
54
#endif
55
56
#ifndef MIN
63
#define MIN(a, b) ((a) < (b) ? (a) : (b))
64
#endif
65
66
#ifndef ABS
73
#define ABS(x) ((x) > 0 ? (x) : -(x))
74
#endif
75
90
#define LIMIT(val, low, high) ((val < low) ? low : (val > high) ? high : val)
91
92
#ifdef __cplusplus
93
}
94
#endif
95
96
#endif
/* MACROS_UTILS_H */
Generated on Fri Mar 14 2025 16:55:54 by
1.12.0