Fix __alloc_size__ availability detection (Clang)
authorYusuke Suzuki <utatane.tea@gmail.com>
Wed, 1 Oct 2014 18:38:02 +0000 (03:38 +0900)
committerIvan Maidanski <ivmai@mail.ru>
Thu, 16 Oct 2014 20:15:12 +0000 (00:15 +0400)
commitb725923951d77f5c6792c2797f89179267c58c9c
tree0beb6cebfd83e4ee7d1f97169a4ef13e71a15b5b
parent734827bf66d135fccd5193b5f9d880ba23b44646
Fix __alloc_size__ availability detection (Clang)

Since __clang_major__/__clang_minor__ etc. are vendor dependent values,
we cannot implement the feature detection based on it.
For example, Apple clang versioning is different from the FreeBSD clang.
(At this time, Apple clang version is "6.0 (clang-600.0.51)" and
__clang_major__ is 6.)
Instead of this, we can use the clang feature detection macro,
__has_attribute.

* include/gc_config_macros.h (GC_ATTR_ALLOC_SIZE): Replace predefined
__clang_major/minor__ testing with __has_attribute() one (in case of
clang).
include/gc_config_macros.h