Ruby  3.4.0dev (2024-11-22 revision 0989400a925cd201defdca9eb28eb87200b30785)
nodiscard.h
Go to the documentation of this file.
1 #ifndef RBIMPL_ATTR_NODISCARD_H /*-*-C++-*-vi:se ft=cpp:*/
2 #define RBIMPL_ATTR_NODISCARD_H
26 
32 #if RBIMPL_HAS_CPP_ATTRIBUTE(nodiscard)
33 # define RBIMPL_ATTR_NODISCARD() [[nodiscard]]
34 #elif RBIMPL_HAS_C_ATTRIBUTE(nodiscard)
35 # define RBIMPL_ATTR_NODISCARD() [[nodiscard]]
36 #elif RBIMPL_HAS_ATTRIBUTE(warn_unused_result)
37 # define RBIMPL_ATTR_NODISCARD() __attribute__((__warn_unused_result__))
38 #elif defined(_Check_return_)
39 # /* Take SAL definition. */
40 # define RBIMPL_ATTR_NODISCARD() _Check_return_
41 #else
42 # define RBIMPL_ATTR_NODISCARD() /* void */
43 #endif
44 
45 #endif /* RBIMPL_ATTR_NODISCARD_H */
Defines RBIMPL_HAS_ATTRIBUTE.
Defines RBIMPL_HAS_C_ATTRIBUTE.
Defines RBIMPL_HAS_CPP_ATTRIBUTE.