Bug 1324093 - Part 0: Use MOZ_{BEGIN,END}_EXTERN_C in Assertions.h. r=froydnj
authorDavid Major <dmajor@mozilla.com>
Wed, 18 Jan 2017 09:32:47 +1300
changeset 329722 9bd54089097bfc41ab6c728ef63736b9168c51ae
parent 329721 148ee5df4dd3138b24d70dfd11b82499beda368c
child 329723 9939303eecf11c1cdba510c7f3f180fb1d4faafd
push id31222
push userryanvm@gmail.com
push dateWed, 18 Jan 2017 14:24:23 +0000
treeherdermozilla-central@5b544b8ab06b [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: 8slQlbS3NS2
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.