mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
file.c: fix compile error with MacPorts gcc
With the SDK of Xcode 10.2.1, `API_AVAILABLE` and so on macros are not defined in <os/availability.h> when using a compiler other than clang (which has `__has_feature` and `__has_attribute`), but `__API_AVAILABLE` macro and so on are defined, which are also defined in <Availability.h>. I suspect this is a bug of the SDK.
This commit is contained in:
parent
5a840517ae
commit
27a59ca2c8
1 changed files with 8 additions and 0 deletions
8
file.c
8
file.c
|
@ -20,6 +20,14 @@
|
|||
#include <wchar.h>
|
||||
#endif
|
||||
#ifdef __APPLE__
|
||||
# if !(defined(__has_feature) && defined(__has_attribute))
|
||||
/* Maybe a bug in SDK of Xcode 10.2.1 */
|
||||
/* In this condition, <os/availability.h> does not define
|
||||
* API_AVAILABLE and similar, but __API_AVAILABLE and similar which
|
||||
* are defined in <Availability.h> */
|
||||
# define API_AVAILABLE(...)
|
||||
# define API_DEPRECATED(...)
|
||||
# endif
|
||||
#include <CoreFoundation/CFString.h>
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue