forked from mirrors/gecko-dev
Bug 1907001 - Add MOZ_HAS_CLANG_ATTRIBUTE r=glandium, a=dmeehan
Note this patch was provided by a contributor to fix MSVC builds of a SpiderMonkey embedding. Differential Revision: https://phabricator.services.mozilla.com/D216843
This commit is contained in:
parent
ed104e489e
commit
82bcb0fe7d
1 changed files with 10 additions and 5 deletions
|
|
@ -78,6 +78,13 @@
|
||||||
# define MOZ_HAVE_NO_STACK_PROTECTOR __attribute__((no_stack_protector))
|
# define MOZ_HAVE_NO_STACK_PROTECTOR __attribute__((no_stack_protector))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* if defined(__clang__) && __has_attribute (attr) may not be portable */
|
||||||
|
#if defined(__clang__)
|
||||||
|
# define MOZ_HAS_CLANG_ATTRIBUTE(attr) __has_attribute(attr)
|
||||||
|
#else
|
||||||
|
# define MOZ_HAS_CLANG_ATTRIBUTE(attr) 0
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* When built with clang analyzer (a.k.a scan-build), define MOZ_HAVE_NORETURN
|
* When built with clang analyzer (a.k.a scan-build), define MOZ_HAVE_NORETURN
|
||||||
* to mark some false positives
|
* to mark some false positives
|
||||||
|
|
@ -88,15 +95,13 @@
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) || \
|
#if defined(__GNUC__) || MOZ_HAS_CLANG_ATTRIBUTE(no_profile_instrument_function)
|
||||||
(defined(__clang__) && __has_attribute(no_profile_instrument_function))
|
|
||||||
# define MOZ_NOPROFILE __attribute__((no_profile_instrument_function))
|
# define MOZ_NOPROFILE __attribute__((no_profile_instrument_function))
|
||||||
#else
|
#else
|
||||||
# define MOZ_NOPROFILE
|
# define MOZ_NOPROFILE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) || \
|
#if defined(__GNUC__) || (MOZ_HAS_CLANG_ATTRIBUTE(no_instrument_function))
|
||||||
(defined(__clang__) && __has_attribute(no_instrument_function))
|
|
||||||
# define MOZ_NOINSTRUMENT __attribute__((no_instrument_function))
|
# define MOZ_NOINSTRUMENT __attribute__((no_instrument_function))
|
||||||
#else
|
#else
|
||||||
# define MOZ_NOINSTRUMENT
|
# define MOZ_NOINSTRUMENT
|
||||||
|
|
@ -121,7 +126,7 @@
|
||||||
*
|
*
|
||||||
* This is useful to have clearer information on assertion failures.
|
* This is useful to have clearer information on assertion failures.
|
||||||
*/
|
*/
|
||||||
#if defined(__clang__) && __has_attribute(nomerge)
|
#if MOZ_HAS_CLANG_ATTRIBUTE(nomerge)
|
||||||
# define MOZ_NOMERGE __attribute__((nomerge))
|
# define MOZ_NOMERGE __attribute__((nomerge))
|
||||||
#else
|
#else
|
||||||
# define MOZ_NOMERGE
|
# define MOZ_NOMERGE
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue