Ruby 3.5.0dev (2025-02-20 revision 34098b669c0cbc024cd08e686891f1dfe0a10aaf)
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.