Simplify split_args().
[dss.git] / gcc-compat.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #define HAVE_GNUC(maj, min) \
3 defined(__GNUC__) && \
4 (__GNUC__ > maj || (__GNUC__ == maj && __GNUC_MINOR__ >= min))
5
6 #if HAVE_GNUC(3,0)
7 # define __malloc __attribute__ ((malloc))
8 #else
9 # define __malloc
10 #endif
11
12 /*
13 * p is the number of the "format string" parameter, and q is
14 * the number of the first variadic parameter
15 */
16 #if HAVE_GNUC(2,3)
17 # define __printf(p,q) __attribute__ ((format (printf, p, q)))
18 #else
19 # define __printf(p,q)
20 #endif
21
22 #define __printf_1_2 __printf(1,2)
23
24 #if HAVE_GNUC(3,3)
25 # define __must_check __attribute__ ((warn_unused_result))
26 #else
27 # define __must_check /* no warn_unused_result */
28 #endif