diff options
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/aplwc.h | 2 | ||||
| -rw-r--r-- | src/include/aplwc_macros.h | 20 |
2 files changed, 21 insertions, 1 deletions
diff --git a/src/include/aplwc.h b/src/include/aplwc.h index 9905411..d4d101c 100644 --- a/src/include/aplwc.h +++ b/src/include/aplwc.h @@ -14,7 +14,7 @@ enum aplwc_rc { struct aplwc; enum aplwc_rc aplwc_new(struct aplwc **, uint8_t *, size_t); -enum aplwc_rc aplwc_destroy(struct aplwc *); +void aplwc_destroy(struct aplwc *); const char *aplwc_errstr_rc(enum aplwc_rc); const char *aplwc_errstr(struct aplwc *); diff --git a/src/include/aplwc_macros.h b/src/include/aplwc_macros.h new file mode 100644 index 0000000..cf05803 --- /dev/null +++ b/src/include/aplwc_macros.h @@ -0,0 +1,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 */ |