#ifndef CORE_CHECK_H
#define CORE_CHECK_H

#if defined(__cplusplus) && __cplusplus > 201700L
#define check_return [[nodiscard]]
#elif defined(__STDC_VERSION__) && __STDC_VERSION__ > 202300L
#define check_return [[nodiscard]]
#elif defined(__GNUC__)
#define check_return __attribute__((warn_unused_result))
#else
#error "please add a 'check_return' option"
#endif

#if defined(__GNUC__)
#define check_format(format_index, arg_start_index)                            \
    __attribute__((format(printf, format_index, arg_start_index)))
#else
#error "please add a 'check_format' option"
#endif

#endif