Feed Clang a pragma to ignore -Wc++11-extensions to let it build Skia on Mac.
authorcommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Mon, 22 Apr 2013 14:39:06 +0000 (14:39 +0000)
committercommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Mon, 22 Apr 2013 14:39:06 +0000 (14:39 +0000)
Tested:
CXX=clang++ ./gyp_skia && ninja -C out/Debug && CXX=G++ ./gyp_skia && ninja -C out/Debug && echo "ok"

Got to ok.

BUG=
R=bungeman@google.com

Author: mtklein@google.com

Review URL: https://chromiumcodereview.appspot.com/14365009

git-svn-id: http://skia.googlecode.com/svn/trunk@8799 2bbb7eff-a529-9590-31e7-b0007b416f81

include/core/SkPostConfig.h

index 86393ed..64768c6 100644 (file)
     #if defined(_MSC_VER)
         #define SK_OVERRIDE override
     #elif defined(__clang__) && !defined(SK_BUILD_FOR_IOS)
+        // Clang defaults to C++03 and warns about using override. Squelch that. Intentionally no
+        // push/pop here so all users of SK_OVERRIDE ignore the warning too. This is like passing
+        // -Wno-c++11-extensions, except that GCC won't die (because it won't see this pragma).
+        #pragma clang diagnostic ignored "-Wc++11-extensions"
+
         #if __has_feature(cxx_override_control)
             // Some documentation suggests we should be using __attribute__((override)),
             // but it doesn't work.