mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
RUBY_ATTR_ALOC_SIZE for clang
clang also supports __attribute__((__alloc_size__)) so why not use it when the compiler says it does.
This commit is contained in:
parent
63f70eb651
commit
2c889e9b05
1 changed files with 6 additions and 1 deletions
|
@ -217,7 +217,12 @@ RUBY_SYMBOL_EXPORT_BEGIN
|
||||||
|
|
||||||
#if GCC_VERSION_SINCE(4,3,0)
|
#if GCC_VERSION_SINCE(4,3,0)
|
||||||
# define RUBY_ATTR_ALLOC_SIZE(params) __attribute__ ((alloc_size params))
|
# define RUBY_ATTR_ALLOC_SIZE(params) __attribute__ ((alloc_size params))
|
||||||
#else
|
#elif defined(__has_attribute)
|
||||||
|
# if __has_attribute(alloc_size)
|
||||||
|
# define RUBY_ATTR_ALLOC_SIZE(params) __attribute__((__alloc_size__ params))
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
#ifndef RUBY_ATTR_ALLOC_SIZE
|
||||||
# define RUBY_ATTR_ALLOC_SIZE(params)
|
# define RUBY_ATTR_ALLOC_SIZE(params)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue