ruby-changes:62667
From: =E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3 <ko1@a...>
Date: Fri, 21 Aug 2020 11:05:16 +0900 (JST)
Subject: [ruby-changes:62667] 01826b3fda (master): RBIMPL_HAS_CPP_ATTRIBUTE: handle SunPro
https://git.ruby-lang.org/ruby.git/commit/?id=01826b3fda From 01826b3fda53a98d8fe57e698be52143e1fef2d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?= <shyouhei@r...> Date: Wed, 19 Aug 2020 16:18:59 +0900 Subject: RBIMPL_HAS_CPP_ATTRIBUTE: handle SunPro Oracle Developer Studio's C++ preprocessor started to understand __has_cpp_attribute since version 12.5, and is broken. After looking around for a while I found Boost and ICU also had this issue before. Let me add workaround for it. diff --git a/include/ruby/internal/has/cpp_attribute.h b/include/ruby/internal/has/cpp_attribute.h index 9c12765..255f611 100644 --- a/include/ruby/internal/has/cpp_attribute.h +++ b/include/ruby/internal/has/cpp_attribute.h @@ -25,7 +25,16 @@ https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/has/cpp_attribute.h#L25 #include "ruby/internal/token_paste.h" /** @cond INTERNAL_MACRO */ -#if defined(__has_cpp_attribute) +#if RBIMPL_COMPILER_IS(SunPro) +# /* Oracle Developer Studio 12.5's C++ preprocessor is reportedly broken. We +# * could simulate __has_cpp_attribute like below, but don't know the exact +# * list of which version supported which attribute. Just kill everything for +# * now. If you can please :FIXME: */ +# /* https://unicode-org.atlassian.net/browse/ICU-12893 */ +# /* https://github.com/boostorg/config/pull/95 */ +# define RBIMPL_HAS_CPP_ATTRIBUTE0(_) 0 + +#elif defined(__has_cpp_attribute) # define RBIMPL_HAS_CPP_ATTRIBUTE0(_) __has_cpp_attribute(_) #elif RBIMPL_COMPILER_IS(MSVC) @@ -60,7 +69,6 @@ https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/has/cpp_attribute.h#L69 # /* :FIXME: # * Candidate compilers to list here: # * - icpc: They have __INTEL_CXX11_MODE__. -# * - SunPro: Seems they support C++11. # */ # define RBIMPL_HAS_CPP_ATTRIBUTE0(_) 0 #endif -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/