mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 09:04:13 +00:00
Separate __has_attribute test from actual usage, as per GCC
documentaiton. The first `#if' test succeeds only when the operator is supported by the version of GCC (or another compiler) being used. Only when that test succeeds is it valid to use __has_attribute as a preprocessor operator. As a result, combining the two tests into a single expression as shown below would only be valid with a compiler that supports the operator but not with others that don't. https://gcc.gnu.org/onlinedocs/cpp/_005f_005fhas_005fattribute.html
This commit is contained in:
parent
2f21360642
commit
943f8d82c3
1 changed files with 6 additions and 2 deletions
|
@ -29,8 +29,12 @@
|
|||
|
||||
#define CF_DEFINES_CG_TYPES
|
||||
|
||||
#if defined(__has_attribute) && __has_attribute(objc_boxable)
|
||||
# define CF_BOXABLE __attribute__((objc_boxable))
|
||||
#if defined __has_attribute
|
||||
# if __has_attribute(objc_boxable)
|
||||
# define CF_BOXABLE __attribute__((objc_boxable))
|
||||
# else
|
||||
# define CF_BOXABLE
|
||||
# endif
|
||||
#else
|
||||
# define CF_BOXABLE
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue