1 /* SPDX-License-Identifier: GPL-2.0-or-later 2 * Copyright (c) 2017 Cyril Hrubis <chrubis@suse.cz> 3 */ 4 5 #ifndef TST_MINMAX_H__ 6 #define TST_MINMAX_H__ 7 8 #ifndef MIN 9 # define MIN(a, b) ({ \ 10 typeof(a) _a = (a); \ 11 typeof(b) _b = (b); \ 12 _a < _b ? _a : _b; \ 13 }) 14 #endif /* MIN */ 15 16 #ifndef MAX 17 # define MAX(a, b) ({ \ 18 typeof(a) _a = (a); \ 19 typeof(b) _b = (b); \ 20 _a > _b ? _a : _b; \ 21 }) 22 #endif /* MAX */ 23 24 #endif /* TST_MINMAX_H__ */ 25