Bug 1285665 - avoid #define'ing constants that expand to use defined(); r=dholbert

Newer versions of clang warn about this construct, as the behavior is
not consistent between compilers.  These warnings break
warnings-as-error builds, and seem like reasonable warnings to fix, so
let's do that.

X86_OR_PPC was only used in one place, so inlining it and getting rid of
the definition seemed reasonable.
This commit is contained in:
Nathan Froyd 2016-07-20 00:50:02 -04:00
Родитель 1c7377b2ae
Коммит 1d13f4878d
1 изменённых файлов: 16 добавлений и 9 удалений

Просмотреть файл

@ -34,14 +34,20 @@ static CriticalAddress gCriticalAddress;
#include <dlfcn.h>
#endif
#define MOZ_STACKWALK_SUPPORTS_MACOSX \
(defined(XP_DARWIN) && \
(defined(__i386) || defined(__ppc__) || defined(HAVE__UNWIND_BACKTRACE)))
#if (defined(XP_DARWIN) && \
(defined(__i386) || defined(__ppc__) || defined(HAVE__UNWIND_BACKTRACE)))
#define MOZ_STACKWALK_SUPPORTS_MACOSX 1
#else
#define MOZ_STACKWALK_SUPPORTS_MACOSX 0
#endif
#define MOZ_STACKWALK_SUPPORTS_LINUX \
(defined(linux) && \
((defined(__GNUC__) && (defined(__i386) || defined(PPC))) || \
defined(HAVE__UNWIND_BACKTRACE)))
#if (defined(linux) && \
((defined(__GNUC__) && (defined(__i386) || defined(PPC))) || \
defined(HAVE__UNWIND_BACKTRACE)))
#define MOZ_STACKWALK_SUPPORTS_LINUX 1
#else
#define MOZ_STACKWALK_SUPPORTS_LINUX 0
#endif
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1)
#define HAVE___LIBC_STACK_END 1
@ -885,8 +891,9 @@ void DemangleSymbol(const char* aSymbol,
#endif // MOZ_DEMANGLE_SYMBOLS
}
#define X86_OR_PPC (defined(__i386) || defined(PPC) || defined(__ppc__))
#if X86_OR_PPC && (MOZ_STACKWALK_SUPPORTS_MACOSX || MOZ_STACKWALK_SUPPORTS_LINUX) // i386 or PPC Linux or Mac stackwalking code
// {x86, ppc} x {Linux, Mac} stackwalking code.
#if ((defined(__i386) || defined(PPC) || defined(__ppc__)) && \
(MOZ_STACKWALK_SUPPORTS_MACOSX || MOZ_STACKWALK_SUPPORTS_LINUX))
MFBT_API bool
MozStackWalk(MozWalkStackCallback aCallback, uint32_t aSkipFrames,