1
0
Fork 0
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:
卜部昌平 2019-11-01 14:32:05 +09:00
parent 63f70eb651
commit 2c889e9b05

View file

@ -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