diff options
| -rw-r--r-- | src/common/file_util.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp index b6161f2dc..c618495f7 100644 --- a/src/common/file_util.cpp +++ b/src/common/file_util.cpp | |||
| @@ -40,9 +40,20 @@ | |||
| 40 | #endif | 40 | #endif |
| 41 | 41 | ||
| 42 | #if defined(__APPLE__) | 42 | #if defined(__APPLE__) |
| 43 | // CFURL contains __attribute__ directives that gcc does not know how to parse, so we need to just | ||
| 44 | // ignore them if we're not using clang. The macro is only used to prevent linking against | ||
| 45 | // functions that don't exist on older versions of macOS, and the worst case scenario is a linker | ||
| 46 | // error, so this is perfectly safe, just inconvenient. | ||
| 47 | #ifndef __clang__ | ||
| 48 | #define availability(...) | ||
| 49 | #endif | ||
| 43 | #include <CoreFoundation/CFBundle.h> | 50 | #include <CoreFoundation/CFBundle.h> |
| 44 | #include <CoreFoundation/CFString.h> | 51 | #include <CoreFoundation/CFString.h> |
| 45 | #include <CoreFoundation/CFURL.h> | 52 | #include <CoreFoundation/CFURL.h> |
| 53 | #ifdef availability | ||
| 54 | #undef availability | ||
| 55 | #endif | ||
| 56 | |||
| 46 | #endif | 57 | #endif |
| 47 | 58 | ||
| 48 | #include <algorithm> | 59 | #include <algorithm> |