Bug 1447480 - Add support of MOZ_FALLTHROUGH_ASSERT without any argument r?hsivonen draft
authorSylvestre Ledru <sledru@mozilla.com>
Thu, 05 Apr 2018 11:42:23 +0200
changeset 778362 138153b71b519f21dfb65e02225ba07c19b0b928
parent 777176 1d13ea7e71536bbd3b08a3839f91026b31976a3f
push id105475
push userbmo:sledru@mozilla.com
push dateFri, 06 Apr 2018 07:50:22 +0000
reviewershsivonen
bugs1447480
milestone61.0a1
Bug 1447480 - Add support of MOZ_FALLTHROUGH_ASSERT without any argument r?hsivonen MozReview-Commit-ID: 6xrdrggcVFR
mfbt/Assertions.h
--- a/mfbt/Assertions.h
+++ b/mfbt/Assertions.h
@@ -591,17 +591,17 @@ struct AssertionConditionType
  *   default:
  *     // This case asserts in debug builds, falls through in release.
  *     MOZ_FALLTHROUGH_ASSERT("Unexpected foo value?!");
  *   case 5:
  *     return 5;
  * }
  */
 #ifdef DEBUG
-#  define MOZ_FALLTHROUGH_ASSERT(reason) MOZ_CRASH("MOZ_FALLTHROUGH_ASSERT: " reason)
+#  define MOZ_FALLTHROUGH_ASSERT(...) MOZ_CRASH("MOZ_FALLTHROUGH_ASSERT: " __VA_ARGS__)
 #else
 #  define MOZ_FALLTHROUGH_ASSERT(...) MOZ_FALLTHROUGH
 #endif
 
 /*
  * MOZ_ALWAYS_TRUE(expr) and MOZ_ALWAYS_FALSE(expr) always evaluate the provided
  * expression, in debug builds and in release builds both.  Then, in debug
  * builds only, the value of the expression is asserted either true or false