b=880492 use GCC's typeof when decltype is not available r=Waldo
authorKarl Tomlinson <karlt+@karlt.net>
Mon, 10 Jun 2013 12:37:16 +1200
changeset 146823 03b0f599a0031258b5477c65b2cf75a9363dc476
parent 146822 b6e14855f129dcf002dc726fa25e87e90c26c8c6
child 146824 43d505a966f30f3a2d4297086bb887187af11762
push id368
push userbbajaj@mozilla.com
push dateMon, 09 Sep 2013 22:57:58 +0000
treeherdermozilla-release@5a4f47ae1217 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersWaldo
bugs880492
milestone24.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
b=880492 use GCC's typeof when decltype is not available r=Waldo
mfbt/Types.h
--- a/mfbt/Types.h
+++ b/mfbt/Types.h
@@ -128,9 +128,17 @@
 #ifdef __cplusplus
 #  define MOZ_BEGIN_EXTERN_C    extern "C" {
 #  define MOZ_END_EXTERN_C      }
 #else
 #  define MOZ_BEGIN_EXTERN_C
 #  define MOZ_END_EXTERN_C
 #endif
 
+/*
+ * GCC's typeof is available when decltype is not.
+ */
+#if defined(__GNUC__) && defined(__cplusplus) && \
+  !defined(__GXX_EXPERIMENTAL_CXX0X__) && __cplusplus < 201103L
+#  define decltype __typeof__
+#endif
+
 #endif  /* mozilla_Types_h_ */