Bug 1324093 - Part 0: Use MOZ_{BEGIN,END}_EXTERN_C in Assertions.h. r=froydnj
☠☠ backed out by 2b2ae61e73f5 ☠ ☠
authorDavid Major <dmajor@mozilla.com>
Fri, 13 Jan 2017 13:58:22 +1300
changeset 329236 865a34953fb530f32a31fa1915be9a0aa1f3941a
parent 329235 9a2ec0f36fbce944f487ef0bd215729eaba21e62
child 329237 d3cc90db1908a37934800e45e3b83a1883ca138b
push id31201
push usercbook@mozilla.com
push dateFri, 13 Jan 2017 09:20:42 +0000
treeherdermozilla-central@91f5293e9a89 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1324093
milestone53.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 1324093 - Part 0: Use MOZ_{BEGIN,END}_EXTERN_C in Assertions.h. r=froydnj Drive-by cleanup. MozReview-Commit-ID: CX7eY5dXWaj
mfbt/Assertions.h
--- a/mfbt/Assertions.h
+++ b/mfbt/Assertions.h
@@ -49,25 +49,21 @@ AnnotateMozCrashReason(const char* reaso
 #include <stdlib.h>
 #ifdef WIN32
    /*
     * TerminateProcess and GetCurrentProcess are defined in <winbase.h>, which
     * further depends on <windef.h>.  We hardcode these few definitions manually
     * because those headers clutter the global namespace with a significant
     * number of undesired macros and symbols.
     */
-#  ifdef __cplusplus
-extern "C" {
-#  endif
+MOZ_BEGIN_EXTERN_C
 __declspec(dllimport) int __stdcall
 TerminateProcess(void* hProcess, unsigned int uExitCode);
 __declspec(dllimport) void* __stdcall GetCurrentProcess(void);
-#  ifdef __cplusplus
-}
-#  endif
+MOZ_END_EXTERN_C
 #else
 #  include <signal.h>
 #endif
 #ifdef ANDROID
 #  include <android/log.h>
 #endif
 
 /*
@@ -137,19 +133,17 @@ TerminateProcess(void* hProcess, unsigne
        extern void MOZ_STATIC_ASSERT_GLUE(moz_static_assert, __LINE__)(int arg[(cond) ? 1 : -1]) MOZ_STATIC_ASSERT_UNUSED_ATTRIBUTE
 #  endif
 
 #define MOZ_STATIC_ASSERT_IF(cond, expr, reason)  MOZ_STATIC_ASSERT(!(cond) || (expr), reason)
 #else
 #define MOZ_STATIC_ASSERT_IF(cond, expr, reason)  static_assert(!(cond) || (expr), reason)
 #endif
 
-#ifdef __cplusplus
-extern "C" {
-#endif
+MOZ_BEGIN_EXTERN_C
 
 /*
  * Prints |aStr| as an assertion failure (using aFilename and aLine as the
  * location of the assertion) to the standard debug-output channel.
  *
  * Usually you should use MOZ_ASSERT or MOZ_CRASH instead of this method.  This
  * method is primarily for internal use in this header, and only secondarily
  * for use in implementing release-build assertions.
@@ -281,19 +275,17 @@ MOZ_ReportCrash(const char* aStr, const 
 #  define MOZ_CRASH(...) \
      do { \
        MOZ_ReportCrash("" __VA_ARGS__, __FILE__, __LINE__); \
        MOZ_CRASH_ANNOTATE("MOZ_CRASH(" __VA_ARGS__ ")"); \
        MOZ_REALLY_CRASH(); \
      } while (0)
 #endif
 
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
+MOZ_END_EXTERN_C
 
 /*
  * MOZ_ASSERT(expr [, explanation-string]) asserts that |expr| must be truthy in
  * debug builds.  If it is, execution continues.  Otherwise, an error message
  * including the expression and the explanation-string (if provided) is printed,
  * an attempt is made to invoke any existing debugger, and execution halts.
  * MOZ_ASSERT is fatal: no recovery is possible.  Do not assert a condition
  * which can correctly be falsy.