diff options
| author | 2016-12-13 09:58:50 -0800 | |
|---|---|---|
| committer | 2016-12-13 10:20:33 -0800 | |
| commit | fb952c399e1ba5435e8f76a34f609be5fd64f4eb (patch) | |
| tree | 3139b2d7f6592026a46cc5deea9bf224846432e1 /src/common/file_util.cpp | |
| parent | Merge pull request #2166 from endrift/clang-detect (diff) | |
| download | yuzu-fb952c399e1ba5435e8f76a34f609be5fd64f4eb.tar.gz yuzu-fb952c399e1ba5435e8f76a34f609be5fd64f4eb.tar.xz yuzu-fb952c399e1ba5435e8f76a34f609be5fd64f4eb.zip | |
Common: Fix gcc build on macOS
Diffstat (limited to 'src/common/file_util.cpp')
| -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> |