Bug 1060419 - make xpcom/glue/nsDebug.h use Printf.h, r=froydnj
authorTom Tromey <tom@tromey.com>
Fri, 09 Dec 2016 10:50:37 -1000
changeset 343550 c6e12df0792f6c532982860663bb55a122d4f1e6
parent 343549 11812794175e5614b7025cb7a25fa7037da88890
child 343551 2e15220e1106db5066dd38402392170ad22053ed
push id31381
push userkwierso@gmail.com
push dateFri, 17 Feb 2017 20:45:51 +0000
treeherdermozilla-central@f302def88fe5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1060419
milestone54.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1060419 - make xpcom/glue/nsDebug.h use Printf.h, r=froydnj MozReview-Commit-ID: 3nau1fJbnuX
xpcom/base/nsDebug.h
--- 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");