Backed out changeset ec696ad6ff10 (bug 963056) for build bustage on a CLOSED TREE
authorWes Kocher <wkocher@mozilla.com>
Wed, 05 Feb 2014 16:19:06 -0800
changeset 178127 7d24d7dfbb530bf042b4c75265b0b79e4b5249b2
parent 178126 daa1d43152d7ad089e4d50521562856b16185462
child 178128 5282b4fa4cea935add054c75a09d32e6d29b741a
push id5439
push userffxbld
push dateMon, 17 Mar 2014 23:08:15 +0000
treeherdermozilla-aurora@c0befb3c8038 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs963056
milestone30.0a1
backs outec696ad6ff10b362bbf56725228fcd8155eabf72
Backed out changeset ec696ad6ff10 (bug 963056) for build bustage on a CLOSED TREE
mfbt/ArrayUtils.h
--- a/mfbt/ArrayUtils.h
+++ b/mfbt/ArrayUtils.h
@@ -77,35 +77,24 @@ ArrayEnd(Array<T, N>& arr)
 
 template<typename T, size_t N>
 MOZ_CONSTEXPR const T*
 ArrayEnd(const Array<T, N>& arr)
 {
   return &arr[0] + ArrayLength(arr);
 }
 
-namespace detail {
-
-/*
- * Helper for the MOZ_ARRAY_LENGTH() macro to make the length a typesafe
- * compile-time constant even on compilers lacking constexpr support.
- */
-template <typename T, size_t N>
-char (&ArrayLengthHelper(T (&array)[N]))[N];
-
-} /* namespace detail */
-
 } /* namespace mozilla */
 
 #endif /* __cplusplus */
 
 /*
  * MOZ_ARRAY_LENGTH() is an alternative to mozilla::ArrayLength() for C files
  * that can't use C++ template functions and for static_assert() calls that
  * can't call ArrayLength() when it is not a C++11 constexpr function.
  */
-#ifdef __cplusplus
-#  define MOZ_ARRAY_LENGTH(array)   sizeof(mozilla::detail::ArrayLengthHelper(array))
+#ifdef MOZ_HAVE_CXX11_CONSTEXPR
+#  define MOZ_ARRAY_LENGTH(array)   mozilla::ArrayLength(array)
 #else
 #  define MOZ_ARRAY_LENGTH(array)   (sizeof(array)/sizeof((array)[0]))
 #endif
 
 #endif /* mozilla_ArrayUtils_h */