Bug 987669 - Just use macros because MSVC and gcc don't have real constexpr support. r=me CLOSED TREE
authorBobby Holley <bobbyholley@gmail.com>
Fri, 11 Jul 2014 09:37:00 -0700
changeset 214415 d257e3805fc79aaf1c023144881ff3d9527c6611
parent 214414 6f10bdf152448668e5f7157673bbaee3bce2aae7
child 214416 e28d922d5d1735954b4f2108ea63ca0ed038df2d
push id3857
push userraliiev@mozilla.com
push dateTue, 02 Sep 2014 16:39:23 +0000
treeherdermozilla-beta@5638b907b505 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs987669
milestone33.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 987669 - Just use macros because MSVC and gcc don't have real constexpr support. r=me CLOSED TREE
js/xpconnect/wrappers/XrayWrapper.cpp
--- a/js/xpconnect/wrappers/XrayWrapper.cpp
+++ b/js/xpconnect/wrappers/XrayWrapper.cpp
@@ -34,38 +34,40 @@ using js::BaseProxyHandler;
 using js::IsCrossCompartmentWrapper;
 using js::UncheckedUnwrap;
 using js::CheckedUnwrap;
 
 namespace xpc {
 
 using namespace XrayUtils;
 
-constexpr bool Between(JSProtoKey x, JSProtoKey a, JSProtoKey b) { return a <= x && x <= b; }
+#define Between(x, a, b) (a <= x && x <= b)
 
 static_assert(JSProto_URIError - JSProto_Error == 7, "New prototype added in error object range");
 #define AssertErrorObjectKeyInBounds(key) \
     static_assert(Between(key, JSProto_Error, JSProto_URIError), "We depend on jsprototypes.h ordering here");
 MOZ_FOR_EACH(AssertErrorObjectKeyInBounds, (),
              (JSProto_Error, JSProto_InternalError, JSProto_EvalError, JSProto_RangeError,
               JSProto_ReferenceError, JSProto_SyntaxError, JSProto_TypeError, JSProto_URIError));
 
-inline bool
-IsErrorObjectKey(JSProtoKey key)
-{
-    return key >= JSProto_Error && key <= JSProto_URIError;
-}
-
 static_assert(JSProto_Uint8ClampedArray - JSProto_Int8Array == 8, "New prototype added in typed array range");
 #define AssertTypedArrayKeyInBounds(key) \
     static_assert(Between(key, JSProto_Int8Array, JSProto_Uint8ClampedArray), "We depend on jsprototypes.h ordering here");
 MOZ_FOR_EACH(AssertTypedArrayKeyInBounds, (),
              (JSProto_Int8Array, JSProto_Uint8Array, JSProto_Int16Array, JSProto_Uint16Array,
               JSProto_Int32Array, JSProto_Uint32Array, JSProto_Float32Array, JSProto_Float64Array, JSProto_Uint8ClampedArray));
 
+#undef Between
+
+inline bool
+IsErrorObjectKey(JSProtoKey key)
+{
+    return key >= JSProto_Error && key <= JSProto_URIError;
+}
+
 inline bool
 IsTypedArrayKey(JSProtoKey key)
 {
     return key >= JSProto_Int8Array && key <= JSProto_Uint8ClampedArray;
 }
 
 // Whitelist for the standard ES classes we can Xray to.
 static bool