Ruby 3.5.0dev (2025-04-04 revision cd8c203ffb50fe41852f90936b701b97a0fa77e7)
noreturn.h
Go to the documentation of this file.
1#ifndef RBIMPL_ATTR_NORETURN_H /*-*-C++-*-vi:se ft=cpp:*/
2#define RBIMPL_ATTR_NORETURN_H
26
28#if RBIMPL_HAS_DECLSPEC_ATTRIBUTE(noreturn)
29# define RBIMPL_ATTR_NORETURN() __declspec(noreturn)
30
31#elif RBIMPL_HAS_ATTRIBUTE(noreturn)
32# define RBIMPL_ATTR_NORETURN() __attribute__((__noreturn__))
33
34#elif RBIMPL_HAS_CPP_ATTRIBUTE(noreturn)
35# define RBIMPL_ATTR_NORETURN() [[noreturn]]
36
37#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112)
38# define RBIMPL_ATTR_NORETURN() _Noreturn
39
40#elif defined(_Noreturn)
41# /* glibc <sys/cdefs.h> has this macro. */
42# define RBIMPL_ATTR_NORETURN() _Noreturn
43
44#else
45# define RBIMPL_ATTR_NORETURN() /* void */
46#endif
47
48#endif /* RBIMPL_ATTR_NORETURN_H */
Defines RBIMPL_HAS_ATTRIBUTE.
Defines RBIMPL_HAS_CPP_ATTRIBUTE.
Defines RBIMPL_HAS_DECLSPEC_ATTRIBUTE.