Bug 895322 - Part 4: Only use MOZ_STATIC_ASSERT in mar.h when we're compiling C code; r=Waldo
authorEhsan Akhgari <ehsan@mozilla.com>
Thu, 18 Jul 2013 14:36:39 -0400
changeset 152876 851bab4e2e3a68c5f7b7f3b17cb7d1acd7a893d5
parent 152875 9ca5f17400173a2c176b9888802dbdcb8d448b07
child 152877 b5506e604ae47f5b764450bfef41f5245fbd9529
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersWaldo
bugs895322
milestone25.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 895322 - Part 4: Only use MOZ_STATIC_ASSERT in mar.h when we're compiling C code; r=Waldo
modules/libmar/src/mar.h
--- a/modules/libmar/src/mar.h
+++ b/modules/libmar/src/mar.h
@@ -16,17 +16,21 @@ extern "C" {
 
 /* We have a MAX_SIGNATURES limit so that an invalid MAR will never
  * waste too much of either updater's or signmar's time.
  * It is also used at various places internally and will affect memory usage.
  * If you want to increase this value above 9 then you need to adjust parsing
  * code in tool/mar.c.
 */
 #define MAX_SIGNATURES 8
+#ifdef __cplusplus
+static_assert(MAX_SIGNATURES <= 9, "too many signatures");
+#else
 MOZ_STATIC_ASSERT(MAX_SIGNATURES <= 9, "too many signatures");
+#endif
 
 struct ProductInformationBlock {
   const char *MARChannelID;
   const char *productVersion;
 };
 
 /**
  * The MAR item data structure.