Ruby  3.4.0dev (2024-12-06 revision 892c46283a5ea4179500d951c9d4866c0051f27b)
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.