aboutsummaryrefslogtreecommitdiffstats
path: root/include/gtest/internal/gtest-tuple.h.pump
diff options
context:
space:
mode:
authorzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2009-06-24 23:02:50 +0000
committerzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2009-06-24 23:02:50 +0000
commite6095deec89dcf5237948b3460d84a137622f16c (patch)
treec0e3cbdc428e9461fa43b7f7d28636179ef0917a /include/gtest/internal/gtest-tuple.h.pump
parentef29ce3576240e51f289e49b2c4e156b414d6685 (diff)
downloadgoogletest-e6095deec89dcf5237948b3460d84a137622f16c.tar.gz
googletest-e6095deec89dcf5237948b3460d84a137622f16c.tar.bz2
googletest-e6095deec89dcf5237948b3460d84a137622f16c.zip
Makes gtest's tuple implementation work with Symbian 5th edition by bypassing 2 compiler bugs (by Zhanyong Wan); refactors for the event listener API (by Vlad Losev).
Diffstat (limited to 'include/gtest/internal/gtest-tuple.h.pump')
-rw-r--r--include/gtest/internal/gtest-tuple.h.pump25
1 files changed, 20 insertions, 5 deletions
diff --git a/include/gtest/internal/gtest-tuple.h.pump b/include/gtest/internal/gtest-tuple.h.pump
index 33fd6b6d..12821d8b 100644
--- a/include/gtest/internal/gtest-tuple.h.pump
+++ b/include/gtest/internal/gtest-tuple.h.pump
@@ -39,15 +39,29 @@ $$ This meta comment fixes auto-indentation in Emacs. }}
#include <utility> // For ::std::pair.
+// The compiler used in Symbian 5th Edition (__S60_50__) has a bug
+// that prevents us from declaring the tuple template as a friend (it
+// complains that tuple is redefined). This hack bypasses the bug by
+// declaring the members that should otherwise be private as public.
+#if defined(__SYMBIAN32__) && __S60_50__
+#define GTEST_DECLARE_TUPLE_AS_FRIEND_ public:
+#else
+#define GTEST_DECLARE_TUPLE_AS_FRIEND_ \
+ template <GTEST_$(n)_TYPENAMES_(U)> friend class tuple; \
+ private:
+#endif
+
$range i 0..n-1
$range j 0..n
$range k 1..n
// GTEST_n_TUPLE_(T) is the type of an n-tuple.
+#define GTEST_0_TUPLE_(T) tuple<>
-$for j [[
-$range m 0..j-1
-#define GTEST_$(j)_TUPLE_(T) tuple<$for m, [[T##$m]]>
+$for k [[
+$range m 0..k-1
+$range m2 k..n-1
+#define GTEST_$(k)_TUPLE_(T) tuple<$for m, [[T##$m]]$for m2 [[, void]]>
]]
@@ -125,7 +139,6 @@ template <GTEST_$(k)_TYPENAMES_(T)>
class $if k < n [[GTEST_$(k)_TUPLE_(T)]] $else [[tuple]] {
public:
template <int k> friend class gtest_internal::Get;
- template <GTEST_$(n)_TYPENAMES_(U)> friend class tuple;
tuple() {}
@@ -160,7 +173,8 @@ $if k == 2 [[
]]
- private:
+ GTEST_DECLARE_TUPLE_AS_FRIEND_
+
template <GTEST_$(k)_TYPENAMES_(U)>
tuple& CopyFrom(const GTEST_$(k)_TUPLE_(U)& t) {
@@ -313,6 +327,7 @@ $for j [[
]]
+#undef GTEST_DECLARE_TUPLE_AS_FRIEND_
#undef GTEST_BY_REF_
#undef GTEST_ADD_REF_
#undef GTEST_TUPLE_ELEMENT_