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

Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)

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
23#include "ruby/internal/has/attribute.h"
24#include "ruby/internal/has/cpp_attribute.h"
25#include "ruby/internal/has/declspec_attribute.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 */
attribute.h
Defines RBIMPL_HAS_ATTRIBUTE.
cpp_attribute.h
Defines RBIMPL_HAS_CPP_ATTRIBUTE.
declspec_attribute.h
Defines RBIMPL_HAS_DECLSPEC_ATTRIBUTE.