diff options
Diffstat (limited to 'include/ruby/3/has')
| -rw-r--r-- | include/ruby/3/has/attribute.h | 152 | ||||
| -rw-r--r-- | include/ruby/3/has/builtin.h | 91 | ||||
| -rw-r--r-- | include/ruby/3/has/c_attribute.h | 37 | ||||
| -rw-r--r-- | include/ruby/3/has/cpp_attribute.h | 80 | ||||
| -rw-r--r-- | include/ruby/3/has/declspec_attribute.h | 46 | ||||
| -rw-r--r-- | include/ruby/3/has/extension.h | 33 | ||||
| -rw-r--r-- | include/ruby/3/has/feature.h | 31 | ||||
| -rw-r--r-- | include/ruby/3/has/warning.h | 31 |
8 files changed, 0 insertions, 501 deletions
diff --git a/include/ruby/3/has/attribute.h b/include/ruby/3/has/attribute.h deleted file mode 100644 index 36a1a1229c..0000000000 --- a/include/ruby/3/has/attribute.h +++ /dev/null @@ -1,152 +0,0 @@ -/** \noop-*-C++-*-vi:ft=cpp - * @file - * @author Ruby developers <ruby-core@ruby-lang.org> - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @warning Symbols prefixed with either `RUBY3` or `ruby3` are - * implementation details. Don't take them as canon. They could - * rapidly appear then vanish. The name (path) of this header file - * is also an implementation detail. Do not expect it to persist - * at the place it is now. Developers are free to move it anywhere - * anytime at will. - * @note To ruby-core: remember that this header can be possibly - * recursively included from extension libraries written in C++. - * Do not expect for instance `__VA_ARGS__` is always available. - * We assume C99 for ruby itself but we don't assume languages of - * extension libraries. They could be written in C++98. - * @brief Defines #RUBY3_HAS_ATTRIBUTE. - */ -#include "ruby/3/config.h" - -/** Wraps (or simulates) `__has_attribute`. */ -#if defined(RUBY3_HAS_ATTRIBUTE) -# /* Take that. */ - -#elif defined(__has_attribute) -# define RUBY3_HAS_ATTRIBUTE(_) __has_attribute(_) - -#elif RUBY3_COMPILER_IS(GCC) -# /* GCC <= 4 lack __has_attribute predefined macro, while have attributes -# * themselves. We can simulate the macro like the following: */ -# define RUBY3_HAS_ATTRIBUTE(_) RUBY3_TOKEN_PASTE(RUBY3_HAS_ATTRIBUTE_, _) -# define RUBY3_HAS_ATTRIBUTE_aligned RUBY3_COMPILER_SINCE(GCC, 0, 0, 0) -# define RUBY3_HAS_ATTRIBUTE_alloc_size RUBY3_COMPILER_SINCE(GCC, 4, 3, 0) -# define RUBY3_HAS_ATTRIBUTE_artificial RUBY3_COMPILER_SINCE(GCC, 4, 3, 0) -# define RUBY3_HAS_ATTRIBUTE_always_inline RUBY3_COMPILER_SINCE(GCC, 3, 1, 0) -# define RUBY3_HAS_ATTRIBUTE_cdecl RUBY3_COMPILER_SINCE(GCC, 0, 0, 0) -# define RUBY3_HAS_ATTRIBUTE_cold RUBY3_COMPILER_SINCE(GCC, 4, 3, 0) -# define RUBY3_HAS_ATTRIBUTE_const RUBY3_COMPILER_SINCE(GCC, 2, 6, 0) -# define RUBY3_HAS_ATTRIBUTE_deprecated RUBY3_COMPILER_SINCE(GCC, 3, 1, 0) -# define RUBY3_HAS_ATTRIBUTE_dllexport RUBY3_COMPILER_SINCE(GCC, 0, 0, 0) -# define RUBY3_HAS_ATTRIBUTE_dllimport RUBY3_COMPILER_SINCE(GCC, 0, 0, 0) -# define RUBY3_HAS_ATTRIBUTE_error RUBY3_COMPILER_SINCE(GCC, 4, 3, 0) -# define RUBY3_HAS_ATTRIBUTE_format RUBY3_COMPILER_SINCE(GCC, 0, 0, 0) -# define RUBY3_HAS_ATTRIBUTE_hot RUBY3_COMPILER_SINCE(GCC, 4, 3, 0) -# define RUBY3_HAS_ATTRIBUTE_leaf RUBY3_COMPILER_SINCE(GCC, 4, 6, 0) -# define RUBY3_HAS_ATTRIBUTE_malloc RUBY3_COMPILER_SINCE(GCC, 3, 0, 0) -# define RUBY3_HAS_ATTRIBUTE_no_address_safety_analysis RUBY3_COMPILER_SINCE(GCC, 4, 8, 0) -# define RUBY3_HAS_ATTRIBUTE_no_sanitize_address RUBY3_COMPILER_SINCE(GCC, 4, 8, 0) -# define RUBY3_HAS_ATTRIBUTE_no_sanitize_undefined RUBY3_COMPILER_SINCE(GCC, 4, 9, 0) -# define RUBY3_HAS_ATTRIBUTE_noinline RUBY3_COMPILER_SINCE(GCC, 3, 1, 0) -# define RUBY3_HAS_ATTRIBUTE_nonnull RUBY3_COMPILER_SINCE(GCC, 3, 3, 0) -# define RUBY3_HAS_ATTRIBUTE_noreturn RUBY3_COMPILER_SINCE(GCC, 2, 5, 0) -# define RUBY3_HAS_ATTRIBUTE_nothrow RUBY3_COMPILER_SINCE(GCC, 3, 3, 0) -# define RUBY3_HAS_ATTRIBUTE_pure RUBY3_COMPILER_SINCE(GCC, 2,96, 0) -# define RUBY3_HAS_ATTRIBUTE_returns_nonnull RUBY3_COMPILER_SINCE(GCC, 4, 9, 0) -# define RUBY3_HAS_ATTRIBUTE_returns_twice RUBY3_COMPILER_SINCE(GCC, 4, 1, 0) -# define RUBY3_HAS_ATTRIBUTE_stdcall RUBY3_COMPILER_SINCE(GCC, 0, 0, 0) -# define RUBY3_HAS_ATTRIBUTE_unused RUBY3_COMPILER_SINCE(GCC, 0, 0, 0) -# define RUBY3_HAS_ATTRIBUTE_visibility RUBY3_COMPILER_SINCE(GCC, 3, 3, 0) -# define RUBY3_HAS_ATTRIBUTE_warn_unused_result RUBY3_COMPILER_SINCE(GCC, 3, 4, 0) -# define RUBY3_HAS_ATTRIBUTE_warning RUBY3_COMPILER_SINCE(GCC, 4, 3, 0) -# define RUBY3_HAS_ATTRIBUTE_weak RUBY3_COMPILER_SINCE(GCC, 0, 0, 0) -# /* Note that "0, 0, 0" might be inaccurate. */ - -#elif RUBY3_COMPILER_IS(SunPro) -# /* Oracle Solaris Studio 12.4 (cc version 5.11) introduced __has_attribute. -# * Before that, following attributes were available. */ -# /* See https://docs.oracle.com/cd/F24633_01/index.html */ -# define RUBY3_HAS_ATTRIBUTE(_) RUBY3_TOKEN_PASTE(RUBY3_HAS_ATTRIBUTE_, _) -# define RUBY3_HAS_ATTRIBUTE_alias RUBY3_COMPILER_SINCE(SunPro, 5, 9, 0) -# define RUBY3_HAS_ATTRIBUTE_aligned RUBY3_COMPILER_SINCE(SunPro, 5, 9, 0) -# define RUBY3_HAS_ATTRIBUTE_always_inline RUBY3_COMPILER_SINCE(SunPro, 5, 10, 0) -# define RUBY3_HAS_ATTRIBUTE_const RUBY3_COMPILER_SINCE(SunPro, 5, 9, 0) -# define RUBY3_HAS_ATTRIBUTE_constructor RUBY3_COMPILER_SINCE(SunPro, 5, 9, 0) -# define RUBY3_HAS_ATTRIBUTE_destructor RUBY3_COMPILER_SINCE(SunPro, 5, 9, 0) -# define RUBY3_HAS_ATTRIBUTE_malloc RUBY3_COMPILER_SINCE(SunPro, 5, 9, 0) -# define RUBY3_HAS_ATTRIBUTE_noinline RUBY3_COMPILER_SINCE(SunPro, 5, 9, 0) -# define RUBY3_HAS_ATTRIBUTE_noreturn RUBY3_COMPILER_SINCE(SunPro, 5, 9, 0) -# define RUBY3_HAS_ATTRIBUTE_packed RUBY3_COMPILER_SINCE(SunPro, 5, 9, 0) -# define RUBY3_HAS_ATTRIBUTE_pure RUBY3_COMPILER_SINCE(SunPro, 5, 9, 0) -# define RUBY3_HAS_ATTRIBUTE_returns_twice RUBY3_COMPILER_SINCE(SunPro, 5, 10, 0) -# define RUBY3_HAS_ATTRIBUTE_vector_size RUBY3_COMPILER_SINCE(SunPro, 5, 10, 0) -# define RUBY3_HAS_ATTRIBUTE_visibility RUBY3_COMPILER_SINCE(SunPro, 5, 9, 0) -# define RUBY3_HAS_ATTRIBUTE_weak RUBY3_COMPILER_SINCE(SunPro, 5, 9, 0) - -#elif defined (_MSC_VER) -# define RUBY3_HAS_ATTRIBUTE(_) 0 -# /* Fallback below doesn't work: see win32/Makefile.sub */ - -#else -# /* Take config.h definition when available. */ -# define RUBY3_HAS_ATTRIBUTE(_) (RUBY3_TOKEN_PASTE(RUBY3_HAS_ATTRIBUTE_, _)+0) -# ifdef ALWAYS_INLINE -# define RUBY3_HAS_ATTRIBUTE_always_inline 1 -# endif -# ifdef FUNC_CDECL -# define RUBY3_HAS_ATTRIBUTE_cdecl 1 -# endif -# ifdef CONSTFUNC -# define RUBY3_HAS_ATTRIBUTE_const 1 -# endif -# ifdef DEPRECATED -# define RUBY3_HAS_ATTRIBUTE_deprecated 1 -# endif -# ifdef ERRORFUNC -# define RUBY3_HAS_ATTRIBUTE_error 1 -# endif -# ifdef FUNC_FASTCALL -# define RUBY3_HAS_ATTRIBUTE_fastcall 1 -# endif -# ifdef PUREFUNC -# define RUBY3_HAS_ATTRIBUTE_pure 1 -# endif -# ifdef NO_ADDRESS_SAFETY_ANALYSIS -# define RUBY3_HAS_ATTRIBUTE_no_address_safety_analysis 1 -# endif -# ifdef NO_SANITIZE -# define RUBY3_HAS_ATTRIBUTE_no_sanitize 1 -# endif -# ifdef NO_SANITIZE_ADDRESS -# define RUBY3_HAS_ATTRIBUTE_no_sanitize_address 1 -# endif -# ifdef NOINLINE -# define RUBY3_HAS_ATTRIBUTE_noinline 1 -# endif -# ifdef RUBY3_FUNC_NONNULL -# define RUBY3_HAS_ATTRIBUTE_nonnull 1 -# endif -# ifdef NORETURN -# define RUBY3_HAS_ATTRIBUTE_noreturn 1 -# endif -# ifdef FUNC_OPTIMIZED -# define RUBY3_HAS_ATTRIBUTE_optimize 1 -# endif -# ifdef FUNC_STDCALL -# define RUBY3_HAS_ATTRIBUTE_stdcall 1 -# endif -# ifdef MAYBE_UNUSED -# define RUBY3_HAS_ATTRIBUTE_unused 1 -# endif -# ifdef WARN_UNUSED_RESULT -# define RUBY3_HAS_ATTRIBUTE_warn_unused_result 1 -# endif -# ifdef WARNINGFUNC -# define RUBY3_HAS_ATTRIBUTE_warning 1 -# endif -# ifdef WEAK -# define RUBY3_HAS_ATTRIBUTE_weak 1 -# endif -#endif diff --git a/include/ruby/3/has/builtin.h b/include/ruby/3/has/builtin.h deleted file mode 100644 index 54dc2a5672..0000000000 --- a/include/ruby/3/has/builtin.h +++ /dev/null @@ -1,91 +0,0 @@ -/** \noop-*-C++-*-vi:ft=cpp - * @file - * @author Ruby developers <ruby-core@ruby-lang.org> - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @warning Symbols prefixed with either `RUBY3` or `ruby3` are - * implementation details. Don't take them as canon. They could - * rapidly appear then vanish. The name (path) of this header file - * is also an implementation detail. Do not expect it to persist - * at the place it is now. Developers are free to move it anywhere - * anytime at will. - * @note To ruby-core: remember that this header can be possibly - * recursively included from extension libraries written in C++. - * Do not expect for instance `__VA_ARGS__` is always available. - * We assume C99 for ruby itself but we don't assume languages of - * extension libraries. They could be written in C++98. - * @brief Defines #RUBY3_HAS_BUILTIN. - */ -#include "ruby/3/config.h" - -/** Wraps (or simulates) `__has_builtin`. */ -#if defined(RUBY3_HAS_BUILTIN) -# /* Take that. */ - -#elif defined(__has_builtin) && ! RUBY3_COMPILER_IS(Intel) -# /* :TODO: Intel C Compiler has __has_builtin (since 19.1 maybe?), and is -# * reportedly broken. We have to skip them. However the situation can -# * change. They might improve someday. We need to revisit here later. */ -# define RUBY3_HAS_BUILTIN(_) __has_builtin(_) - -#elif RUBY3_COMPILER_IS(GCC) -# /* :FIXME: Historically GCC has had tons of builtins, but it implemented -# * __has_builtin only since GCC 10. This section can be made more -# * granular. */ -# /* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66970 */ -# define RUBY3_HAS_BUILTIN(_) RUBY3_TOKEN_PASTE(RUBY3_HAS_BUILTIN_, _) -# define RUBY3_HAS_BUILTIN___builtin_add_overflow RUBY3_COMPILER_SINCE(GCC, 5, 1, 0) -# define RUBY3_HAS_BUILTIN___builtin_alloca RUBY3_COMPILER_SINCE(GCC, 0, 0, 0) -# define RUBY3_HAS_BUILTIN___builtin_alloca_with_align RUBY3_COMPILER_SINCE(GCC, 6, 1, 0) -# /* See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52624 for bswap16. */ -# define RUBY3_HAS_BUILTIN___builtin_bswap16 RUBY3_COMPILER_SINCE(GCC, 4, 8, 0) -# define RUBY3_HAS_BUILTIN___builtin_bswap32 RUBY3_COMPILER_SINCE(GCC, 3, 6, 0) -# define RUBY3_HAS_BUILTIN___builtin_bswap64 RUBY3_COMPILER_SINCE(GCC, 3, 6, 0) -# define RUBY3_HAS_BUILTIN___builtin_clz RUBY3_COMPILER_SINCE(GCC, 3, 6, 0) -# define RUBY3_HAS_BUILTIN___builtin_clzl RUBY3_COMPILER_SINCE(GCC, 3, 6, 0) -# define RUBY3_HAS_BUILTIN___builtin_clzll RUBY3_COMPILER_SINCE(GCC, 3, 6, 0) -# define RUBY3_HAS_BUILTIN___builtin_constant_p RUBY3_COMPILER_SINCE(GCC, 2,95, 3) -# define RUBY3_HAS_BUILTIN___builtin_ctz RUBY3_COMPILER_SINCE(GCC, 3, 6, 0) -# define RUBY3_HAS_BUILTIN___builtin_ctzl RUBY3_COMPILER_SINCE(GCC, 3, 6, 0) -# define RUBY3_HAS_BUILTIN___builtin_ctzll RUBY3_COMPILER_SINCE(GCC, 3, 6, 0) -# define RUBY3_HAS_BUILTIN___builtin_expect RUBY3_COMPILER_SINCE(GCC, 3, 0, 0) -# define RUBY3_HAS_BUILTIN___builtin_mul_overflow RUBY3_COMPILER_SINCE(GCC, 5, 1, 0) -# define RUBY3_HAS_BUILTIN___builtin_mul_overflow_p RUBY3_COMPILER_SINCE(GCC, 7, 0, 0) -# define RUBY3_HAS_BUILTIN___builtin_popcount RUBY3_COMPILER_SINCE(GCC, 3, 6, 0) -# define RUBY3_HAS_BUILTIN___builtin_popcountl RUBY3_COMPILER_SINCE(GCC, 3, 6, 0) -# define RUBY3_HAS_BUILTIN___builtin_popcountll RUBY3_COMPILER_SINCE(GCC, 3, 6, 0) -# define RUBY3_HAS_BUILTIN___builtin_sub_overflow RUBY3_COMPILER_SINCE(GCC, 5, 1, 0) -# define RUBY3_HAS_BUILTIN___builtin_unreachable RUBY3_COMPILER_SINCE(GCC, 4, 5, 0) -# /* Note that "0, 0, 0" might be inaccurate. */ - -#elif RUBY3_COMPILER_IS(MSVC) -# /* MSVC has UNREACHABLE, but that is not __builtin_unreachable. */ -# define RUBY3_HAS_BUILTIN(_) 0 - -#else -# /* Take config.h definition when available */ -# define RUBY3_HAS_BUILTIN(_) (RUBY3_TOKEN_PASTE(RUBY3_HAS_BUILTIN_, _)+0) -# define RUBY3_HAS_BUILTIN___builtin_add_overflow HAVE_BUILTIN___BUILTIN_ADD_OVERFLOW -# define RUBY3_HAS_BUILTIN___builtin_alloca_with_align HAVE_BUILTIN___BUILTIN_ALLOCA_WITH_ALIGN -# define RUBY3_HAS_BUILTIN___builtin_assume_aligned HAVE_BUILTIN___BUILTIN_ASSUME_ALIGNED -# define RUBY3_HAS_BUILTIN___builtin_bswap16 HAVE_BUILTIN___BUILTIN_BSWAP16 -# define RUBY3_HAS_BUILTIN___builtin_bswap32 HAVE_BUILTIN___BUILTIN_BSWAP32 -# define RUBY3_HAS_BUILTIN___builtin_bswap64 HAVE_BUILTIN___BUILTIN_BSWAP64 -# define RUBY3_HAS_BUILTIN___builtin_clz HAVE_BUILTIN___BUILTIN_CLZ -# define RUBY3_HAS_BUILTIN___builtin_clzl HAVE_BUILTIN___BUILTIN_CLZL -# define RUBY3_HAS_BUILTIN___builtin_clzll HAVE_BUILTIN___BUILTIN_CLZLL -# define RUBY3_HAS_BUILTIN___builtin_constant_p HAVE_BUILTIN___BUILTIN_CONSTANT_P -# define RUBY3_HAS_BUILTIN___builtin_ctz HAVE_BUILTIN___BUILTIN_CTZ -# define RUBY3_HAS_BUILTIN___builtin_ctzll HAVE_BUILTIN___BUILTIN_CTZLL -# define RUBY3_HAS_BUILTIN___builtin_expect HAVE_BUILTIN___BUILTIN_EXPECT -# define RUBY3_HAS_BUILTIN___builtin_mul_overflow HAVE_BUILTIN___BUILTIN_MUL_OVERFLOW -# define RUBY3_HAS_BUILTIN___builtin_mul_overflow_p HAVE_BUILTIN___BUILTIN_MUL_OVERFLOW_P -# define RUBY3_HAS_BUILTIN___builtin_popcount HAVE_BUILTIN___BUILTIN_POPCOUNT -# define RUBY3_HAS_BUILTIN___builtin_popcountll HAVE_BUILTIN___BUILTIN_POPCOUNTLL -# define RUBY3_HAS_BUILTIN___builtin_sub_overflow HAVE_BUILTIN___BUILTIN_SUB_OVERFLOW -# if defined(UNREACHABLE) -# define RUBY3_HAS_BUILTIN___builtin_unreachable 1 -# endif -#endif diff --git a/include/ruby/3/has/c_attribute.h b/include/ruby/3/has/c_attribute.h deleted file mode 100644 index 89186217d3..0000000000 --- a/include/ruby/3/has/c_attribute.h +++ /dev/null @@ -1,37 +0,0 @@ -/** \noop-*-C++-*-vi:ft=cpp - * @file - * @author Ruby developers <ruby-core@ruby-lang.org> - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @warning Symbols prefixed with either `RUBY3` or `ruby3` are - * implementation details. Don't take them as canon. They could - * rapidly appear then vanish. The name (path) of this header file - * is also an implementation detail. Do not expect it to persist - * at the place it is now. Developers are free to move it anywhere - * anytime at will. - * @note To ruby-core: remember that this header can be possibly - * recursively included from extension libraries written in C++. - * Do not expect for instance `__VA_ARGS__` is always available. - * We assume C99 for ruby itself but we don't assume languages of - * extension libraries. They could be written in C++98. - * @brief Defines #RUBY3_HAS_C_ATTRIBUTE. - */ - -/** Wraps (or simulates) `__has_c_attribute`. */ -#if defined(RUBY3_HAS_C_ATTRIBUTE) -# /* Take that. */ - -#elif defined(__cplusplus) -# /* Makes no sense. */ -# define RUBY3_HAS_C_ATTRIBUTE(_) 0 - -#elif defined(__has_c_attribute) -# define RUBY3_HAS_C_ATTRIBUTE(_) __has_c_attribute(_) - -#else -# /* As of writing everything that lacks __has_c_attribute also completely -# * lacks C2x attributes as well. Might change in future? */ -# define RUBY3_HAS_C_ATTRIBUTE(_) 0 -#endif diff --git a/include/ruby/3/has/cpp_attribute.h b/include/ruby/3/has/cpp_attribute.h deleted file mode 100644 index 70bec4a267..0000000000 --- a/include/ruby/3/has/cpp_attribute.h +++ /dev/null @@ -1,80 +0,0 @@ -/** \noop-*-C++-*-vi:ft=cpp - * @file - * @author Ruby developers <ruby-core@ruby-lang.org> - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @warning Symbols prefixed with either `RUBY3` or `ruby3` are - * implementation details. Don't take them as canon. They could - * rapidly appear then vanish. The name (path) of this header file - * is also an implementation detail. Do not expect it to persist - * at the place it is now. Developers are free to move it anywhere - * anytime at will. - * @note To ruby-core: remember that this header can be possibly - * recursively included from extension libraries written in C++. - * Do not expect for instance `__VA_ARGS__` is always available. - * We assume C99 for ruby itself but we don't assume languages of - * extension libraries. They could be written in C++98. - * @brief Defines #RUBY3_HAS_CPP_ATTRIBUTE. - */ -#include "ruby/3/compiler_is.h" - -/** @cond INTERNAL_MACRO */ -#if defined(RUBY3_HAS_CPP_ATTRIBUTE0) -# /* Take that. */ - -#elif defined(__has_cpp_attribute) -# define RUBY3_HAS_CPP_ATTRIBUTE0(_) __has_cpp_attribute(_) - -#elif RUBY3_COMPILER_IS(MSVC) -# /* MSVC has never updated its __cplusplus since forever (unless specified -# * explicitly by a compiler flag). They also lack __has_cpp_attribute until -# * 2019. However, they do have attributes since 2015 or so. */ -# /* https://docs.microsoft.com/en-us/cpp/overview/visual-cpp-language-conformance */ -# define RUBY3_HAS_CPP_ATTRIBUTE0(_) RUBY3_TOKEN_PASTE(RUBY3_HAS_CPP_ATTRIBUTE_, _) -# define RUBY3_HAS_CPP_ATTRIBUTE_noreturn 200809 * RUBY3_COMPILER_SINCE(MSVC, 19, 00, 0) -# define RUBY3_HAS_CPP_ATTRIBUTE_carries_dependency 200809 * RUBY3_COMPILER_SINCE(MSVC, 19, 00, 0) -# define RUBY3_HAS_CPP_ATTRIBUTE_deprecated 201309 * RUBY3_COMPILER_SINCE(MSVC, 19, 10, 0) -# define RUBY3_HAS_CPP_ATTRIBUTE_fallthrough 201603 * RUBY3_COMPILER_SINCE(MSVC, 19, 10, 0) -# define RUBY3_HAS_CPP_ATTRIBUTE_maybe_unused 201603 * RUBY3_COMPILER_SINCE(MSVC, 19, 11, 0) -# define RUBY3_HAS_CPP_ATTRIBUTE_nodiscard 201603 * RUBY3_COMPILER_SINCE(MSVC, 19, 11, 0) - -#elif RUBY3_COMPILER_BEFORE(Clang, 3, 6, 0) -# /* Clang 3.6.0 introduced __has_cpp_attribute. Prior to that following -# * attributes were already there. */ -# /* https://clang.llvm.org/cxx_status.html */ -# define RUBY3_HAS_CPP_ATTRIBUTE0(_) RUBY3_TOKEN_PASTE(RUBY3_HAS_CPP_ATTRIBUTE_, _) -# define RUBY3_HAS_CPP_ATTRIBUTE_noreturn 200809 * RUBY3_COMPILER_SINCE(Clang, 3, 3, 0) -# define RUBY3_HAS_CPP_ATTRIBUTE_deprecated 201309 * RUBY3_COMPILER_SINCE(Clang, 3, 4, 0) - -#elif RUBY3_COMPILER_BEFORE(GCC, 5, 0, 0) -# /* GCC 5+ have __has_cpp_attribute, while 4.x had following attributes. */ -# /* https://gcc.gnu.org/projects/cxx-status.html */ -# define RUBY3_HAS_CPP_ATTRIBUTE0(_) RUBY3_TOKEN_PASTE(RUBY3_HAS_CPP_ATTRIBUTE_, _) -# define RUBY3_HAS_CPP_ATTRIBUTE_noreturn 200809 * RUBY3_COMPILER_SINCE(GCC, 4, 8, 0) -# define RUBY3_HAS_CPP_ATTRIBUTE_deprecated 201309 * RUBY3_COMPILER_SINCE(GCC, 4, 9, 0) - -#else -# /* :FIXME: -# * Candidate compilers to list here: -# * - icpc: They have __INTEL_CXX11_MODE__. -# * - SunPro: Seems they support C++11. -# */ -# define RUBY3_HAS_CPP_ATTRIBUTE0(_) 0 -#endif -/** @endcond */ - -/** Wraps (or simulates) `__has_cpp_attribute`. */ -#ifdef RUBY3_HAS_CPP_ATTRIBUTE -# /* Take that. */ - -#elif ! defined(__cplusplus) -# /* Makes no sense. */ -# define RUBY3_HAS_CPP_ATTRIBUTE(_) 0 - -#else -# /* GCC needs workarounds. See https://gcc.godbolt.org/z/jdz3pa */ -# define RUBY3_HAS_CPP_ATTRIBUTE(_) \ - ((RUBY3_HAS_CPP_ATTRIBUTE0(_) <= __cplusplus) ? RUBY3_HAS_CPP_ATTRIBUTE0(_) : 0) -#endif diff --git a/include/ruby/3/has/declspec_attribute.h b/include/ruby/3/has/declspec_attribute.h deleted file mode 100644 index a7d97b400a..0000000000 --- a/include/ruby/3/has/declspec_attribute.h +++ /dev/null @@ -1,46 +0,0 @@ -/** \noop-*-C++-*-vi:ft=cpp - * @file - * @author Ruby developers <ruby-core@ruby-lang.org> - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @warning Symbols prefixed with either `RUBY3` or `ruby3` are - * implementation details. Don't take them as canon. They could - * rapidly appear then vanish. The name (path) of this header file - * is also an implementation detail. Do not expect it to persist - * at the place it is now. Developers are free to move it anywhere - * anytime at will. - * @note To ruby-core: remember that this header can be possibly - * recursively included from extension libraries written in C++. - * Do not expect for instance `__VA_ARGS__` is always available. - * We assume C99 for ruby itself but we don't assume languages of - * extension libraries. They could be written in C++98. - * @brief Defines #RUBY3_HAS_DECLSPEC_ATTRIBUTE. - */ - -/** Wraps (or simulates) `__has_declspec_attribute`. */ -#if defined(RUBY3_HAS_DECLSPEC_ATTRIBUTE) -# /* Take that. */ - -#elif defined(__has_declspec_attribute) -# define RUBY3_HAS_DECLSPEC_ATTRIBUTE(_) __has_declspec_attribute(_) - -#else -# define RUBY3_HAS_DECLSPEC_ATTRIBUTE(_) RUBY3_TOKEN_PASTE(RUBY3_HAS_DECLSPEC_ATTRIBUTE_, _) -# define RUBY3_HAS_DECLSPEC_ATTRIBUTE_align RUBY3_COMPILER_SINCE(MSVC, 8, 0, 0) -# define RUBY3_HAS_DECLSPEC_ATTRIBUTE_deprecated RUBY3_COMPILER_SINCE(MSVC,13, 0, 0) -# define RUBY3_HAS_DECLSPEC_ATTRIBUTE_dllexport RUBY3_COMPILER_SINCE(MSVC, 8, 0, 0) -# define RUBY3_HAS_DECLSPEC_ATTRIBUTE_dllimport RUBY3_COMPILER_SINCE(MSVC, 8, 0, 0) -# define RUBY3_HAS_DECLSPEC_ATTRIBUTE_empty_bases RUBY3_COMPILER_SINCE(MSVC,19, 0, 23918) -# define RUBY3_HAS_DECLSPEC_ATTRIBUTE_noalias RUBY3_COMPILER_SINCE(MSVC, 8, 0, 0) -# define RUBY3_HAS_DECLSPEC_ATTRIBUTE_noinline RUBY3_COMPILER_SINCE(MSVC,13, 0, 0) -# define RUBY3_HAS_DECLSPEC_ATTRIBUTE_noreturn RUBY3_COMPILER_SINCE(MSVC,11, 0, 0) -# define RUBY3_HAS_DECLSPEC_ATTRIBUTE_nothrow RUBY3_COMPILER_SINCE(MSVC, 8, 0, 0) -# define RUBY3_HAS_DECLSPEC_ATTRIBUTE_restrict RUBY3_COMPILER_SINCE(MSVC,14, 0, 0) -# /* Note that "8, 0, 0" might be inaccurate. */ -# if ! defined(__cplusplus) -# /* Clang has this in both C/C++, but MSVC has this in C++ only.*/ -# undef RUBY3_HAS_DECLSPEC_ATTRIBUTE_nothrow -# endif -#endif diff --git a/include/ruby/3/has/extension.h b/include/ruby/3/has/extension.h deleted file mode 100644 index ca3392a090..0000000000 --- a/include/ruby/3/has/extension.h +++ /dev/null @@ -1,33 +0,0 @@ -/** \noop-*-C++-*-vi:ft=cpp - * @file - * @author Ruby developers <ruby-core@ruby-lang.org> - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @warning Symbols prefixed with either `RUBY3` or `ruby3` are - * implementation details. Don't take them as canon. They could - * rapidly appear then vanish. The name (path) of this header file - * is also an implementation detail. Do not expect it to persist - * at the place it is now. Developers are free to move it anywhere - * anytime at will. - * @note To ruby-core: remember that this header can be possibly - * recursively included from extension libraries written in C++. - * Do not expect for instance `__VA_ARGS__` is always available. - * We assume C99 for ruby itself but we don't assume languages of - * extension libraries. They could be written in C++98. - * @brief Defines #RUBY3_HAS_EXTENSION. - */ -#include "ruby/3/has/feature.h" - -/** Wraps (or simulates) `__has_extension`. */ -#if defined(RUBY3_HAS_EXTENSION) -# /* Take that. */ - -#elif defined(__has_extension) -# define RUBY3_HAS_EXTENSION(_) __has_extension(_) - -#else -# /* Pre-3.0 clang had __has_feature but not __has_extension. */ -# define RUBY3_HAS_EXTENSION(_) RUBY3_HAS_FEATURE(_) -#endif diff --git a/include/ruby/3/has/feature.h b/include/ruby/3/has/feature.h deleted file mode 100644 index 977b8150bb..0000000000 --- a/include/ruby/3/has/feature.h +++ /dev/null @@ -1,31 +0,0 @@ -/** \noop-*-C++-*-vi:ft=cpp - * @file - * @author Ruby developers <ruby-core@ruby-lang.org> - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @warning Symbols prefixed with either `RUBY3` or `ruby3` are - * implementation details. Don't take them as canon. They could - * rapidly appear then vanish. The name (path) of this header file - * is also an implementation detail. Do not expect it to persist - * at the place it is now. Developers are free to move it anywhere - * anytime at will. - * @note To ruby-core: remember that this header can be possibly - * recursively included from extension libraries written in C++. - * Do not expect for instance `__VA_ARGS__` is always available. - * We assume C99 for ruby itself but we don't assume languages of - * extension libraries. They could be written in C++98. - * @brief Defines #RUBY3_HAS_FEATURE. - */ - -/** Wraps (or simulates) `__has_feature`. */ -#if defined(RUBY3_HAS_FEATURE) -# /* Take that. */ - -#elif defined(__has_feature) -# define RUBY3_HAS_FEATURE(_) __has_feature(_) - -#else -# define RUBY3_HAS_FEATURE(_) 0 -#endif diff --git a/include/ruby/3/has/warning.h b/include/ruby/3/has/warning.h deleted file mode 100644 index a66d76dfa7..0000000000 --- a/include/ruby/3/has/warning.h +++ /dev/null @@ -1,31 +0,0 @@ -/** \noop-*-C++-*-vi:ft=cpp - * @file - * @author Ruby developers <ruby-core@ruby-lang.org> - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @warning Symbols prefixed with either `RUBY3` or `ruby3` are - * implementation details. Don't take them as canon. They could - * rapidly appear then vanish. The name (path) of this header file - * is also an implementation detail. Do not expect it to persist - * at the place it is now. Developers are free to move it anywhere - * anytime at will. - * @note To ruby-core: remember that this header can be possibly - * recursively included from extension libraries written in C++. - * Do not expect for instance `__VA_ARGS__` is always available. - * We assume C99 for ruby itself but we don't assume languages of - * extension libraries. They could be written in C++98. - * @brief Defines #RUBY3_HAS_WARNING. - */ - -/** Wraps (or simulates) `__has_warning`. */ -#if defined(RUBY3_HAS_WARNING) -# /* Take that. */ - -#elif defined(__has_warning) -# define RUBY3_HAS_WARNING(_) __has_warning(_) - -#else -# define RUBY3_HAS_WARNING(_) 0 -#endif |
