Bug 713560 - Make MOZ_STATIC_ASSERT, when it expands to C++11 static_cast(), pass its reason argument along to static_cast in more compilers. r=typo-fix
authorJeff Walden <jwalden@mit.edu>
Tue, 27 Dec 2011 12:09:41 -0600
changeset 84634 3b3f1c6d6983df7f479282026813ade81a56b6ed
parent 84633 d7999840fac58306befe2f6a699dd41be916da0d
child 84635 18eead5419ff486cb13818ef6419bd39d4940524
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstypo-fix
bugs713560
milestone12.0a1
Bug 713560 - Make MOZ_STATIC_ASSERT, when it expands to C++11 static_cast(), pass its reason argument along to static_cast in more compilers. r=typo-fix
mfbt/Assertions.h
--- a/mfbt/Assertions.h
+++ b/mfbt/Assertions.h
@@ -65,25 +65,25 @@
 #      define __has_extension __has_feature /* compatibility, for older versions of clang */
 #    endif
 #    if __has_extension(cxx_static_assert)
 #      define MOZ_STATIC_ASSERT(cond, reason)    static_assert((cond), reason)
 #    endif
 #  elif defined(__GNUC__)
 #    if (defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L) && \
         (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
-#      define MOZ_STATIC_ASSERT(cond, reason)    static_assert((cond), #cond)
+#      define MOZ_STATIC_ASSERT(cond, reason)    static_assert((cond), reason)
 #    endif
 #  elif defined(_MSC_VER)
 #    if _MSC_VER >= 1600 /* MSVC 10 */
-#      define MOZ_STATIC_ASSERT(cond, reason)    static_assert((cond), #cond)
+#      define MOZ_STATIC_ASSERT(cond, reason)    static_assert((cond), reason)
 #    endif
 #  elif defined(__HP_aCC)
 #    if __HP_aCC >= 62500 && defined(_HP_CXX0x_SOURCE)
-#      define MOZ_STATIC_ASSERT(cond, reason)    static_assert((cond), #cond)
+#      define MOZ_STATIC_ASSERT(cond, reason)    static_assert((cond), reason)
 #    endif
 #  endif
 #endif
 #ifndef MOZ_STATIC_ASSERT
 #  define MOZ_STATIC_ASSERT_GLUE1(x, y)          x##y
 #  define MOZ_STATIC_ASSERT_GLUE(x, y)           MOZ_STATIC_ASSERT_GLUE1(x, y)
 #  if defined(__SUNPRO_CC)
      /*