summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2012-08-28 21:52:08 +0000
committerMike Frysinger <vapier@gentoo.org>2012-08-28 21:52:08 +0000
commit22efbb546068157752f4fca5dfb05672ef63107d (patch)
treef5db25ca5e52f3c788f52e4dbededcf7c1a19e3d /dev-cpp/gmock
parentfix for bug #378629 from debian (diff)
downloadgentoo-2-22efbb546068157752f4fca5dfb05672ef63107d.tar.gz
gentoo-2-22efbb546068157752f4fca5dfb05672ef63107d.tar.bz2
gentoo-2-22efbb546068157752f4fca5dfb05672ef63107d.zip
Add another fix from upstream for building with gcc-4.7.
(Portage version: 2.2.0_alpha120/cvs/Linux x86_64)
Diffstat (limited to 'dev-cpp/gmock')
-rw-r--r--dev-cpp/gmock/ChangeLog6
-rw-r--r--dev-cpp/gmock/files/gmock-1.4.0-more-gcc-4.7.patch144
-rw-r--r--dev-cpp/gmock/gmock-1.4.0.ebuild3
3 files changed, 151 insertions, 2 deletions
diff --git a/dev-cpp/gmock/ChangeLog b/dev-cpp/gmock/ChangeLog
index 7d8dd591caf1..7bfad2e4cb09 100644
--- a/dev-cpp/gmock/ChangeLog
+++ b/dev-cpp/gmock/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for dev-cpp/gmock
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-cpp/gmock/ChangeLog,v 1.13 2012/08/24 09:23:27 xmw Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-cpp/gmock/ChangeLog,v 1.14 2012/08/28 21:52:08 vapier Exp $
+
+ 28 Aug 2012; Mike Frysinger <vapier@gentoo.org>
+ +files/gmock-1.4.0-more-gcc-4.7.patch, gmock-1.4.0.ebuild:
+ Add another fix from upstream for building with gcc-4.7.
24 Aug 2012; Michael Weber <xmw@gentoo.org> gmock-1.6.0.ebuild:
ppc stable (bug 420853).
diff --git a/dev-cpp/gmock/files/gmock-1.4.0-more-gcc-4.7.patch b/dev-cpp/gmock/files/gmock-1.4.0-more-gcc-4.7.patch
new file mode 100644
index 000000000000..d28a121a474d
--- /dev/null
+++ b/dev-cpp/gmock/files/gmock-1.4.0-more-gcc-4.7.patch
@@ -0,0 +1,144 @@
+taken from upstream repo
+
+------------------------------------------------------------------------
+r245 | zhanyong.wan | 2009-12-02 03:36:42 -0500 (Wed, 02 Dec 2009) | 2 lines
+
+Fixes a C++-standard-compliance bug in gmock-printers.h.
+
+
+Index: include/gmock/gmock-printers.h
+===================================================================
+--- include/gmock/gmock-printers.h (revision 244)
++++ include/gmock/gmock-printers.h (revision 245)
+@@ -434,63 +434,10 @@ inline void PrintTo(const ::std::wstring
+ // Overload for ::std::tr1::tuple. Needed for printing function
+ // arguments, which are packed as tuples.
+
+-typedef ::std::vector<string> Strings;
+-
+-// This helper template allows PrintTo() for tuples and
+-// UniversalTersePrintTupleFieldsToStrings() to be defined by
+-// induction on the number of tuple fields. The idea is that
+-// TuplePrefixPrinter<N>::PrintPrefixTo(t, os) prints the first N
+-// fields in tuple t, and can be defined in terms of
+-// TuplePrefixPrinter<N - 1>.
+-
+-// The inductive case.
+-template <size_t N>
+-struct TuplePrefixPrinter {
+- // Prints the first N fields of a tuple.
+- template <typename Tuple>
+- static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {
+- TuplePrefixPrinter<N - 1>::PrintPrefixTo(t, os);
+- *os << ", ";
+- UniversalPrinter<typename ::std::tr1::tuple_element<N - 1, Tuple>::type>
+- ::Print(::std::tr1::get<N - 1>(t), os);
+- }
+-
+- // Tersely prints the first N fields of a tuple to a string vector,
+- // one element for each field.
+- template <typename Tuple>
+- static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {
+- TuplePrefixPrinter<N - 1>::TersePrintPrefixToStrings(t, strings);
+- ::std::stringstream ss;
+- UniversalTersePrint(::std::tr1::get<N - 1>(t), &ss);
+- strings->push_back(ss.str());
+- }
+-};
+-
+-// Base cases.
+-template <>
+-struct TuplePrefixPrinter<0> {
+- template <typename Tuple>
+- static void PrintPrefixTo(const Tuple&, ::std::ostream*) {}
+-
+- template <typename Tuple>
+- static void TersePrintPrefixToStrings(const Tuple&, Strings*) {}
+-};
+-template <>
+-template <typename Tuple>
+-void TuplePrefixPrinter<1>::PrintPrefixTo(const Tuple& t, ::std::ostream* os) {
+- UniversalPrinter<typename ::std::tr1::tuple_element<0, Tuple>::type>::
+- Print(::std::tr1::get<0>(t), os);
+-}
+-
+ // Helper function for printing a tuple. T must be instantiated with
+ // a tuple type.
+ template <typename T>
+-void PrintTupleTo(const T& t, ::std::ostream* os) {
+- *os << "(";
+- TuplePrefixPrinter< ::std::tr1::tuple_size<T>::value>::
+- PrintPrefixTo(t, os);
+- *os << ")";
+-}
++void PrintTupleTo(const T& t, ::std::ostream* os);
+
+ // Overloaded PrintTo() for tuples of various arities. We support
+ // tuples of up-to 10 fields. The following implementation works
+@@ -725,6 +672,64 @@ void UniversalPrint(const T& value, ::st
+ UniversalPrinter<T>::Print(value, os);
+ }
+
++typedef ::std::vector<string> Strings;
++
++// This helper template allows PrintTo() for tuples and
++// UniversalTersePrintTupleFieldsToStrings() to be defined by
++// induction on the number of tuple fields. The idea is that
++// TuplePrefixPrinter<N>::PrintPrefixTo(t, os) prints the first N
++// fields in tuple t, and can be defined in terms of
++// TuplePrefixPrinter<N - 1>.
++
++// The inductive case.
++template <size_t N>
++struct TuplePrefixPrinter {
++ // Prints the first N fields of a tuple.
++ template <typename Tuple>
++ static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {
++ TuplePrefixPrinter<N - 1>::PrintPrefixTo(t, os);
++ *os << ", ";
++ UniversalPrinter<typename ::std::tr1::tuple_element<N - 1, Tuple>::type>
++ ::Print(::std::tr1::get<N - 1>(t), os);
++ }
++
++ // Tersely prints the first N fields of a tuple to a string vector,
++ // one element for each field.
++ template <typename Tuple>
++ static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {
++ TuplePrefixPrinter<N - 1>::TersePrintPrefixToStrings(t, strings);
++ ::std::stringstream ss;
++ UniversalTersePrint(::std::tr1::get<N - 1>(t), &ss);
++ strings->push_back(ss.str());
++ }
++};
++
++// Base cases.
++template <>
++struct TuplePrefixPrinter<0> {
++ template <typename Tuple>
++ static void PrintPrefixTo(const Tuple&, ::std::ostream*) {}
++
++ template <typename Tuple>
++ static void TersePrintPrefixToStrings(const Tuple&, Strings*) {}
++};
++template <>
++template <typename Tuple>
++void TuplePrefixPrinter<1>::PrintPrefixTo(const Tuple& t, ::std::ostream* os) {
++ UniversalPrinter<typename ::std::tr1::tuple_element<0, Tuple>::type>::
++ Print(::std::tr1::get<0>(t), os);
++}
++
++// Helper function for printing a tuple. T must be instantiated with
++// a tuple type.
++template <typename T>
++void PrintTupleTo(const T& t, ::std::ostream* os) {
++ *os << "(";
++ TuplePrefixPrinter< ::std::tr1::tuple_size<T>::value>::
++ PrintPrefixTo(t, os);
++ *os << ")";
++}
++
+ // Prints the fields of a tuple tersely to a string vector, one
+ // element for each field. See the comment before
+ // UniversalTersePrint() for how we define "tersely".
+
+------------------------------------------------------------------------
diff --git a/dev-cpp/gmock/gmock-1.4.0.ebuild b/dev-cpp/gmock/gmock-1.4.0.ebuild
index 744d1c074f86..998501011f5a 100644
--- a/dev-cpp/gmock/gmock-1.4.0.ebuild
+++ b/dev-cpp/gmock/gmock-1.4.0.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-cpp/gmock/gmock-1.4.0.ebuild,v 1.5 2012/06/12 18:58:16 jdhore Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-cpp/gmock/gmock-1.4.0.ebuild,v 1.6 2012/08/28 21:52:08 vapier Exp $
EAPI="4"
@@ -26,6 +26,7 @@ src_unpack() {
src_prepare() {
epatch "${FILESDIR}"/${P}-gcc-4.7.patch
+ epatch "${FILESDIR}"/${P}-more-gcc-4.7.patch
elibtoolize
}