Bug 916568 - Remove xpcom/base/nsErrorAsserts.cpp; r=ehsan

This commit is contained in:
Aryeh Gregor 2013-09-17 14:05:12 +03:00
parent fd18d7f13c
commit 29f6c717cd
3 changed files with 6 additions and 11 deletions

View File

@ -91,7 +91,6 @@ CPP_SOURCES += [
'nsConsoleService.cpp',
'nsCycleCollector.cpp',
'nsDebugImpl.cpp',
'nsErrorAsserts.cpp',
'nsErrorService.cpp',
'nsGZFileWriter.cpp',
'nsInterfaceRequestorAgg.cpp',

View File

@ -181,6 +181,12 @@ inline uint32_t NS_FAILED_impl(nsresult _nsresult) {
}
#define NS_FAILED(_nsresult) ((bool)MOZ_UNLIKELY(NS_FAILED_impl(_nsresult)))
#define NS_SUCCEEDED(_nsresult) ((bool)MOZ_LIKELY(!NS_FAILED_impl(_nsresult)))
/* Check that our enum type is actually uint32_t as expected */
static_assert(((nsresult)0) < ((nsresult)-1),
"nsresult must be an unsigned type");
static_assert(sizeof(nsresult) == sizeof(uint32_t),
"nsresult must be 32 bits");
#else
#define NS_FAILED_impl(_nsresult) ((_nsresult) & 0x80000000)
#define NS_FAILED(_nsresult) (MOZ_UNLIKELY(NS_FAILED_impl(_nsresult)))

View File

@ -1,10 +0,0 @@
#include "mozilla/Assertions.h"
#include "nsError.h"
// No reason to pull in Assertions.h for every single file that includes
// nsError.h, so let's put this in its own .cpp file instead of in the .h.
static_assert(((nsresult)0) < ((nsresult)-1),
"nsresult must be an unsigned type");
static_assert(sizeof(nsresult) == sizeof(uint32_t),
"nsresult must be 32 bits");