STL provides no implicit boolean conversion for streams, so use good()

for this purpose. Add gtest/gmock fixes for libc++.
This commit is contained in:
joerg 2013-05-11 21:40:14 +00:00
parent 866dc404d6
commit b835c6dc87
6 changed files with 80 additions and 2 deletions

View file

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.16 2012/11/25 16:39:40 gls Exp $
# $NetBSD: Makefile,v 1.17 2013/05/11 21:40:14 joerg Exp $
#
DISTNAME= synergy-1.3.8-Source
@ -47,6 +47,11 @@ do-install:
${INSTALL_DATA} ${WRKSRC}/doc/${f} ${DESTDIR}${PREFIX}/share/examples/${PKGBASE}
.endfor
.include "../../mk/compiler.mk"
.if !empty(PKGSRC_COMPILER:Mclang)
_WRAP_EXTRA_ARGS.CXX+= -std=c++11
.endif
.include "../../devel/cmake/buildlink3.mk"
.if !exists(/System/Library/Frameworks/Carbon.framework)
.include "../../x11/libXext/buildlink3.mk"

View file

@ -1,7 +1,11 @@
$NetBSD: distinfo,v 1.9 2012/11/25 16:39:40 gls Exp $
$NetBSD: distinfo,v 1.10 2013/05/11 21:40:14 joerg Exp $
SHA1 (synergy-1.3.8-Source.tar.gz) = 82e80b22c6746e573d047aa4a1ad7b71c28cf7d3
RMD160 (synergy-1.3.8-Source.tar.gz) = 3b02faec3b5e5dbea1853e6decd92e4cf6eca419
Size (synergy-1.3.8-Source.tar.gz) = 2518396 bytes
SHA1 (patch-src_lib_server_CConfig.cpp) = 47cb18b62cfd9eeee08cc5ee24e7777de98fefd2
SHA1 (patch-src_lib_server_CConfig.h) = 6aa99efc189a3d8e067a30f4fee4d94874e4f3c6
SHA1 (patch-tools_gmock-1.6.0_configure) = 45cfbcdc8b55c1e745265ed4e2bbbfe41ef000a2
SHA1 (patch-tools_gmock-1.6.0_include_gmock_internal_gmock-port.h) = dc526bcfab414dcd35d3d67c36998d92020bd398
SHA1 (patch-tools_gtest-1.6.0_configure) = 35d77cab8e651bff031294f7d12570cb582aba1a
SHA1 (patch-tools_gtest-1.6.0_include_gtest_internal_gtest-port.h) = 518067092fe4209bfc28f3bb4eb4092d1b0c1304

View file

@ -0,0 +1,16 @@
$NetBSD: patch-src_lib_server_CConfig.cpp,v 1.1 2013/05/11 21:40:14 joerg Exp $
--- src/lib/server/CConfig.cpp.orig 2011-01-21 03:51:35.000000000 +0000
+++ src/lib/server/CConfig.cpp
@@ -1908,9 +1908,9 @@ CConfigReadContext::getLineNumber() cons
return m_line;
}
-CConfigReadContext::operator void*() const
+CConfigReadContext::operator bool() const
{
- return m_stream;
+ return m_stream.good();
}
bool

View file

@ -0,0 +1,13 @@
$NetBSD: patch-src_lib_server_CConfig.h,v 1.1 2013/05/11 21:40:14 joerg Exp $
--- src/lib/server/CConfig.h.orig 2013-05-10 12:35:59.000000000 +0000
+++ src/lib/server/CConfig.h
@@ -483,7 +483,7 @@ public:
bool readLine(CString&);
UInt32 getLineNumber() const;
- operator void*() const;
+ operator bool() const;
bool operator!() const;
OptionValue parseBoolean(const CString&) const;

View file

@ -0,0 +1,19 @@
$NetBSD: patch-tools_gmock-1.6.0_include_gmock_internal_gmock-port.h,v 1.1 2013/05/11 21:40:14 joerg Exp $
--- tools/gmock-1.6.0/include/gmock/internal/gmock-port.h.orig 2011-05-07 02:25:30.000000000 +0000
+++ tools/gmock-1.6.0/include/gmock/internal/gmock-port.h
@@ -50,6 +50,14 @@
// tr1/tuple. gmock-port.h does this via gtest-port.h, which is
// guaranteed to pull in the tuple header.
+#if __cplusplus >= 201103L
+namespace std {
+ namespace tr1 {
+ using ::std::make_tuple;
+ }
+}
+#endif
+
// For MS Visual C++, check the compiler version. At least VS 2003 is
// required to compile Google Mock.
#if defined(_MSC_VER) && _MSC_VER < 1310

View file

@ -0,0 +1,21 @@
$NetBSD: patch-tools_gtest-1.6.0_include_gtest_internal_gtest-port.h,v 1.1 2013/05/11 21:40:14 joerg Exp $
--- tools/gtest-1.6.0/include/gtest/internal/gtest-port.h.orig 2011-05-07 02:25:30.000000000 +0000
+++ tools/gtest-1.6.0/include/gtest/internal/gtest-port.h
@@ -481,6 +481,16 @@
# define BOOST_TR1_DETAIL_CONFIG_HPP_INCLUDED
# include <tuple>
+# elif __cplusplus >= 201103L
+# include <tuple>
+namespace std {
+ namespace tr1 {
+ using ::std::tuple;
+ using ::std::tuple_element;
+ using ::std::tuple_size;
+ using ::std::get;
+ }
+}
# elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40000)
// GCC 4.0+ implements tr1/tuple in the <tr1/tuple> header. This does
// not conform to the TR1 spec, which requires the header to be <tuple>.