mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 21:32:45 +00:00
(Apple/Clang/ARC) ARC (Automatic Reference Counting) only available (#11920)
since Clang. PowerPC Mac is stuck with GCC and predates the use of ARC, __has_feature() also is a Clang extension, so wrap around this with a conditional so that GCC PowerPC on Mac can still work
This commit is contained in:
parent
7d56bf2b0a
commit
746101010f
@ -85,6 +85,8 @@ extern apple_frontend_settings_t apple_frontend_settings;
|
||||
#define BOXUINT(x) [NSNumber numberWithUnsignedInt:x]
|
||||
#define BOXFLOAT(x) [NSNumber numberWithDouble:x]
|
||||
|
||||
#if defined(__clang__)
|
||||
/* ARC is only available for Clang */
|
||||
#if __has_feature(objc_arc)
|
||||
#define RELEASE(x) x = nil
|
||||
#define BRIDGE __bridge
|
||||
@ -95,6 +97,14 @@ extern apple_frontend_settings_t apple_frontend_settings;
|
||||
#define BRIDGE
|
||||
#define UNSAFE_UNRETAINED
|
||||
#endif
|
||||
#else
|
||||
/* On compilers other than Clang (e.g. GCC), assume ARC
|
||||
is going to be unavailable */
|
||||
#define RELEASE(x) [x release]; \
|
||||
x = nil
|
||||
#define BRIDGE
|
||||
#define UNSAFE_UNRETAINED
|
||||
#endif
|
||||
|
||||
void *nsview_get_ptr(void);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user