Commit | Line | Data |
---|---|---|
acdb82a2 MJ |
1 | // SPDX-FileCopyrightText: 2018 Michael Jeanson <mjeanson@efficios.com> |
2 | // | |
3 | // SPDX-License-Identifier: LGPL-2.1-or-later | |
4 | ||
4477a870 MD |
5 | #ifndef _URCU_UTILS_H |
6 | #define _URCU_UTILS_H | |
7 | ||
8 | /* | |
4477a870 | 9 | * Userspace RCU library internal utils |
4477a870 MD |
10 | */ |
11 | ||
375db287 MJ |
12 | #include <urcu/config.h> |
13 | ||
4477a870 MD |
14 | #define urcu_stringify(a) _urcu_stringify(a) |
15 | #define _urcu_stringify(a) #a | |
16 | ||
83e334d0 MJ |
17 | #define max_t(type, x, y) \ |
18 | ({ \ | |
19 | type __max1 = (x); \ | |
20 | type __max2 = (y); \ | |
21 | __max1 > __max2 ? __max1: __max2; \ | |
22 | }) | |
23 | ||
24 | #define min_t(type, x, y) \ | |
25 | ({ \ | |
26 | type __min1 = (x); \ | |
27 | type __min2 = (y); \ | |
28 | __min1 <= __min2 ? __min1: __min2; \ | |
29 | }) | |
30 | ||
4477a870 | 31 | #endif /* _URCU_UTILS_H */ |