Bug 1277448 patch 1 - Move __func__ polyfill for older MSVC versions from xpcom/base/Logging.h to mfbt/Assertions.h r?Waldo draft
authorL. David Baron <dbaron@dbaron.org>
Tue, 21 Jun 2016 17:18:32 -0700
changeset 380425 f0de2cc9065447e43a7bd439e79f6f208d71eb8e
parent 380354 51377a64158941f89ed73f388ae437cfa494c030
child 380426 4145f083f15c70e1a29f7b02107429645fa137e3
push id21224
push userdbaron@mozilla.com
push dateWed, 22 Jun 2016 00:18:41 +0000
reviewersWaldo
bugs1277448
milestone50.0a1
Bug 1277448 patch 1 - Move __func__ polyfill for older MSVC versions from xpcom/base/Logging.h to mfbt/Assertions.h r?Waldo Note that xpcom/base/Logging.h currently includes mfbt/Assertions.h (as mozilla/Assertions.h). MozReview-Commit-ID: IQYssp747R3
mfbt/Assertions.h
xpcom/base/Logging.h
--- a/mfbt/Assertions.h
+++ b/mfbt/Assertions.h
@@ -16,16 +16,27 @@
 #include "mozilla/Attributes.h"
 #include "mozilla/Compiler.h"
 #include "mozilla/Likely.h"
 #include "mozilla/MacroArgs.h"
 #ifdef MOZ_DUMP_ASSERTION_STACK
 #include "nsTraceRefcnt.h"
 #endif
 
+/*
+ * __func__ was standardized in C++11 and is supported by clang, gcc, and MSVC
+ * 2015. Here we polyfill __func__ for earlier versions of MSVC.
+ * http://blogs.msdn.com/b/vcblog/archive/2015/06/19/c-11-14-17-features-in-vs-2015-rtm.aspx
+ */
+#ifdef _MSC_VER
+#  if _MSC_VER < 1900
+#    define __func__ __FUNCTION__
+#  endif
+#endif
+
 #if defined(MOZ_CRASHREPORTER) && defined(MOZILLA_INTERNAL_API) && \
     !defined(MOZILLA_EXTERNAL_LINKAGE) && defined(__cplusplus)
 namespace CrashReporter {
 // This declaration is present here as well as in nsExceptionHandler.h
 // nsExceptionHandler.h is not directly included in this file as it includes
 // windows.h, which can cause problems when it is imported into some files due
 // to the number of macros defined.
 // XXX If you change this definition - also change the definition in
--- a/xpcom/base/Logging.h
+++ b/xpcom/base/Logging.h
@@ -220,24 +220,13 @@ void log_print(const LogModule* aModule,
     if (MOZ_LOG_TEST(_module,_level)) { \
       mozilla::detail::log_print(_module, _level, MOZ_LOG_EXPAND_ARGS _args);         \
     }                     \
   PR_END_MACRO
 
 #undef PR_LOG
 #undef PR_LOG_TEST
 
-/*
- * __func__ was standardized in C++11 and is supported by clang, gcc, and MSVC
- * 2015. Here we polyfill __func__ for earlier versions of MSVC.
- * http://blogs.msdn.com/b/vcblog/archive/2015/06/19/c-11-14-17-features-in-vs-2015-rtm.aspx
- */
-#ifdef _MSC_VER
-#  if _MSC_VER < 1900
-#    define __func__ __FUNCTION__
-#  endif
-#endif
-
 // This #define is a Logging.h-only knob!  Don't encourage people to get fancy
 // with their log definitions by exporting it outside of Logging.h.
 #undef MOZ_LOGGING_ENABLED
 
 #endif // mozilla_logging_h