aboutsummaryrefslogtreecommitdiff
path: root/src/utils/compilers.h
blob: a2ae3ba61feab12a5db8e1a68989971d48341638 (plain)
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
#ifndef UTILS_COMPILERS_H
#define UTILS_COMPILERS_H

#if defined(__GNUC__)

#define UNUSED __attribute__((unused))
#define SIZE(x) static (x)
#define NON_NULL SIZE(1)

#elif defined(__clang__)

#define UNUSED __attribute__((unused))
#define SIZE(x) static (x)
#define NON_NULL SIZE(1)

#else

/*
For example MSVC, which is not fully C11 compliant (e.g. it does not support
a[static N] notation for array parameters).
*/

#define UNUSED
#define SIZE(x)
#define NON_NULL

#endif

#endif /* UTILS_COMPILERS_H */

Generated with cgit - Back to sebastiano.tronto.net