Bug 1373562 part 2 - Apply source annotatoins for static analysis only when the compiler is clang. r?ehsan
We need this when clang-cl fails compilation and falls back to MSVC,
which doesn't understand the keyword.
MozReview-Commit-ID: 5Vb0km1B31R
--- a/gfx/skia/skia/include/config/SkUserConfig.h
+++ b/gfx/skia/skia/include/config/SkUserConfig.h
@@ -153,17 +153,17 @@
#define SK_RASTERIZE_EVEN_ROUNDING
#define SK_DISABLE_SCREENSPACE_TESS_AA_PATH_RENDERER
#define SK_DISABLE_SLOW_DEBUG_VALIDATION 1
#ifndef MOZ_IMPLICIT
-# ifdef MOZ_CLANG_PLUGIN
+# if defined(MOZ_CLANG_PLUGIN) && defined(__clang__)
# define MOZ_IMPLICIT __attribute__((annotate("moz_implicit")))
# else
# define MOZ_IMPLICIT
# endif
#endif
#define MOZ_SKIA
--- a/mfbt/Attributes.h
+++ b/mfbt/Attributes.h
@@ -570,17 +570,17 @@
* within the calling block using an explicit `return` statement.
* Only calls to Constructors, references to local and member variables,
* and calls to functions or methods marked as MOZ_MAY_CALL_AFTER_MUST_RETURN
* may be made after the MUST_RETURN_FROM_CALLER call.
* MOZ_MAY_CALL_AFTER_MUST_RETURN: Applies to function or method declarations.
* Calls to these methods may be made in functions after calls a
* MOZ_MUST_RETURN_FROM_CALLER function or method.
*/
-#ifdef MOZ_CLANG_PLUGIN
+#if defined(MOZ_CLANG_PLUGIN) && defined(__clang__)
# define MOZ_MUST_OVERRIDE __attribute__((annotate("moz_must_override")))
# define MOZ_STACK_CLASS __attribute__((annotate("moz_stack_class")))
# define MOZ_NONHEAP_CLASS __attribute__((annotate("moz_nonheap_class")))
# define MOZ_HEAP_CLASS __attribute__((annotate("moz_heap_class")))
# define MOZ_NON_TEMPORARY_CLASS __attribute__((annotate("moz_non_temporary_class")))
# define MOZ_TRIVIAL_CTOR_DTOR __attribute__((annotate("moz_trivial_ctor_dtor")))
# ifdef DEBUG
/* in debug builds, these classes do have non-trivial constructors. */