From 10a0737dbc6f61663325b374406030144b8d9cae Mon Sep 17 00:00:00 2001 From: Chris Peterson Date: Mon, 17 Feb 2014 22:10:50 -0800 Subject: [PATCH] Bug 712939 - Replace JS_STATIC_ASSERT with static_assert outside js/ directory. r=BenWa r=bsmedberg r=mccr8 --- dom/plugins/base/nsNPAPIPlugin.h | 3 ++- tools/profiler/PseudoStack.h | 3 ++- xpcom/base/CycleCollectedJSRuntime.cpp | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/dom/plugins/base/nsNPAPIPlugin.h b/dom/plugins/base/nsNPAPIPlugin.h index 89f3c5fbde6..64b8c861bf4 100644 --- a/dom/plugins/base/nsNPAPIPlugin.h +++ b/dom/plugins/base/nsNPAPIPlugin.h @@ -70,7 +70,8 @@ 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) diff --git a/tools/profiler/PseudoStack.h b/tools/profiler/PseudoStack.h index d366dfd0c38..98bb01c3365 100644 --- a/tools/profiler/PseudoStack.h +++ b/tools/profiler/PseudoStack.h @@ -382,7 +382,8 @@ public: 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, diff --git a/xpcom/base/CycleCollectedJSRuntime.cpp b/xpcom/base/CycleCollectedJSRuntime.cpp index 1f19a05fe7e..5839b1c1082 100644 --- a/xpcom/base/CycleCollectedJSRuntime.cpp +++ b/xpcom/base/CycleCollectedJSRuntime.cpp @@ -549,7 +549,8 @@ CycleCollectedJSRuntime::DescribeGCThing(bool aIsMarked, void* aThing, "BaseShape", "TypeObject", }; - JS_STATIC_ASSERT(MOZ_ARRAY_LENGTH(trace_types) == JSTRACE_LAST + 1); + static_assert(MOZ_ARRAY_LENGTH(trace_types) == JSTRACE_LAST + 1, + "JSTRACE_LAST enum must match trace_types count."); JS_snprintf(name, sizeof(name), "JS %s", trace_types[aTraceKind]); }