[前][次][番号順一覧][スレッド一覧]

ruby-changes:22735

From: nobu <ko1@a...>
Date: Fri, 24 Feb 2012 15:49:21 +0900 (JST)
Subject: [ruby-changes:22735] nobu:r34784 (trunk): * configure.in (__builtin_unreachable): check for clang.

nobu	2012-02-24 15:49:09 +0900 (Fri, 24 Feb 2012)

  New Revision: 34784

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=34784

  Log:
    * configure.in (__builtin_unreachable): check for clang.
      [ruby-core:42849]
    * include/ruby/ruby.h (UNREACHABLE): fallback definition.

  Modified files:
    trunk/ChangeLog
    trunk/configure.in
    trunk/include/ruby/ruby.h

Index: include/ruby/ruby.h
===================================================================
--- include/ruby/ruby.h	(revision 34783)
+++ include/ruby/ruby.h	(revision 34784)
@@ -36,6 +36,9 @@
 #ifndef NOINLINE
 # define NOINLINE(x) x
 #endif
+#ifndef UNREACHABLE
+# define UNREACHABLE		/* unreachable */
+#endif
 
 #ifdef __GNUC__
 #define PRINTF_ARGS(decl, string_index, first_to_check) \
Index: configure.in
===================================================================
--- configure.in	(revision 34783)
+++ configure.in	(revision 34784)
@@ -908,6 +908,16 @@
     if test "$rb_cv_gcc_atomic_builtins" = yes; then
 	AC_DEFINE(HAVE_GCC_ATOMIC_BUILTINS)
     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
 
 AC_CACHE_CHECK(for exported function attribute, rb_cv_func_exported, [
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 34783)
+++ ChangeLog	(revision 34784)
@@ -1,3 +1,10 @@
+Fri Feb 24 15:49:07 2012  Nobuyoshi Nakada  <nobu@r...>
+
+	* 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@t...>
 
 	* ext/psych/parser.c: prevent a memory leak by protecting calls to

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]