зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1907001 - Add MOZ_HAS_CLANG_ATTRIBUTE r=glandium
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:
Родитель
77de6a9c73
Коммит
29c55a7924
|
@ -78,6 +78,13 @@
|
|||
# define MOZ_HAVE_NO_STACK_PROTECTOR __attribute__((no_stack_protector))
|
||||
#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
|
||||
* to mark some false positives
|
||||
|
@ -88,15 +95,13 @@
|
|||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) || \
|
||||
(defined(__clang__) && __has_attribute(no_profile_instrument_function))
|
||||
#if defined(__GNUC__) || MOZ_HAS_CLANG_ATTRIBUTE(no_profile_instrument_function)
|
||||
# define MOZ_NOPROFILE __attribute__((no_profile_instrument_function))
|
||||
#else
|
||||
# define MOZ_NOPROFILE
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) || \
|
||||
(defined(__clang__) && __has_attribute(no_instrument_function))
|
||||
#if defined(__GNUC__) || (MOZ_HAS_CLANG_ATTRIBUTE(no_instrument_function))
|
||||
# define MOZ_NOINSTRUMENT __attribute__((no_instrument_function))
|
||||
#else
|
||||
# define MOZ_NOINSTRUMENT
|
||||
|
@ -121,7 +126,7 @@
|
|||
*
|
||||
* 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))
|
||||
#else
|
||||
# define MOZ_NOMERGE
|
||||
|
|
Загрузка…
Ссылка в новой задаче