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

ruby-changes:31037

From: naruse <ko1@a...>
Date: Wed, 2 Oct 2013 15:50:54 +0900 (JST)
Subject: [ruby-changes:31037] naruse:r43116 (trunk): * vm_core.h: use __has_attribute() instead of __clang__major__ because

naruse	2013-10-02 15:50:47 +0900 (Wed, 02 Oct 2013)

  New Revision: 43116

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

  Log:
    * vm_core.h: use __has_attribute() instead of __clang__major__ because
      clang says "Note that marketing version numbers should not be used
      to check for language features, as different vendors use different
      numbering schemes. Instead, use the Feature Checking Macros."
      http://clang.llvm.org/docs/LanguageExtensions.html

  Modified files:
    trunk/ChangeLog
    trunk/vm_core.h
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 43115)
+++ ChangeLog	(revision 43116)
@@ -1,3 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed Oct  2 15:39:13 2013  NARUSE, Yui  <naruse@r...>
+
+	* vm_core.h: use __has_attribute() instead of __clang__major__ because
+	  clang says "Note that marketing version numbers should not be used
+	  to check for language features, as different vendors use different
+	  numbering schemes. Instead, use the Feature Checking Macros."
+	  http://clang.llvm.org/docs/LanguageExtensions.html
+
 Wed Oct  2 14:19:57 2013  Nobuyoshi Nakada  <nobu@r...>
 
 	* io.c (rb_io_close_write): detach tied IO for writing before closing
Index: vm_core.h
===================================================================
--- vm_core.h	(revision 43115)
+++ vm_core.h	(revision 43116)
@@ -109,7 +109,11 @@ https://github.com/ruby/ruby/blob/trunk/vm_core.h#L109
 #define UNLIKELY(x) (x)
 #endif /* __GNUC__ >= 3 */
 
-#if (defined(__clang__) && __clang_major__ >= 4)
+#ifndef __has_attribute
+# define __has_attribute(x) 0
+#endif
+
+#if __has_attribute(unused)
 #define UNINITIALIZED_VAR(x) x __attribute__((unused))
 #elif defined(__GNUC__) && __GNUC__ >= 3
 #define UNINITIALIZED_VAR(x) x = x

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

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