summaryrefslogtreecommitdiff
path: root/src/include/aplwc_macros.h
blob: cf058039027ddb93ce00335b6b53766100f30630 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#ifndef APLWC_MACROS_H
#define APLWC_MACROS_H

#define UNUSED_PARAMETER(arg) ((void)arg)

#define NELEM(x) (sizeof(x)/sizeof(x[0]))

#if APLWC_BUILD_TYPE_DEBUG
 #define ALWAYS(x) ((x) ? 1 : (assert(0), 0))
 #define NEVER(x)  ((x) ? (assert(0), 1) : 0)
#elif APLWC_BUILD_TYPE_RELEASE
 #define ALWAYS(x) (X)
 #define NEVER(X)  (X)
#elif APLWC_BUILD_TYPE_COVERAGE
 #define ALWAYS(x) (1)
 #define NEVER(x)  (0)
#endif


#endif /* APLWC_MACROS_H */