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

Ruby 3.4.1p0 (2024-12-25 revision 48d4efcb85000e1ebae42004e963b5d0cedddcf2)

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
23#include "ruby/internal/compiler_since.h"
24#include "ruby/internal/has/attribute.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 */
assert.h
attribute.h
Defines RBIMPL_HAS_ATTRIBUTE.
compiler_since.h
Defines RBIMPL_COMPILER_SINCE.