From d748f5b6ebde523f1a2f380dd8c2a7750d8c5e82 Mon Sep 17 00:00:00 2001 From: naruse Date: Wed, 2 Oct 2013 06:50:47 +0000 Subject: * 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 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43116 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 8 ++++++++ vm_core.h | 6 +++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 086e8801d2..b84c8e5254 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Wed Oct 2 15:39:13 2013 NARUSE, Yui + + * 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 * io.c (rb_io_close_write): detach tied IO for writing before closing diff --git a/vm_core.h b/vm_core.h index 8ebd390532..39843093f3 100644 --- a/vm_core.h +++ b/vm_core.h @@ -109,7 +109,11 @@ #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 -- cgit v1.2.3