Ruby 4.1.0dev (2026-11-22 revision bf888872d4bc1a58f211c333e22b3be3f30c2c0a)
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