mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-26 20:30:41 +00:00
bug 1252104 - make NS_ERROR_GET_CODE() and NS_ERROR_GET_MODULE() constexpr r=froydnj
This commit is contained in:
parent
cb39275975
commit
3a75b440db
@ -11,6 +11,7 @@
|
||||
#error nsError.h no longer supports C sources
|
||||
#endif
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/Likely.h"
|
||||
|
||||
#include <stdint.h>
|
||||
@ -190,12 +191,12 @@ NS_ErrorAccordingToNSPR();
|
||||
* @name Standard Macros for retrieving error bits
|
||||
*/
|
||||
|
||||
inline uint16_t
|
||||
inline MOZ_CONSTEXPR uint16_t
|
||||
NS_ERROR_GET_CODE(nsresult aErr)
|
||||
{
|
||||
return uint32_t(aErr) & 0xffff;
|
||||
}
|
||||
inline uint16_t
|
||||
inline MOZ_CONSTEXPR uint16_t
|
||||
NS_ERROR_GET_MODULE(nsresult aErr)
|
||||
{
|
||||
return ((uint32_t(aErr) >> 16) - NS_ERROR_MODULE_BASE_OFFSET) & 0x1fff;
|
||||
|
Loading…
x
Reference in New Issue
Block a user