Bug 712939 - Replace JS_STATIC_ASSERT with static_assert outside js/ directory. r=mccr8
authorChris Peterson <cpeterson@mozilla.com>
Mon, 17 Feb 2014 23:56:19 -0800
changeset 169990 9da5cb817aae508800351853a862a1f7ab9e52e0
parent 169989 b1d92f0829531ee34cfe5d14f6b276023f52911d
child 169991 c952f7937ec1eb1251fef2d3d506b63b2ed6445c
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersmccr8
bugs712939
milestone30.0a1
Bug 712939 - Replace JS_STATIC_ASSERT with static_assert outside js/ directory. r=mccr8
dom/plugins/base/nsNPAPIPlugin.h
tools/profiler/PseudoStack.h
xpcom/base/CycleCollectedJSRuntime.cpp
--- a/dom/plugins/base/nsNPAPIPlugin.h
+++ b/dom/plugins/base/nsNPAPIPlugin.h
@@ -65,17 +65,18 @@ protected:
   NPPluginFuncs mPluginFuncs;
   PluginLibrary* mLibrary;
 };
 
 namespace mozilla {
 namespace plugins {
 namespace parent {
 
-JS_STATIC_ASSERT(sizeof(NPIdentifier) == sizeof(jsid));
+static_assert(sizeof(NPIdentifier) == sizeof(jsid),
+              "NPIdentifier must be binary compatible with jsid.");
 
 inline jsid
 NPIdentifierToJSId(NPIdentifier id)
 {
     jsid tmp;
     JSID_BITS(tmp) = (size_t)id;
     return tmp;
 }
--- a/tools/profiler/PseudoStack.h
+++ b/tools/profiler/PseudoStack.h
@@ -377,17 +377,18 @@ public:
 
   void sampleRuntime(JSRuntime *runtime) {
     mRuntime = runtime;
     if (!runtime) {
       // JS shut down
       return;
     }
 
-    JS_STATIC_ASSERT(sizeof(mStack[0]) == sizeof(js::ProfileEntry));
+    static_assert(sizeof(mStack[0]) == sizeof(js::ProfileEntry),
+                  "mStack must be binary compatible with js::ProfileEntry.");
     js::SetRuntimeProfilingStack(runtime,
                                  (js::ProfileEntry*) mStack,
                                  (uint32_t*) &mStackPointer,
                                  uint32_t(mozilla::ArrayLength(mStack)));
     if (mStartJSSampling)
       enableJSSampling();
   }
   void enableJSSampling() {
--- a/xpcom/base/CycleCollectedJSRuntime.cpp
+++ b/xpcom/base/CycleCollectedJSRuntime.cpp
@@ -544,17 +544,18 @@ CycleCollectedJSRuntime::DescribeGCThing
       "String",
       "Script",
       "LazyScript",
       "IonCode",
       "Shape",
       "BaseShape",
       "TypeObject",
     };
-    JS_STATIC_ASSERT(MOZ_ARRAY_LENGTH(trace_types) == JSTRACE_LAST + 1);
+    static_assert(MOZ_ARRAY_LENGTH(trace_types) == JSTRACE_LAST + 1,
+                  "Length of trace_types should match the number of cases of JSGCTraceKind.");
     JS_snprintf(name, sizeof(name), "JS %s", trace_types[aTraceKind]);
   }
 
   // Disable printing global for objects while we figure out ObjShrink fallout.
   aCb.DescribeGCedNode(aIsMarked, name, compartmentAddress);
 }
 
 void