Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)
pure.h
Go to the documentation of this file.
1#ifndef RBIMPL_ATTR_PURE_H /*-*-C++-*-vi:se ft=cpp:*/
2#define RBIMPL_ATTR_PURE_H
25#include "ruby/assert.h"
26
28#if RBIMPL_HAS_ATTRIBUTE(pure)
29# define RBIMPL_ATTR_PURE() __attribute__((__pure__))
30#elif RBIMPL_COMPILER_SINCE(SunPro, 5, 10, 0)
31# define RBIMPL_ATTR_PURE() _Pragma("does_not_write_global_data")
32#else
33# define RBIMPL_ATTR_PURE() /* void */
34#endif
35
37#if !RUBY_DEBUG
38# define RBIMPL_ATTR_PURE_UNLESS_DEBUG() RBIMPL_ATTR_PURE()
39#else
40# define RBIMPL_ATTR_PURE_UNLESS_DEBUG() /* void */
41#endif
42
43#endif /* RBIMPL_ATTR_PURE_H */
Defines RBIMPL_HAS_ATTRIBUTE.
Defines RBIMPL_COMPILER_SINCE.