According to MSVC manual (*1), cl.exe can skip including a header file
when that:

- contains #pragma once, or
- starts with #ifndef, or
- starts with #if ! defined.

GCC has a similar trick (*2), but it acts more stricter (e. g. there
must be _no tokens_ outside of #ifndef...#endif).

Sun C lacked #pragma once for a looong time.  Oracle Developer Studio
12.5 finally implemented it, but we cannot assume such recent version.

This changeset modifies header files so that each of them include
strictly one #ifndef...#endif.  I believe this is the most portable way
to trigger compiler optimizations. [Bug #16770]

*1: https://docs.microsoft.com/en-us/cpp/preprocessor/once
*2: https://gcc.gnu.org/onlinedocs/cppinternals/Guard-Macros.html
This commit is contained in:
卜部昌平 2020-04-10 14:11:40 +09:00
Родитель a3f6f67967
Коммит 4ff3f20540
255 изменённых файлов: 1141 добавлений и 1038 удалений

Просмотреть файл

@ -1,3 +1,5 @@
#ifndef RUBY_ADDR2LINE_H
#define RUBY_ADDR2LINE_H
/**********************************************************************
addr2line.h -
@ -8,9 +10,6 @@
**********************************************************************/
#ifndef RUBY_ADDR2LINE_H
#define RUBY_ADDR2LINE_H
#if (defined(USE_ELF) || defined(HAVE_MACH_O_LOADER_H))
void

Просмотреть файл

@ -1,3 +1,5 @@
#ifndef CONSTANT_H
#define CONSTANT_H
/**********************************************************************
constant.h -
@ -8,8 +10,6 @@
Copyright (C) 2009 Yusuke Endoh
**********************************************************************/
#ifndef CONSTANT_H
#define CONSTANT_H
#include "ruby/ruby.h"
#include "id_table.h"

4
dln.h
Просмотреть файл

@ -1,3 +1,5 @@
#ifndef DLN_H
#define DLN_H
/**********************************************************************
dln.h -
@ -9,8 +11,6 @@
**********************************************************************/
#ifndef DLN_H
#define DLN_H
#include "ruby/defines.h" /* for RUBY_SYMBOL_EXPORT_BEGIN */
#ifdef __cplusplus

Просмотреть файл

@ -1,3 +1,5 @@
#ifndef RUBY_ENCINDEX_H
#define RUBY_ENCINDEX_H 1
/**********************************************************************
encindex.h -
@ -9,8 +11,6 @@
**********************************************************************/
#ifndef RUBY_ENCINDEX_H
#define RUBY_ENCINDEX_H 1
#include "ruby/encoding.h" /* rb_ascii8bit_encindex etc. */
#if defined(__cplusplus)
extern "C" {

Просмотреть файл

@ -1,17 +1,15 @@
/**********************************************************************
ruby.h -
$Author$
created at: Sun 10 12:06:15 Jun JST 2007
Copyright (C) 2007-2008 Yukihiro Matsumoto
**********************************************************************/
#ifndef RUBY_H
#ifndef RUBY_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY_H 1
/**
* @file
* @author $Author$
* @date Sun 10 12:06:15 Jun JST 2007
* @copyright 2007-2008 Yukihiro Matsumoto
* @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.
*/
#define HAVE_RUBY_DEFINES_H 1
#define HAVE_RUBY_ENCODING_H 1
#define HAVE_RUBY_INTERN_H 1

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_ANYARGS_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ANYARGS_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -65,8 +67,6 @@
* `__builtin_types_compatible_p`, and in doing so we need to distinguish
* ::rb_f_notimplement from others, by type.
*/
#ifndef RUBY3_ANYARGS_H
#define RUBY3_ANYARGS_H
#include "ruby/3/attr/maybe_unused.h"
#include "ruby/3/attr/nonnull.h"
#include "ruby/3/attr/weakref.h"
@ -371,4 +371,4 @@ RUBY3_ANYARGS_DECL(rb_define_method, VALUE, const char *)
#endif
#endif /* RUBY3_ANYARGS_H */
#endif /* RUBY3_ANYARGS_H */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_ARITHMETIC_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ARITHMETIC_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -33,3 +35,4 @@
#include "ruby/3/arithmetic/size_t.h"
#include "ruby/3/arithmetic/st_data_t.h"
#include "ruby/3/arithmetic/uid_t.h"
#endif /* RUBY3_ARITHMETIC_H */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_ARITHMETIC_CHAR_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ARITHMETIC_CHAR_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Arithmetic conversion between C's `char` and Ruby's.
*/
#ifndef RUBY3_ARITHMETIC_CHAR_H
#define RUBY3_ARITHMETIC_CHAR_H
#include "ruby/3/arithmetic/int.h" /* NUM2INT is here, but */
#include "ruby/3/arithmetic/long.h" /* INT2FIX is here.*/
#include "ruby/3/attr/artificial.h"

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_ARITHMETIC_DOUBLE_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ARITHMETIC_DOUBLE_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Arithmetic conversion between C's `double` and Ruby's.
*/
#ifndef RUBY3_ARITHMETIC_DOUBLE_H
#define RUBY3_ARITHMETIC_DOUBLE_H
#include "ruby/3/attr/pure.h"
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_ARITHMETIC_FIXNUM_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ARITHMETIC_FIXNUM_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Handling of integers formerly known as Fixnums.
*/
#ifndef RUBY3_ARITHMETIC_FIXNUM_H
#define RUBY3_ARITHMETIC_FIXNUM_H
#include "ruby/backward/2/limits.h"
#define FIXABLE RB_FIXABLE

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_ARITHMETIC_GID_T_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ARITHMETIC_GID_T_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -28,3 +30,5 @@
#ifndef NUM2GIDT
# define NUM2GIDT RB_NUM2LONG
#endif
#endif /* RUBY3_ARITHMETIC_GID_T_H */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_ARITHMETIC_INT_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ARITHMETIC_INT_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Arithmetic conversion between C's `int` and Ruby's.
*/
#ifndef RUBY3_ARITHMETIC_INT_H
#define RUBY3_ARITHMETIC_INT_H
#include "ruby/3/config.h"
#include "ruby/3/arithmetic/fixnum.h"
#include "ruby/3/arithmetic/intptr_t.h"

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_ARITHMETIC_INTPTR_T_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ARITHMETIC_INTPTR_T_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Arithmetic conversion between C's `intptr_t` and Ruby's.
*/
#ifndef RUBY3_ARITHMETIC_INTPTR_T_H
#define RUBY3_ARITHMETIC_INTPTR_T_H
#include "ruby/3/config.h"
#ifdef HAVE_STDINT_H

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_ARITHMETIC_LONG_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ARITHMETIC_LONG_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -26,8 +28,6 @@
* understand the difference of `int` and `long` when they designed those
* macros.
*/
#ifndef RUBY3_ARITHMETIC_LONG_H
#define RUBY3_ARITHMETIC_LONG_H
#include "ruby/3/config.h"
#include "ruby/3/arithmetic/fixnum.h" /* FIXABLE */
#include "ruby/3/arithmetic/intptr_t.h" /* rb_int2big etc.*/

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_ARITHMETIC_LONG_LONG_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ARITHMETIC_LONG_LONG_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Arithmetic conversion between C's `long long` and Ruby's.
*/
#ifndef RUBY3_ARITHMETIC_LONG_LONG_H
#define RUBY3_ARITHMETIC_LONG_LONG_H
#include "ruby/3/value.h"
#include "ruby/3/dllexport.h"
#include "ruby/3/special_consts.h"

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_ARITHMETIC_MODE_T_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ARITHMETIC_MODE_T_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -28,3 +30,5 @@
#ifndef MODET2NUM
# define MODET2NUM RB_INT2NUM
#endif
#endif /* RUBY3_ARITHMETIC_MODE_T_H */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_ARITHMETIC_OFF_T_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ARITHMETIC_OFF_T_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -43,3 +45,5 @@
#else
# define NUM2OFFT RB_NUM2INT
#endif
#endif /* RUBY3_ARITHMETIC_OFF_T_H */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_ARITHMETIC_PID_T_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ARITHMETIC_PID_T_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -28,3 +30,5 @@
#ifndef NUM2PIDT
# define NUM2PIDT RB_NUM2LONG
#endif
#endif /* RUBY3_ARITHMETIC_PID_T_H */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_ARITHMETIC_SHORT_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ARITHMETIC_SHORT_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -21,8 +23,6 @@
* Shyouhei wonders: why there is no SHORT2NUM, given there are both
* #USHORT2NUM and #CHR2FIX?
*/
#ifndef RUBY3_ARITHMETIC_SHORT_H
#define RUBY3_ARITHMETIC_SHORT_H
#include "ruby/3/value.h"
#include "ruby/3/dllexport.h"
#include "ruby/3/special_consts.h"

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_ARITHMETIC_SIZE_T_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ARITHMETIC_SIZE_T_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -45,3 +47,5 @@
# define NUM2SIZET RB_NUM2UINT
# define NUM2SSIZET RB_NUM2INT
#endif
#endif /* RUBY3_ARITHMETIC_SIZE_T_H */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_ARITHMERIC_ST_DATA_T_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ARITHMERIC_ST_DATA_T_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Arithmetic conversion between C's `st_data_t` and Ruby's.
*/
#ifndef RUBY3_ARITHMERIC_ST_DATA_T_H
#define RUBY3_ARITHMERIC_ST_DATA_T_H
#include "ruby/3/arithmetic/fixnum.h"
#include "ruby/3/arithmetic/long.h"
#include "ruby/3/attr/artificial.h"

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_ARITHMETIC_UID_T_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ARITHMETIC_UID_T_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -28,3 +30,5 @@
#ifndef NUM2UIDT
# define NUM2UIDT RB_NUM2LONG
#endif
#endif /* RUBY3_ARITHMETIC_UID_T_H */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_ASSUME_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ASSUME_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -23,8 +25,6 @@
* - #RUBY3_ASSUME could fallback to #RUBY3_UNREACHABLE.
* - #RUBY3_UNREACHABLE could fallback to #RUBY3_ASSUME.
*/
#ifndef RUBY3_ASSUME_H
#define RUBY3_ASSUME_H
#include "ruby/3/config.h"
#include "ruby/3/cast.h"
#include "ruby/3/has/builtin.h"

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_ATTR_ALLOC_SIZE_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ATTR_ALLOC_SIZE_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -20,12 +22,10 @@
*/
/** Wraps (or simulates) `__attribute__((alloc_size))` */
#if defined(RUBY3_ATTR_ALLOC_SIZE)
# /* Take that. */
#elif RUBY3_HAS_ATTRIBUTE(alloc_size)
#if RUBY3_HAS_ATTRIBUTE(alloc_size)
# define RUBY3_ATTR_ALLOC_SIZE(tuple) __attribute__((__alloc_size__ tuple))
#else
# define RUBY3_ATTR_ALLOC_SIZE(tuple) /* void */
#endif
#endif /* RUBY3_ATTR_ALLOC_SIZE_H */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_ATTR_ARTIFICIAL_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ATTR_ARTIFICIAL_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -34,12 +36,10 @@
*/
/** Wraps (or simulates) `__attribute__((artificial))` */
#if defined(RUBY3_ATTR_ARTIFICIAL)
# /* Take that. */
#elif RUBY3_HAS_ATTRIBUTE(artificial)
#if RUBY3_HAS_ATTRIBUTE(artificial)
# define RUBY3_ATTR_ARTIFICIAL() __attribute__((__artificial__))
#else
# define RUBY3_ATTR_ARTIFICIAL() /* void */
#endif
#endif /* RUBY3_ATTR_ARTIFICIAL_H */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_ATTR_COLD_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ATTR_COLD_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -21,17 +23,14 @@
#include "ruby/3/compiler_is.h"
/** Wraps (or simulates) `__attribute__((cold))` */
#if defined(RUBY3_ATTR_COLD)
# /* Take that. */
#elif RUBY3_COMPILER_IS(SunPro)
#if RUBY3_COMPILER_IS(SunPro)
# /* Recent SunPro has __has_attribute, and is borken. */
# /* It reports it has attribute cold, reality isn't (warnings issued). */
# define RUBY3_ATTR_COLD() /* void */
#elif RUBY3_HAS_ATTRIBUTE(cold)
# define RUBY3_ATTR_COLD() __attribute__((__cold__))
#else
# define RUBY3_ATTR_COLD() /* void */
#endif
#endif /* RUBY3_ATTR_COLD_H */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_ATTR_CONST_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ATTR_CONST_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -21,30 +23,22 @@
#include "ruby/3/has/declspec_attribute.h"
/** Wraps (or simulates) `__attribute__((const))` */
#if defined(RUBY3_ATTR_CONST)
# /* Take that. */
#elif RUBY3_HAS_ATTRIBUTE(const)
#if RUBY3_HAS_ATTRIBUTE(const)
# define RUBY3_ATTR_CONST() __attribute__((__const__))
#elif RUBY3_HAS_DECLSPEC_ATTRIBUTE(noalias)
# /* If a function can be a const, that is also a noalias. */
# define RUBY3_ATTR_CONST() __declspec(noalias)
#elif RUBY3_COMPILER_SINCE(SunPro, 5, 10, 0)
# define RUBY3_ATTR_CONST() _Pragma("no_side_effect")
#else
# define RUBY3_ATTR_CONST() /* void */
#endif
/** Enables #RUBY3_ATTR_CONST iff. #RUBY_NDEBUG. */
#if defined(RUBY3_ATTR_CONST_ON_NDEBUG)
# /* Take that. */
#elif RUBY_NDEBUG
#if RUBY_NDEBUG
# define RUBY3_ATTR_CONST_ON_NDEBUG() RUBY3_ATTR_CONST()
#else
# define RUBY3_ATTR_CONST_ON_NDEBUG() /* void */
#endif
#endif /* RUBY3_ATTR_CONST_H */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_ATTR_CONSTEXPR_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ATTR_CONSTEXPR_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -21,11 +23,8 @@
#include "ruby/3/has/feature.h"
#include "ruby/3/compiler_is.h"
/** @cond INTERNAL_MACRO*/
#if defined(RUBY3_ATTR_CONSTEXPR)
# /* Take that. */
#elif ! defined(__cplusplus)
/** @cond INTERNAL_MACRO */
#if ! defined(__cplusplus)
# /* Makes no sense. */
# define RUBY3_HAS_ATTR_CONSTEXPR_CXX11 0
# define RUBY3_HAS_ATTR_CONSTEXPR_CXX14 0
@ -63,10 +62,7 @@
/** @endcond */
/** Wraps (or simulates) C++11 `constexpr`. */
#if defined(RUBY3_ATTR_CONSTEXPR)
# /* Take that. */
#elif RUBY3_HAS_ATTR_CONSTEXPR_CXX14
#if RUBY3_HAS_ATTR_CONSTEXPR_CXX14
# define RUBY3_ATTR_CONSTEXPR(_) constexpr
#elif RUBY3_HAS_ATTR_CONSTEXPR_CXX11
@ -79,12 +75,10 @@
#endif
/** Enables #RUBY3_ATTR_CONSTEXPR iff. #RUBY_NDEBUG. */
#if defined(RUBY3_ATTR_CONSTEXPR_ON_NDEBUG)
# /* Take that. */
#elif RUBY_NDEBUG
#if RUBY_NDEBUG
# define RUBY3_ATTR_CONSTEXPR_ON_NDEBUG(_) RUBY3_ATTR_CONSTEXPR(_)
#else
# define RUBY3_ATTR_CONSTEXPR_ON_NDEBUG(_) /* void */
#endif
#endif /* RUBY3_ATTR_CONSTEXPR_H */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_ATTR_DEPRECATED_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ATTR_DEPRECATED_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -24,10 +26,7 @@
#include "ruby/3/has/extension.h"
/** Wraps (or simulates) `[[deprecated]]` */
#if defined(RUBY3_ATTR_DEPRECATED)
# /* Take that. */
#elif RUBY3_HAS_EXTENSION(attribute_deprecated_with_message)
#if RUBY3_HAS_EXTENSION(attribute_deprecated_with_message)
# define RUBY3_ATTR_DEPRECATED(msg) __attribute__((__deprecated__ msg))
#elif RUBY3_COMPILER_SINCE(GCC, 4, 5, 0)
@ -54,3 +53,5 @@
#else
# define RUBY3_ATTR_DEPRECATED(msg) /* void */
#endif
#endif /* RUBY3_ATTR_DEPRECATED_H */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_ATTR_DIAGNOSE_IF_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ATTR_DIAGNOSE_IF_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -20,10 +22,7 @@
*/
/** Wraps (or simulates) `__attribute__((diagnose_if))` */
#if defined(RUBY3_ATTR_DIAGNOSE_IF)
# /* Take that. */
#elif RUBY3_COMPILER_BEFORE(Clang, 5, 0, 0)
#if RUBY3_COMPILER_BEFORE(Clang, 5, 0, 0)
# /* https://bugs.llvm.org/show_bug.cgi?id=34319 */
# define RUBY3_ATTR_DIAGNOSE_IF(_, __, ___) /* void */
@ -37,3 +36,5 @@
#else
# define RUBY3_ATTR_DIAGNOSE_IF(_, __, ___) /* void */
#endif
#endif /* RUBY3_ATTR_DIAGNOSE_IF_H */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_ATTR_ENUM_EXTENSIBILITY_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ATTR_ENUM_EXTENSIBILITY_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -20,12 +22,10 @@
*/
/** Wraps (or simulates) `__attribute__((enum_extensibility))` */
#if defined(RUBY3_ATTR_ENUM_EXTENSIBILITY)
# /* Take that. */
#elif RUBY3_HAS_ATTRIBUTE(enum_extensibility)
#if RUBY3_HAS_ATTRIBUTE(enum_extensibility)
# define RUBY3_ATTR_ENUM_EXTENSIBILITY(_) __attribute__((__enum_extensibility__(_)))
#else
# define RUBY3_ATTR_ENUM_EXTENSIBILITY(_) /* void */
#endif
#endif /* RUBY3_ATTR_ENUM_EXTENSIBILITY_H */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_ATTR_ERROR_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ATTR_ERROR_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -20,12 +22,10 @@
*/
/** Wraps (or simulates) `__attribute__((error))` */
#if defined(RUBY3_ATTR_ERROR)
# /* Take that. */
#elif RUBY3_HAS_ATTRIBUTE(error)
#if RUBY3_HAS_ATTRIBUTE(error)
# define RUBY3_ATTR_ERROR(msg) __attribute__((__error__ msg))
#else
# define RUBY3_ATTR_ERROR(msg) /* void */
#endif
#endif /* RUBY3_ATTR_ERROR_H */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_ATTR_FLAG_ENUM_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ATTR_FLAG_ENUM_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -21,12 +23,10 @@
*/
/** Wraps (or simulates) `__attribute__((flag_enum)` */
#if defined(RUBY3_ATTR_FLAG_ENUM)
# /* Take that. */
#elif RUBY3_HAS_ATTRIBUTE(flag_enum)
#if RUBY3_HAS_ATTRIBUTE(flag_enum)
# define RUBY3_ATTR_FLAG_ENUM() __attribute__((__flag_enum__))
#else
# define RUBY3_ATTR_FLAG_ENUM() /* void */
#endif
#endif /* RUBY3ATTR_FLAG_ENUM_H */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_ATTR_FORCEINLINE_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ATTR_FORCEINLINE_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -25,15 +27,12 @@
* `__forceinline` are mutually exclusive. We have to mimic that behaviour for
* non-MSVC compilers.
*/
#if defined(RUBY3_ATTR_FORCEINLINE)
# /* Take that. */
#elif RUBY3_COMPILER_SINCE(MSVC, 12, 0, 0)
#if RUBY3_COMPILER_SINCE(MSVC, 12, 0, 0)
# define RUBY3_ATTR_FORCEINLINE() __forceinline
#elif RUBY3_HAS_ATTRIBUTE(always_inline)
# define RUBY3_ATTR_FORCEINLINE() __attribute__((__always_inline__)) inline
#else
# define RUBY3_ATTR_FORCEINLINE() inline
#endif
#endif /* RUBY3_ATTR_FORCEINLINE_H */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_ATTR_FORMAT_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ATTR_FORMAT_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -20,22 +22,16 @@
*/
/** Wraps (or simulates) `__attribute__((format))` */
#if defined(RUBY3_ATTR_FORMAT)
# /* Take that. */
#elif RUBY3_HAS_ATTRIBUTE(format)
#if RUBY3_HAS_ATTRIBUTE(format)
# define RUBY3_ATTR_FORMAT(x, y, z) __attribute__((__format__(x, y, z)))
#else
# define RUBY3_ATTR_FORMAT(x, y, z) /* void */
#endif
#if defined(RUBY3_PRINTF_FORMAT)
# /* Take that. */
#elif defined(__MINGW_PRINTF_FORMAT)
#if defined(__MINGW_PRINTF_FORMAT)
# define RUBY3_PRINTF_FORMAT __MINGW_PRINTF_FORMAT
#else
# define RUBY3_PRINTF_FORMAT __printf__
#endif
#endif /* RUBY3_ATTR_FORMAT_H */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_ATTR_MAYBE_UNUSED_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ATTR_MAYBE_UNUSED_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -22,18 +24,14 @@
#include "ruby/3/has/cpp_attribute.h"
/** Wraps (or simulates) `[[maybe_unused]]` */
#if defined(RUBY3_ATTR_MAYBE_UNUSED)
# /* Take that. */
#elif RUBY3_HAS_CPP_ATTRIBUTE(maybe_unused)
#if RUBY3_HAS_CPP_ATTRIBUTE(maybe_unused)
# define RUBY3_ATTR_MAYBE_UNUSED() [[maybe_unused]]
#elif RUBY3_HAS_C_ATTRIBUTE(maybe_unused)
# define RUBY3_ATTR_MAYBE_UNUSED() [[maybe_unused]]
#elif RUBY3_HAS_ATTRIBUTE(unused)
# define RUBY3_ATTR_MAYBE_UNUSED() __attribute__((__unused__))
#else
# define RUBY3_ATTR_MAYBE_UNUSED() /* void */
#endif
#endif /* RUBY3_ATTR_MAYBE_UNUSED */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_ATTR_NOALIAS_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ATTR_NOALIAS_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -47,12 +49,10 @@
#include "ruby/3/has/declspec_attribute.h"
/** Wraps (or simulates) `__declspec((noalias))` */
#if defined(RUBY3_ATTR_NOALIAS)
# /* Take that. */
#elif RUBY3_HAS_DECLSPEC_ATTRIBUTE(noalias)
#if RUBY3_HAS_DECLSPEC_ATTRIBUTE(noalias)
# define RUBY3_ATTR_NOALIAS() __declspec(noalias)
#else
# define RUBY3_ATTR_NOALIAS() /* void */
#endif
#endif /* RUBY3_ATTR_NOALIAS_H */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_ATTR_NODISCARD_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ATTR_NODISCARD_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -26,22 +28,17 @@
* nodiscard attribute can have a message why the result shall not be ignoed.
* However GCC attribute and SAL annotation cannot take them.
*/
#if defined(RUBY3_ATTR_NODISCARD)
# /* Take that. */
#elif RUBY3_HAS_CPP_ATTRIBUTE(nodiscard)
#if RUBY3_HAS_CPP_ATTRIBUTE(nodiscard)
# define RUBY3_ATTR_NODISCARD() [[nodiscard]]
#elif RUBY3_HAS_C_ATTRIBUTE(nodiscard)
# define RUBY3_ATTR_NODISCARD() [[nodiscard]]
#elif RUBY3_HAS_ATTRIBUTE(warn_unused_result)
# define RUBY3_ATTR_NODISCARD() __attribute__((__warn_unused_result__))
#elif defined(_Check_return_)
# /* Take SAL definition. */
# define RUBY3_ATTR_NODISCARD() _Check_return_
#else
# define RUBY3_ATTR_NODISCARD() /* void */
#endif
#endif /* RUBY3_ATTR_NODISCARD_H */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_ATTR_NOEXCEPT_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ATTR_NOEXCEPT_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -62,10 +64,7 @@
#include "ruby/3/has/feature.h"
/** Wraps (or simulates) C++11 `noexcept` */
#if defined(RUBY3_ATTR_NOEXCEPT)
# /* Take that. */
#elif ! defined(__cplusplus)
#if ! defined(__cplusplus)
# /* Doesn't make sense. */
# define RUBY3_ATTR_NOEXCEPT(_) /* void */
@ -87,3 +86,5 @@
#else
# define RUBY3_ATTR_NOEXCEPT(_) /* void */
#endif
#endif /* RUBY3_ATTR_NOEXCEPT_H */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_ATTR_NOINLINE_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ATTR_NOINLINE_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -21,15 +23,12 @@
#include "ruby/3/has/declspec_attribute.h"
/** Wraps (or simulates) `__declspec(noinline)` */
#if defined(RUBY3_ATTR_NOINLINE)
# /* Take that. */
#elif RUBY3_HAS_DECLSPEC_ATTRIBUTE(noinline)
#if RUBY3_HAS_DECLSPEC_ATTRIBUTE(noinline)
# define RUBY3_ATTR_NOINLINE() __declspec(noinline)
#elif RUBY3_HAS_ATTRIBUTE(noinline)
# define RUBY3_ATTR_NOINLINE() __attribute__((__noinline__))
#else
# define RUBY3_ATTR_NOINLINE() /* void */
#endif
#endif /* RUBY3_ATTR_NOINLINE_H */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_ATTR_NONNULL_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ATTR_NONNULL_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -20,12 +22,10 @@
*/
/** Wraps (or simulates) `__attribute__((nonnull))` */
#if defined(RUBY3_ATTR_NONNULL)
# /* Take that. */
#elif RUBY3_HAS_ATTRIBUTE(nonnull)
#if RUBY3_HAS_ATTRIBUTE(nonnull)
# define RUBY3_ATTR_NONNULL(list) __attribute__((__nonnull__ list))
#else
# define RUBY3_ATTR_NONNULL(list) /* void */
#endif
#endif /* RUBY3_ATTR_NONNULL_H */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_ATTR_NORETURN_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ATTR_NORETURN_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -22,10 +24,7 @@
#include "ruby/3/has/declspec_attribute.h"
/** Wraps (or simulates) `[[noreturn]]` */
#if defined(RUBY3_ATTR_NORETURN)
# /* Take that. */
#elif RUBY3_COMPILER_SINCE(SunPro, 5, 10, 0)
#if RUBY3_COMPILER_SINCE(SunPro, 5, 10, 0)
# define RUBY3_ATTR_NORETURN() _Pragma("does_not_return")
#elif RUBY3_HAS_DECLSPEC_ATTRIBUTE(noreturn)
@ -47,3 +46,5 @@
#else
# define RUBY3_ATTR_NORETURN() /* void */
#endif
#endif /* RUBY3_ATTR_NORETURN_H */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_ATTR_PURE_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ATTR_PURE_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -21,26 +23,19 @@
#include "ruby/assert.h"
/** Wraps (or simulates) `__attribute__((pure))` */
#if defined(RUBY3_ATTR_PURE)
# /* Take that. */
#elif RUBY3_HAS_ATTRIBUTE(pure)
#if RUBY3_HAS_ATTRIBUTE(pure)
# define RUBY3_ATTR_PURE() __attribute__((__pure__))
#elif RUBY3_COMPILER_SINCE(SunPro, 5, 10, 0)
# define RUBY3_ATTR_PURE() _Pragma("does_not_write_global_data")
#else
# define RUBY3_ATTR_PURE() /* void */
#endif
/** Enables #RUBY3_ATTR_PURE iff. #RUBY_NDEBUG. */
#if defined(RUBY3_ATTR_PURE_ON_NDEBUG)
# /* Take that. */
#elif RUBY_NDEBUG
#if RUBY_NDEBUG
# define RUBY3_ATTR_PURE_ON_NDEBUG() RUBY3_ATTR_PURE()
#else
# define RUBY3_ATTR_PURE_ON_NDEBUG() /* void */
#endif
#endif /* RUBY3_ATTR_PURE_H */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_ATTR_RESTRICT_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ATTR_RESTRICT_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -24,10 +26,7 @@
* `__has_declspec_attribute()` which involves macro substitution. */
/** Wraps (or simulates) `__declspec(restrict)` */
#if defined(RUBY3_ATTR_RESTRICT)
# /* Take that. */
#elif RUBY3_COMPILER_SINCE(MSVC, 14, 0, 0)
#if RUBY3_COMPILER_SINCE(MSVC, 14, 0, 0)
# define RUBY3_ATTR_RESTRICT() __declspec(RUBY3_TOKEN_PASTE(re, strict))
#elif RUBY3_HAS_ATTRIBUTE(malloc)
@ -39,3 +38,5 @@
#else
# define RUBY3_ATTR_RESTRICT() /* void */
#endif
#endif /* RUBY3_ATTR_RESTRICT_H */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_ATTR_RETURNS_NONNULL_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ATTR_RETURNS_NONNULL_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -20,10 +22,7 @@
*/
/** Wraps (or simulates) `__attribute__((returns_nonnull))` */
#if defined(RUBY3_ATTR_RETURNS_NONNULL)
# /* Take that. */
#elif defined(_Ret_nonnull_)
#if defined(_Ret_nonnull_)
# /* Take SAL definition. */
# define RUBY3_ATTR_RETURNS_NONNULL() _Ret_nonnull_
@ -33,3 +32,5 @@
#else
# define RUBY3_ATTR_RETURNS_NONNULL() /* void */
#endif
#endif /* RUBY3_ATTR_RETURNS_NONNULL_H */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_ATTR_WARNING_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ATTR_WARNING_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -20,12 +22,10 @@
*/
/** Wraps (or simulates) `__attribute__((warning))` */
#if defined(RUBY3_ATTR_WARNING)
# /* Take that. */
#elif RUBY3_HAS_ATTRIBUTE(warning)
#if RUBY3_HAS_ATTRIBUTE(warning)
# define RUBY3_ATTR_WARNING(msg) __attribute__((__warning__ msg))
#else
# define RUBY3_ATTR_WARNING(msg) /* void */
#endif
#endif /* RUBY3_ATTR_WARNING_H */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_ATTR_WEAKREF_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ATTR_WEAKREF_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -20,12 +22,10 @@
*/
/** Wraps (or simulates) `__attribute__((weakref))` */
#if defined(RUBY3_ATTR_WEAKREF)
# /* Take that. */
#elif RUBY3_HAS_ATTRIBUTE(weakref)
#if RUBY3_HAS_ATTRIBUTE(weakref)
# define RUBY3_ATTR_WEAKREF(sym) __attribute__((__weakref__(# sym)))
#else
# define RUBY3_ATTR_WEAKREF(sym) /* void */
#endif
#endif /* RUBY3_ATTR_WEAKREF_H */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_CAST_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_CAST_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -24,10 +26,7 @@
* warnings. Ruby internals are pure C so they should not bother.
*/
#if defined(RUBY3_CAST)
# /* Take that. */
#elif ! defined(__cplusplus)
#if ! defined(__cplusplus)
# define RUBY3_CAST(expr) (expr)
#elif RUBY3_COMPILER_SINCE(GCC, 4, 6, 0)
@ -47,3 +46,5 @@
# define RUBY3_CAST(expr) (expr)
#endif
/** @endcond */
#endif /* RUBY3_CAST_H */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_COMPILER_IS_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_COMPILER_IS_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -25,12 +27,7 @@
* @retval true It is.
* @retval false It isn't.
*/
#ifndef RUBY3_COMPILER_IS_INCLUDED
#define RUBY3_COMPILER_IS_INCLUDED
#ifndef RUBY3_COMPILER_IS
# define RUBY3_COMPILER_IS(cc) RUBY3_COMPILER_IS_ ## cc
#endif
#define RUBY3_COMPILER_IS(cc) RUBY3_COMPILER_IS_ ## cc
#include "ruby/3/compiler_is/apple.h"
#include "ruby/3/compiler_is/clang.h"
@ -45,4 +42,4 @@
*
* - ARM's armclang: ditto, it can be clang-backended. */
#endif // RUBY3_COMPILER_IS_INCLUDED
#endif /* RUBY3_COMPILER_IS_H */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_COMPILER_IS_APPLE_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_COMPILER_IS_APPLE_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -23,10 +25,7 @@
* from LLVM's, when it comes to compiler detection business in this header
* file.
*/
#if defined(RUBY3_COMPILER_IS_Apple)
# /* Take that. */
#elif ! defined(__clang__)
#if ! defined(__clang__)
# define RUBY3_COMPILER_IS_Apple 0
#elif ! defined(__apple_build_version__)
@ -38,3 +37,5 @@
# define RUBY3_COMPILER_VERSION_MINOR __clang_minor__
# define RUBY3_COMPILER_VERSION_PATCH __clang_patchlevel__
#endif
#endif /* RUBY3_COMPILER_IS_APPLE_H */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_COMPILER_IS_CLANG_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_COMPILER_IS_CLANG_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -20,10 +22,7 @@
*/
#include "ruby/3/compiler_is/apple.h"
#if defined(RUBY3_COMPILER_IS_Clang)
# /* Take that. */
#elif ! defined(__clang__)
#if ! defined(__clang__)
# define RUBY3_COMPILER_IS_Clang 0
#elif RUBY3_COMPILER_IS(Apple)
@ -35,3 +34,5 @@
# define RUBY3_COMPILER_VERSION_MINOR __clang_minor__
# define RUBY3_COMPILER_VERSION_PATCH __clang_patchlevel__
#endif
#endif /* RUBY3_COMPILER_IS_CLANG_H */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_COMPILER_IS_GCC_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_COMPILER_IS_GCC_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -22,10 +24,7 @@
#include "ruby/3/compiler_is/clang.h"
#include "ruby/3/compiler_is/intel.h"
#if defined(RUBY3_COMPILER_IS_GCC)
# /* Take that. */
#elif ! defined(__GNUC__)
#if ! defined(__GNUC__)
# define RUBY3_COMPILER_IS_GCC 0
#elif RUBY3_COMPILER_IS(Apple)
@ -43,3 +42,5 @@
# define RUBY3_COMPILER_VERSION_MINOR __GNUC_MINOR__
# define RUBY3_COMPILER_VERSION_PATCH __GNUC_PATCHLEVEL__
#endif
#endif /* RUBY3_COMPILER_IS_GCC_H */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_COMPILER_IS_INTEL_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_COMPILER_IS_INTEL_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -18,10 +20,7 @@
* extension libraries. They could be written in C++98.
* @brief Defines #RUBY3_COMPILER_IS_Intel.
*/
#if defined(RUBY3_COMPILER_IS_Intel)
# /* Take that. */
#elif ! defined(__INTEL_COMPILER)
#if ! defined(__INTEL_COMPILER)
# define RUBY3_COMPILER_IS_Intel 0
#elif ! defined(__INTEL_COMPILER_UPDATE)
@ -38,3 +37,5 @@
# define RUBY3_COMPILER_VERSION_MINOR (__INTEL_COMPILER % 100 / 10)
# define RUBY3_COMPILER_VERSION_PATCH __INTEL_COMPILER_UPDATE
#endif
#endif /* RUBY3_COMPILER_IS_INTEL_H */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_COMPILER_IS_MSVC_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_COMPILER_IS_MSVC_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -21,10 +23,7 @@
#include "ruby/3/compiler_is/clang.h"
#include "ruby/3/compiler_is/intel.h"
#if defined(RUBY3_COMPILER_IS_MSVC)
# /* Take that. */
#elif ! defined(_MSC_VER)
#if ! defined(_MSC_VER)
# define RUBY3_COMPILER_IS_MSVC 0
#elif RUBY3_COMPILER_IS(Clang)
@ -54,3 +53,5 @@
# define RUBY3_COMPILER_VERSION_MINOR (_MSC_VER % 100)
# define RUBY3_COMPILER_VERSION_PATCH 0
#endif
#endif /* RUBY3_COMPILER_IS_MSVC_H */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_COMPILER_IS_SUNPRO_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_COMPILER_IS_SUNPRO_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -18,10 +20,7 @@
* extension libraries. They could be written in C++98.
* @brief Defines #RUBY3_COMPILER_IS_SunPro.
*/
#if defined(RUBY3_COMPILER_IS_SunPro)
# /* Take that. */
#elif ! (defined(__SUNPRO_C) || defined(__SUNPRO_CC))
#if ! (defined(__SUNPRO_C) || defined(__SUNPRO_CC))
# define RUBY3_COMPILER_IS_SunPro 0
#elif defined(__SUNPRO_C) && __SUNPRO_C >= 0x5100
@ -52,3 +51,5 @@
# define TERSE_COMPILER_VERSION_MINOR (__SUNPRO_CC >> 4 & 0xF)
# define TERSE_COMPILER_VERSION_PATCH (__SUNPRO_CC & 0xF)
#endif
#endif /* RUBY3_COMPILER_IS_SUNPRO_H */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_COMPILER_SINCE_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_COMPILER_SINCE_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -19,7 +21,6 @@
* @brief Defines #RUBY3_COMPILER_SINCE.
*/
#include "ruby/3/compiler_is.h"
#ifndef RUBY3_COMPILER_SINCE
/**
* @brief Checks if the compiler is of given brand and is newer than or equal
@ -57,4 +58,4 @@
((RUBY3_COMPILER_VERSION_MINOR == (y)) && \
(RUBY3_COMPILER_VERSION_PATCH < (z)))))))
#endif /* RUBY3_COMPILER_SINCE */
#endif /* RUBY3_COMPILER_SINCE_H */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_CONFIG_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_CONFIG_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Thin wrapper to ruby/config.h
*/
#ifndef RUBY3_CONFIG_H
#define RUBY3_CONFIG_H
#include "ruby/config.h"
#ifdef RUBY_EXTCONF_H

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_CONSTANT_P_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_CONSTANT_P_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -26,12 +28,10 @@
*/
#include "ruby/3/has/builtin.h"
#if defined(RUBY3_CONSTANT_P)
# /* Take that. */
#elif RUBY3_HAS_BUILTIN(__builtin_constant_p)
#if RUBY3_HAS_BUILTIN(__builtin_constant_p)
# define RUBY3_CONSTANT_P(expr) __builtin_constant_p(expr)
#else
# define RUBY3_CONSTANT_P(expr) 0
#endif
#endif /* RUBY3_CONSTANT_P_H */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_CORE_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_CORE_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -30,3 +32,4 @@
#include "ruby/3/core/rstring.h"
#include "ruby/3/core/rstruct.h"
#include "ruby/3/core/rtypeddata.h"
#endif /* RUBY3_CORE_H */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_RARRAY_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_RARRAY_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Defines struct ::RArray.
*/
#ifndef RUBY3_RARRAY_H
#define RUBY3_RARRAY_H
#include "ruby/3/arithmetic/long.h"
#include "ruby/3/attr/artificial.h"
#include "ruby/3/attr/constexpr.h"

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_RBASIC_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_RBASIC_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Defines struct ::RBasic.
*/
#ifndef RUBY3_RBASIC_H
#define RUBY3_RBASIC_H
#include "ruby/3/attr/artificial.h"
#include "ruby/3/attr/constexpr.h"
#include "ruby/3/attr/forceinline.h"

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_RBIGNUM_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_RBIGNUM_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Routines to manipulate struct ::RBignum.
*/
#ifndef RUBY3_RBIGNUM_H
#define RUBY3_RBIGNUM_H
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"
#include "ruby/3/value_type.h"

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_RCLASS_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_RCLASS_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Routines to manipulate struct ::RClass.
*/
#ifndef RUBY3_RCLASS_H
#define RUBY3_RCLASS_H
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"
#include "ruby/3/cast.h"

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_RDATA_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_RDATA_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Defines struct ::RData.
*/
#ifndef RUBY3_RDATA_H
#define RUBY3_RDATA_H
#include "ruby/3/config.h"
#ifdef STDC_HEADERS

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_RFILE_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_RFILE_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Defines struct ::RFile.
*/
#ifndef RUBY3_RFILE_H
#define RUBY3_RFILE_H
#include "ruby/3/core/rbasic.h"
#include "ruby/3/cast.h"

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_RHASH_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_RHASH_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -30,8 +32,6 @@
*
* Shyouhei stopped thinking. Let them be as is.
*/
#ifndef RUBY3_RHASH_H
#define RUBY3_RHASH_H
#include "ruby/3/config.h"
#ifdef STDC_HEADERS

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_RMATCH_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_RMATCH_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Defines struct ::RMatch.
*/
#ifndef RUBY3_RMATCH_H
#define RUBY3_RMATCH_H
#include "ruby/3/attr/artificial.h"
#include "ruby/3/attr/pure.h"
#include "ruby/3/attr/returns_nonnull.h"

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_ROBJECT_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ROBJECT_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Defines struct ::RObject.
*/
#ifndef RUBY3_ROBJECT_H
#define RUBY3_ROBJECT_H
#include "ruby/3/config.h"
#ifdef HAVE_STDINT_H

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_RREGEXP_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_RREGEXP_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Defines struct ::RRegexp.
*/
#ifndef RUBY3_RREGEXP_H
#define RUBY3_RREGEXP_H
#include "ruby/3/attr/artificial.h"
#include "ruby/3/attr/pure.h"
#include "ruby/3/cast.h"

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_RSTRING_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_RSTRING_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Defines struct ::RString.
*/
#ifndef RUBY3_RSTRING_H
#define RUBY3_RSTRING_H
#include "ruby/3/config.h"
#include "ruby/3/arithmetic/long.h"
#include "ruby/3/attr/artificial.h"

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_RSTRUCT_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_RSTRUCT_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Routines to manipulate struct ::RStruct.
*/
#ifndef RUBY3_RSTRUCT_H
#define RUBY3_RSTRUCT_H
#include "ruby/3/attr/artificial.h"
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_RTYPEDDATA_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_RTYPEDDATA_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Defines struct ::RTypedData.
*/
#ifndef RUBY3_RTYPEDDATA_H
#define RUBY3_RTYPEDDATA_H
#include "ruby/3/config.h"
#ifdef STDC_HEADERS

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_CTYPE_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_CTYPE_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Our own, locale independent, character handling routines.
*/
#ifndef RUBY3_CTYPE_H
#define RUBY3_CTYPE_H
#include "ruby/3/config.h"
#ifdef STDC_HEADERS

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_DLLEXPORT_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_DLLEXPORT_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Tewaking visibility of C variables/functions.
*/
#ifndef RUBY3_DLLEXPORT_H
#define RUBY3_DLLEXPORT_H
#include "ruby/3/config.h"
#include "ruby/3/compiler_is.h"

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_DOSISH_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_DOSISH_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Support for so-called dosish systems.
*/
#ifndef RUBY3_DOSISH_H
#define RUBY3_DOSISH_H
#ifdef __CYGWIN__
#undef _WIN32
#endif

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_ERROR_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_ERROR_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Declares ::rb_raise().
*/
#ifndef RUBY3_ERROR_H
#define RUBY3_ERROR_H
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"
#include "ruby/backward/2/attributes.h"

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_EVAL_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_EVAL_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Declares ::rb_eval_string().
*/
#ifndef RUBY3_EVAL_H
#define RUBY3_EVAL_H
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_EVENT_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_EVENT_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Debugging and tracing APIs.
*/
#ifndef RUBY3_EVENT_H
#define RUBY3_EVENT_H
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_FL_TYPE_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_FL_TYPE_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Defines enum ::ruby_fl_type.
*/
#ifndef RUBY3_FL_TYPE_H
#define RUBY3_FL_TYPE_H
#include "ruby/3/config.h" /* for ENUM_OVER_INT */
#include "ruby/3/attr/artificial.h"
#include "ruby/3/attr/flag_enum.h"

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_GC_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_GC_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Registering values to the GC.
*/
#ifndef RUBY3_GC_H
#define RUBY3_GC_H
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_GLOB_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_GLOB_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Declares ::rb_glob().
*/
#ifndef RUBY3_GLOB_H
#define RUBY3_GLOB_H
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_GLOBALS_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_GLOBALS_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Ruby-level global variables / constants, visible from C.
*/
#ifndef RUBY3_GLOBALS_H
#define RUBY3_GLOBALS_H
#include "ruby/3/attr/pure.h"
#include "ruby/3/dllexport.h"
#include "ruby/3/fl_type.h"

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_HAS_ATTRIBUTE_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_HAS_ATTRIBUTE_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -21,10 +23,7 @@
#include "ruby/3/config.h"
/** Wraps (or simulates) `__has_attribute`. */
#if defined(RUBY3_HAS_ATTRIBUTE)
# /* Take that. */
#elif defined(__has_attribute)
#if defined(__has_attribute)
# define RUBY3_HAS_ATTRIBUTE(_) __has_attribute(_)
#elif RUBY3_COMPILER_IS(GCC)
@ -150,3 +149,5 @@
# define RUBY3_HAS_ATTRIBUTE_weak 1
# endif
#endif
#endif /* RUBY3_HAS_ATTRIBUTE_H */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_HAS_BUILTIN_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_HAS_BUILTIN_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -21,10 +23,7 @@
#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)
#if 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. */
@ -89,3 +88,5 @@
# define RUBY3_HAS_BUILTIN___builtin_unreachable 1
# endif
#endif
#endif /* RUBY3_HAS_BUILTIN_H */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_HAS_C_ATTRIBUTE_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_HAS_C_ATTRIBUTE_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -20,10 +22,7 @@
*/
/** Wraps (or simulates) `__has_c_attribute`. */
#if defined(RUBY3_HAS_C_ATTRIBUTE)
# /* Take that. */
#elif defined(__cplusplus)
#if defined(__cplusplus)
# /* Makes no sense. */
# define RUBY3_HAS_C_ATTRIBUTE(_) 0
@ -35,3 +34,5 @@
# * lacks C2x attributes as well. Might change in future? */
# define RUBY3_HAS_C_ATTRIBUTE(_) 0
#endif
#endif /* RUBY3_HAS_C_ATTRIBUTE_H */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_HAS_CPP_ATTRIBUTE_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_HAS_CPP_ATTRIBUTE_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -21,10 +23,7 @@
#include "ruby/3/compiler_is.h"
/** @cond INTERNAL_MACRO */
#if defined(RUBY3_HAS_CPP_ATTRIBUTE0)
# /* Take that. */
#elif defined(__has_cpp_attribute)
#if defined(__has_cpp_attribute)
# define RUBY3_HAS_CPP_ATTRIBUTE0(_) __has_cpp_attribute(_)
#elif RUBY3_COMPILER_IS(MSVC)
@ -66,15 +65,13 @@
/** @endcond */
/** Wraps (or simulates) `__has_cpp_attribute`. */
#ifdef RUBY3_HAS_CPP_ATTRIBUTE
# /* Take that. */
#elif ! defined(__cplusplus)
#if ! 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
#endif /* RUBY3_HAS_CPP_ATTRIBUTE_H */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_HAS_DECLSPEC_ATTRIBUTE_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_HAS_DECLSPEC_ATTRIBUTE_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -20,12 +22,8 @@
*/
/** Wraps (or simulates) `__has_declspec_attribute`. */
#if defined(RUBY3_HAS_DECLSPEC_ATTRIBUTE)
# /* Take that. */
#elif defined(__has_declspec_attribute)
#if 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)
@ -44,3 +42,5 @@
# undef RUBY3_HAS_DECLSPEC_ATTRIBUTE_nothrow
# endif
#endif
#endif /* RUBY3_HAS_DECLSPEC_ATTRIBUTE_H */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_HAS_EXTENSION_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_HAS_EXTENSION_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -21,13 +23,11 @@
#include "ruby/3/has/feature.h"
/** Wraps (or simulates) `__has_extension`. */
#if defined(RUBY3_HAS_EXTENSION)
# /* Take that. */
#elif defined(__has_extension)
#if 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
#endif /* RUBY3_HAS_EXTENSION_H */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_HAS_FEATURE_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_HAS_FEATURE_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -20,12 +22,10 @@
*/
/** Wraps (or simulates) `__has_feature`. */
#if defined(RUBY3_HAS_FEATURE)
# /* Take that. */
#elif defined(__has_feature)
#if defined(__has_feature)
# define RUBY3_HAS_FEATURE(_) __has_feature(_)
#else
# define RUBY3_HAS_FEATURE(_) 0
#endif
#endif /* RUBY3_HAS_FEATURE_H */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_HAS_WARNING_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_HAS_WARNING_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -20,12 +22,10 @@
*/
/** Wraps (or simulates) `__has_warning`. */
#if defined(RUBY3_HAS_WARNING)
# /* Take that. */
#elif defined(__has_warning)
#if defined(__has_warning)
# define RUBY3_HAS_WARNING(_) __has_warning(_)
#else
# define RUBY3_HAS_WARNING(_) 0
#endif
#endif /* RUBY3_HAS_WARNING_H */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_INTERN_ARRAY_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_INTERN_ARRAY_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Public APIs related to ::rb_cArray.
*/
#ifndef RUBY3_INTERN_ARRAY_H
#define RUBY3_INTERN_ARRAY_H
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_INTERN_BIGNUM_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_INTERN_BIGNUM_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Public APIs related to so-called rb_cBignum.
*/
#ifndef RUBY3_INTERN_BIGNUM_H
#define RUBY3_INTERN_BIGNUM_H
#include "ruby/3/config.h"
#ifdef STDC_HEADERS

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_INTERN_CLASS_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_INTERN_CLASS_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Public APIs related to ::rb_cClass/::rb_cModule.
*/
#ifndef RUBY3_INTERN_CLASS_H
#define RUBY3_INTERN_CLASS_H
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"
#include "ruby/backward/2/stdarg.h"

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_INTERN_COMPAR_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_INTERN_COMPAR_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Public APIs related to ::rb_mComparable.
*/
#ifndef RUBY3_INTERN_COMPAR_H
#define RUBY3_INTERN_COMPAR_H
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_INTERN_COMPLEX_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_INTERN_COMPLEX_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Public APIs related to ::rb_cComplex.
*/
#ifndef RUBY3_INTERN_COMPLEX_H
#define RUBY3_INTERN_COMPLEX_H
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"
#include "ruby/3/arithmetic/long.h" /* INT2FIX is here. */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_INTERN_CONT_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_INTERN_CONT_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Public APIs related to rb_cFiber.
*/
#ifndef RUBY3_INTERN_CONT_H
#define RUBY3_INTERN_CONT_H
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"
#include "ruby/3/iterator.h"

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_INTERN_DIR_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_INTERN_DIR_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Public APIs related to ::rb_cDir.
*/
#ifndef RUBY3_INTERN_DIR_H
#define RUBY3_INTERN_DIR_H
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_INTERN_ENUM_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_INTERN_ENUM_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Public APIs related to ::rb_mEnumerable.
*/
#ifndef RUBY3_INTERN_ENUM_H
#define RUBY3_INTERN_ENUM_H
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_INTERN_ENUMERATOR_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_INTERN_ENUMERATOR_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Public APIs related to ::rb_cEnumerator.
*/
#ifndef RUBY3_INTERN_ENUMERATOR_H
#define RUBY3_INTERN_ENUMERATOR_H
#include "ruby/3/dllexport.h"
#include "ruby/3/intern/eval.h" /* rb_frame_this_func */
#include "ruby/3/iterator.h" /* rb_block_given_p */

Просмотреть файл

@ -1,4 +1,6 @@
/** \noop-*-C++-*-vi:ft=cpp
#ifndef RUBY3_INTERN_ERROR_H /*-*-C++-*-vi:se ft=cpp:*/
#define RUBY3_INTERN_ERROR_H
/**
* @file
* @author Ruby developers <ruby-core@ruby-lang.org>
* @copyright This file is a part of the programming language Ruby.
@ -18,8 +20,6 @@
* extension libraries. They could be written in C++98.
* @brief Public APIs related to ::rb_eException.
*/
#ifndef RUBY3_INTERN_ERROR_H
#define RUBY3_INTERN_ERROR_H
#include "ruby/3/dllexport.h"
#include "ruby/3/value.h"
#include "ruby/3/fl_type.h"

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше