123456789101112131415161718192021 |
- #ifndef CORE_CHECK_HPP
- #define CORE_CHECK_HPP
- #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
|