19 lines
537 B
C
19 lines
537 B
C
#ifndef COMMON_MAYBE_UNUSED_H
|
|
#define COMMON_MAYBE_UNUSED_H
|
|
|
|
#include "common/linked.h"
|
|
|
|
#if defined __STDC__ && __STDC__ == 1 && defined __STDC_VERSION__ \
|
|
&& __STDC_VERSION__ >= 202311L
|
|
#define MAYBE_UNUSED [[maybe_unused]]
|
|
#warning "MAYBE_UNUSED macro can be replaced by C23 [[maybe_unused]]"
|
|
#elif defined __clang__ || defined __GNUC__
|
|
#define MAYBE_UNUSED __attribute__((unused))
|
|
#elif defined _MSC_VER
|
|
#define MAYBE_UNUSED __pragma(warning(suppress : 4505))
|
|
#else
|
|
#warning "cannot define MAYBE_UNUSED"
|
|
#endif
|
|
|
|
#endif
|