Bug 789643 - Fix `GetCOMPtrCount() defined but not used` warning. r=bsmedberg
authorChris Peterson <cpeterson@mozilla.com>
Fri, 07 Sep 2012 12:32:33 -0700
changeset 104725 423607b0117d2c731a2964bd9142e0eb429f877f
parent 104724 af9abc3c3776a4069da84f9ff4b91912d24fc18e
child 104726 cf39151876dcd6ade840fbe8a373aa3c4f31fc32
push id14649
push usercpeterson@mozilla.com
push dateMon, 10 Sep 2012 19:51:31 +0000
treeherdermozilla-inbound@423607b0117d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs789643
milestone18.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 789643 - Fix `GetCOMPtrCount() defined but not used` warning. r=bsmedberg
xpcom/base/nsTraceRefcntImpl.cpp
--- a/xpcom/base/nsTraceRefcntImpl.cpp
+++ b/xpcom/base/nsTraceRefcntImpl.cpp
@@ -583,25 +583,27 @@ static int32_t* GetRefCount(void* aPtr)
   PLHashEntry** hep = PL_HashTableRawLookup(gSerialNumbers, PLHashNumber(NS_PTR_TO_INT32(aPtr)), aPtr);
   if (hep && *hep) {
     return &((reinterpret_cast<serialNumberRecord*>((*hep)->value))->refCount);
   } else {
     return nullptr;
   }
 }
 
+#if defined(NS_IMPL_REFCNT_LOGGING) && defined(HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR)
 static int32_t* GetCOMPtrCount(void* aPtr)
 {
   PLHashEntry** hep = PL_HashTableRawLookup(gSerialNumbers, PLHashNumber(NS_PTR_TO_INT32(aPtr)), aPtr);
   if (hep && *hep) {
     return &((reinterpret_cast<serialNumberRecord*>((*hep)->value))->COMPtrCount);
   } else {
     return nullptr;
   }
 }
+#endif
 
 static void RecycleSerialNumberPtr(void* aPtr)
 {
   PL_HashTableRemove(gSerialNumbers, aPtr);
 }
 
 static bool LogThisObj(int32_t aSerialNumber)
 {