From fb952c399e1ba5435e8f76a34f609be5fd64f4eb Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Tue, 13 Dec 2016 09:58:50 -0800 Subject: [PATCH] Common: Fix gcc build on macOS --- src/common/file_util.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 @@ #endif #if defined(__APPLE__) +// CFURL contains __attribute__ directives that gcc does not know how to parse, so we need to just +// ignore them if we're not using clang. The macro is only used to prevent linking against +// functions that don't exist on older versions of macOS, and the worst case scenario is a linker +// error, so this is perfectly safe, just inconvenient. +#ifndef __clang__ +#define availability(...) +#endif #include #include #include +#ifdef availability +#undef availability +#endif + #endif #include