mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
more support for NORETURN
Before this NORETURN was checked only for __attribute__ or __declspec, but nowadays other ways are there to tell compilers that a function never returns. Take them into account. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61831 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
df9a70900a
commit
8f745a2fab
1 changed files with 11 additions and 4 deletions
|
@ -29,10 +29,6 @@ extern "C" {
|
||||||
#ifndef PUREFUNC
|
#ifndef PUREFUNC
|
||||||
# define PUREFUNC(x) x
|
# define PUREFUNC(x) x
|
||||||
#endif
|
#endif
|
||||||
#define NORETURN_STYLE_NEW 1
|
|
||||||
#ifndef NORETURN
|
|
||||||
# define NORETURN(x) x
|
|
||||||
#endif
|
|
||||||
#ifndef DEPRECATED
|
#ifndef DEPRECATED
|
||||||
# define DEPRECATED(x) x
|
# define DEPRECATED(x) x
|
||||||
#endif
|
#endif
|
||||||
|
@ -390,6 +386,17 @@ void rb_ia64_flushrs(void);
|
||||||
#define RUBY_ALIGNOF(x) ((size_t)offsetof(struct { char f1; type f2; }, f2))
|
#define RUBY_ALIGNOF(x) ((size_t)offsetof(struct { char f1; type f2; }, f2))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define NORETURN_STYLE_NEW 1
|
||||||
|
#ifdef NORETURN
|
||||||
|
/* OK, take that definition */
|
||||||
|
#elif defined(__cplusplus) && (__cplusplus >= 201103L)
|
||||||
|
#define NORETURN(x) [[ noreturn ]] x
|
||||||
|
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)
|
||||||
|
#define NORETURN(x) _Noreturn x
|
||||||
|
#else
|
||||||
|
#define NORETURN(x) x
|
||||||
|
#endif
|
||||||
|
|
||||||
RUBY_SYMBOL_EXPORT_END
|
RUBY_SYMBOL_EXPORT_END
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue