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
--- 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_