Bug 1341452 - Use MSC's __FUNCSIG__ or gcc/clang's __PRETTY_FUNCTION__ in MediaResult's RESULT_DETAIL - r=jya
authorGerald Squelart <gsquelart@mozilla.com>
Tue, 21 Feb 2017 14:44:40 +1100
changeset 373367 e14df54573698c69902c68b2f7b10b995cb39fd8
parent 373366 3f649bdc6e81279547ff1f29d9d55dcd39d78ef2
child 373368 76b0a067ca5143487ed6968dab76fbc7c4d45242
push id10863
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 23:02:23 +0000
treeherdermozilla-aurora@0931190cd725 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya
bugs1341452
milestone54.0a1
Bug 1341452 - Use MSC's __FUNCSIG__ or gcc/clang's __PRETTY_FUNCTION__ in MediaResult's RESULT_DETAIL - r=jya Since these are used in diagnostic messages intended for developers, more detailed information should help with distinguishing some issues. E.g.: Before: "Init" After: "virtual RefPtr<MP4Demuxer::InitPromise> mozilla::MP4Demuxer::Init()" MozReview-Commit-ID: TgNNn66Ilj
dom/media/MediaResult.h
--- a/dom/media/MediaResult.h
+++ b/dom/media/MediaResult.h
@@ -54,12 +54,16 @@ public:
     return nsPrintfCString("0x%08" PRIx32 ": %s", static_cast<uint32_t>(mCode), mMessage.get());
   }
 
 private:
   nsresult mCode;
   nsCString mMessage;
 };
 
-#define RESULT_DETAIL(arg, ...) nsPrintfCString("%s: " arg, __func__, ##__VA_ARGS__)
+#ifdef _MSC_VER
+#define RESULT_DETAIL(arg, ...) nsPrintfCString("%s: " arg, __FUNCSIG__, ##__VA_ARGS__)
+#else
+#define RESULT_DETAIL(arg, ...) nsPrintfCString("%s: " arg, __PRETTY_FUNCTION__, ##__VA_ARGS__)
+#endif
 
 } // namespace mozilla
 #endif // MediaResult_h_