1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* configure.in (__builtin_unreachable): check for clang.

[ruby-core:42849]
* include/ruby/ruby.h (UNREACHABLE): fallback definition.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2012-02-24 06:49:09 +00:00
parent 0d1c8fd9d6
commit d573446841
3 changed files with 20 additions and 0 deletions

View file

@ -1,3 +1,10 @@
Fri Feb 24 15:49:07 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (__builtin_unreachable): check for clang.
[ruby-core:42849]
* include/ruby/ruby.h (UNREACHABLE): fallback definition.
Fri Feb 24 13:54:33 2012 Aaron Patterson <aaron@tenderlovemaking.com> Fri Feb 24 13:54:33 2012 Aaron Patterson <aaron@tenderlovemaking.com>
* ext/psych/parser.c: prevent a memory leak by protecting calls to * ext/psych/parser.c: prevent a memory leak by protecting calls to

View file

@ -908,6 +908,16 @@ if test "$GCC" = yes; then
if test "$rb_cv_gcc_atomic_builtins" = yes; then if test "$rb_cv_gcc_atomic_builtins" = yes; then
AC_DEFINE(HAVE_GCC_ATOMIC_BUILTINS) AC_DEFINE(HAVE_GCC_ATOMIC_BUILTINS)
fi fi
AC_CACHE_CHECK(for __builtin_unreachable, rb_cv_func___builtin_unreachable,
[AC_TRY_LINK([@%:@include <stdlib.h>],
[exit(0); __builtin_unreachable();],
[rb_cv_func___builtin_unreachable=yes],
[rb_cv_func___builtin_unreachable=no])
])
if test "$rb_cv_func___builtin_unreachable" = yes; then
AC_DEFINE_UNQUOTED(UNREACHABLE, [__builtin_unreachable()])
fi
fi fi
AC_CACHE_CHECK(for exported function attribute, rb_cv_func_exported, [ AC_CACHE_CHECK(for exported function attribute, rb_cv_func_exported, [

View file

@ -36,6 +36,9 @@ extern "C" {
#ifndef NOINLINE #ifndef NOINLINE
# define NOINLINE(x) x # define NOINLINE(x) x
#endif #endif
#ifndef UNREACHABLE
# define UNREACHABLE /* unreachable */
#endif
#ifdef __GNUC__ #ifdef __GNUC__
#define PRINTF_ARGS(decl, string_index, first_to_check) \ #define PRINTF_ARGS(decl, string_index, first_to_check) \