Bug 1060419 - make xpcom/glue/nsDebug.h use Printf.h, r?froydnj
MozReview-Commit-ID: 3nau1fJbnuX
--- a/xpcom/base/nsDebug.h
+++ b/xpcom/base/nsDebug.h
@@ -11,17 +11,18 @@
#include "nsError.h"
#include "nsXPCOM.h"
#include "mozilla/Assertions.h"
#include "mozilla/Likely.h"
#include <stdarg.h>
#ifdef DEBUG
-#include "prprf.h"
+#include "mozilla/IntegerPrintfMacros.h"
+#include "mozilla/Printf.h"
#endif
/**
* Warn if the given condition is true. The condition is evaluated in both
* release and debug builds, and the result is an expression which can be
* used in subsequent expressions, such as:
*
* if (NS_WARN_IF(NS_FAILED(rv)) {
@@ -285,26 +286,28 @@ inline void MOZ_PretendNoReturn()
/******************************************************************************
** Macros for checking results
******************************************************************************/
#if defined(DEBUG) && !defined(XPCOM_GLUE_AVOID_NSPR)
#define NS_ENSURE_SUCCESS_BODY(res, ret) \
- char *msg = PR_smprintf("NS_ENSURE_SUCCESS(%s, %s) failed with " \
- "result 0x%X", #res, #ret, __rv); \
+ char *msg = mozilla::Smprintf("NS_ENSURE_SUCCESS(%s, %s) failed with " \
+ "result 0x%" PRIX32, #res, #ret, \
+ static_cast<uint32_t>(__rv)); \
NS_WARNING(msg); \
- PR_smprintf_free(msg);
+ mozilla::SmprintfFree(msg);
#define NS_ENSURE_SUCCESS_BODY_VOID(res) \
- char *msg = PR_smprintf("NS_ENSURE_SUCCESS_VOID(%s) failed with " \
- "result 0x%X", #res, __rv); \
+ char *msg = mozilla::Smprintf("NS_ENSURE_SUCCESS_VOID(%s) failed with " \
+ "result 0x%" PRIX32, #res, \
+ static_cast<uint32_t>(__rv)); \
NS_WARNING(msg); \
- PR_smprintf_free(msg);
+ mozilla::SmprintfFree(msg);
#else
#define NS_ENSURE_SUCCESS_BODY(res, ret) \
NS_WARNING("NS_ENSURE_SUCCESS(" #res ", " #ret ") failed");
#define NS_ENSURE_SUCCESS_BODY_VOID(res) \
NS_WARNING("NS_ENSURE_SUCCESS_VOID(" #res ") failed");