#ifndef RUBY_BACKWARD2_ATTRIBUTES_H /*-*-C++-*-vi:se ft=cpp:*/ #define RUBY_BACKWARD2_ATTRIBUTES_H /** * @author Ruby developers * @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 `RBIMPL` or `rbimpl` 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 Various attribute-related macros. * * ### Q&A ### * * - Q: Why are the macros defined in this header file so inconsistent in * style? * * - A: Don't know. Don't blame me. Backward compatibility is the key here. * I'm just preserving what they have been. */ #include "ruby/internal/config.h" #include "ruby/internal/attr/alloc_size.h" #include "ruby/internal/attr/cold.h" #include "ruby/internal/attr/const.h" #include "ruby/internal/attr/deprecated.h" #include "ruby/internal/attr/error.h" #include "ruby/internal/attr/forceinline.h" #include "ruby/internal/attr/format.h" #include "ruby/internal/attr/maybe_unused.h" #include "ruby/internal/attr/noinline.h" #include "ruby/internal/attr/nonnull.h" #include "ruby/internal/attr/noreturn.h" #include "ruby/internal/attr/pure.h" #include "ruby/internal/attr/restrict.h" #include "ruby/internal/attr/returns_nonnull.h" #include "ruby/internal/attr/warning.h" #include "ruby/internal/has/attribute.h" /* function attributes */ #undef CONSTFUNC #define CONSTFUNC(x) RBIMPL_ATTR_CONST() x #undef PUREFUNC #define PUREFUNC(x) RBIMPL_ATTR_PURE() x #undef DEPRECATED #define DEPRECATED(x) RBIMPL_ATTR_DEPRECATED(("")) x #undef DEPRECATED_BY #define DEPRECATED_BY(n,x) RBIMPL_ATTR_DEPRECATED(("by: " # n)) x #undef DEPRECATED_TYPE #if defined(__GNUC__) # define DEPRECATED_TYPE(mesg, decl) \ _Pragma("message \"DEPRECATED_TYPE is deprecated\""); \ decl RBIMPL_ATTR_DEPRECATED(mseg) #elif defined(_MSC_VER) # pragma deprecated(DEPRECATED_TYPE) # define DEPRECATED_TYPE(mesg, decl) \ __pragma(message(__FILE__"("STRINGIZE(__LINE__)"): warning: " \ "DEPRECATED_TYPE is deprecated")) \ decl RBIMPL_ATTR_DEPRECATED(mseg) #else # define DEPRECATED_TYPE(mesg, decl) \ <-<-"DEPRECATED_TYPE is deprecated"->-> #endif #undef RUBY_CXX_DEPRECATED #define RUBY_CXX_DEPRECATED(mseg) RBIMPL_ATTR_DEPRECATED((mseg)) #undef NOINLINE #define NOINLINE(x) RBIMPL_ATTR_NOINLINE() x #ifndef MJIT_HEADER # undef ALWAYS_INLINE # define ALWAYS_INLINE(x) RBIMPL_ATTR_FORCEINLINE() x #endif #undef ERRORFUNC #define ERRORFUNC(mesg, x) RBIMPL_ATTR_ERROR(mesg) x #if RBIMPL_HAS_ATTRIBUTE(error) # define HAVE_ATTRIBUTE_ERRORFUNC 1 #endif #undef WARNINGFUNC #define WARNINGFUNC(mesg, x) RBIMPL_ATTR_WARNING(mesg) x #if RBIMPL_HAS_ATTRIBUTE(warning) # define HAVE_ATTRIBUTE_WARNINGFUNC 1 #endif /* cold attribute for code layout improvements RUBY_FUNC_ATTRIBUTE not used because MSVC does not like nested func macros */ #undef COLDFUNC #define COLDFUNC RBIMPL_ATTR_COLD() #define PRINTF_ARGS(decl, string_index, first_to_check) \ RBIMPL_ATTR_FORMAT(RBIMPL_PRINTF_FORMAT, (string_index), (first_to_check)) \ decl #undef RUBY_ATTR_ALLOC_SIZE #define RUBY_ATTR_ALLOC_SIZE RBIMPL_ATTR_ALLOC_SIZE #undef RUBY_ATTR_MALLOC #define RUBY_ATTR_MALLOC RBIMPL_ATTR_RESTRICT() #undef RUBY_ATTR_RETURNS_NONNULL #define RUBY_ATTR_RETURNS_NONNULL RBIMPL_ATTR_RETURNS_NONNULL() #ifndef FUNC_MINIMIZED #define FUNC_MINIMIZED(x) x #endif #ifndef FUNC_UNOPTIMIZED #define FUNC_UNOPTIMIZED(x) x #endif #ifndef RUBY_ALIAS_FUNCTION_TYPE #define RUBY_ALIAS_FUNCTION_TYPE(type, prot, name, args) \ FUNC_MINIMIZED(type prot) {return (type)name args;} #endif #ifndef RUBY_ALIAS_FUNCTION_VOID #define RUBY_ALIAS_FUNCTION_VOID(prot, name, args) \ FUNC_MINIMIZED(void prot) {name args;} #endif #ifndef RUBY_ALIAS_FUNCTION #define RUBY_ALIAS_FUNCTION(prot, name, args) \ RUBY_ALIAS_FUNCTION_TYPE(VALUE, prot, name, args) #endif #undef RUBY_FUNC_NONNULL #define RUBY_FUNC_NONNULL(n, x) RBIMPL_ATTR_NONNULL(n) x #undef NORETURN #define NORETURN(x) RBIMPL_ATTR_NORETURN() x #define NORETURN_STYLE_NEW #ifndef PACKED_STRUCT # define PACKED_STRUCT(x) x #endif #ifndef PACKED_STRUCT_UNALIGNED # if UNALIGNED_WORD_ACCESS # define PACKED_STRUCT_UNALIGNED(x) PACKED_STRUCT(x) # else # define PACKED_STRUCT_UNALIGNED(x) x # endif #endif #undef RB_UNUSED_VAR #define RB_UNUSED_VAR(x) x RBIMPL_ATTR_MAYBE_UNUSED() #endif /* RUBY_BACKWARD2_ATTRIBUTES_H */ '>* lib/rubygems: Update to RubyGems master 66e5c39. Notable changes:drbrain 2013-11-22* lib/rubygems: Update to RubyGems master dcce4ff. Important changesdrbrain 2013-11-21* lib/rubygems: Update to RubyGems master 50a8210. Important changesdrbrain 2013-11-19* lib/rubygems: Update to RubyGems master 6a3d9f9. Changes include:drbrain 2013-11-12* lib/rubygems: Update to RubyGems master b9213d7. Changes include:drbrain 2013-11-10* lib/rubygems/specification.rb: Include 2.2.0.preview.2 when checkingdrbrain 2013-11-10* lib/rubygems: Update to RubyGems master 4bdc4f2. Important changesdrbrain 2013-10-20* lib/rubygems: Update to RubyGems master 3de7e0f. Changes:drbrain 2013-10-18* lib/rubygems: Update to RubyGems master 0a3814b. Changes:drbrain 2013-10-18* lib/rubygems: Update to RubyGems master cee6788. Changes:drbrain 2013-10-17* lib/rubygems: Update to RubyGems master f738c67. Changes:drbrain 2013-10-16* lib/rubygems: Update to RubyGems master 2abce58. Changes:drbrain 2013-10-16* lib/rubygems: Update to RubyGems master commit 2a74263. This fixesdrbrain 2013-09-25* lib/rubygems: Fix CVE-2013-4363. Miscellaneous minor improvements.drbrain 2013-09-18* lib/rubygems: Update to RubyGems 2.2.0.preview.1drbrain 2013-09-14Revert r42938 "* lib/rubygems: Update to RubyGems 2.1.3"naruse 2013-09-13* lib/rubygems: Update to RubyGems 2.1.3drbrain 2013-08-26* lib/rubygems: Import RubyGems 2.1.0 Release Candidatedrbrain 2013-07-30* lib/rubygems: Import RubyGems from master as of commit 523551cdrbrain 2013-07-10fix test failure introduced at r41873naruse 2013-07-09* lib/rubygems: Import RubyGems 2.1drbrain 2013-07-08* lib/rubygems: Update to RubyGems 2.0.4. Seedrbrain