Ruby 4.1.0dev (2026-09-07 revision 81495e113f3cba5b95e5a25392473c8240b91935)
nodiscard.h
Go to the documentation of this file.
1
4#ifndef PRISM_COMPILER_NODISCARD_H
5#define PRISM_COMPILER_NODISCARD_H
6
12#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L
13# define PRISM_NODISCARD [[nodiscard]]
14#elif defined(__GNUC__) || defined(__clang__)
15# define PRISM_NODISCARD __attribute__((__warn_unused_result__))
16#elif defined(_MSC_VER)
17# define PRISM_NODISCARD _Check_return_
18#else
19# define PRISM_NODISCARD
20#endif
21
22#endif