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