Ruby: include/ruby/internal/attr/maybe_unused.h Source File

Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)

maybe_unused.h
Go to the documentation of this file.
1#ifndef RBIMPL_ATTR_MAYBE_UNUSED_H /*-*-C++-*-vi:se ft=cpp:*/
2#define RBIMPL_ATTR_MAYBE_UNUSED_H
23#include "ruby/internal/has/attribute.h"
24#include "ruby/internal/has/c_attribute.h"
25#include "ruby/internal/has/cpp_attribute.h"
26
28#if RBIMPL_HAS_CPP_ATTRIBUTE(maybe_unused)
29# define RBIMPL_ATTR_MAYBE_UNUSED() [[maybe_unused]]
30#elif RBIMPL_HAS_C_ATTRIBUTE(maybe_unused)
31# define RBIMPL_ATTR_MAYBE_UNUSED() [[maybe_unused]]
32#elif RBIMPL_HAS_ATTRIBUTE(unused)
33# define RBIMPL_ATTR_MAYBE_UNUSED() __attribute__((__unused__))
34#else
35# define RBIMPL_ATTR_MAYBE_UNUSED() /* void */
36#endif
37
38#endif /* RBIMPL_ATTR_MAYBE_UNUSED */
attribute.h
Defines RBIMPL_HAS_ATTRIBUTE.
c_attribute.h
Defines RBIMPL_HAS_C_ATTRIBUTE.
cpp_attribute.h
Defines RBIMPL_HAS_CPP_ATTRIBUTE.