summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjmmv <jmmv>2012-09-06 02:51:43 +0000
committerjmmv <jmmv>2012-09-06 02:51:43 +0000
commitb86cd97a9fe43df55295219c976aad1f19049ff1 (patch)
tree104c09ffb66496f474cba2db03a0d9d1b25fa5cd
parent9485c3d9f32c4978a7011b940564700571adf886 (diff)
downloadpkgsrc-b86cd97a9fe43df55295219c976aad1f19049ff1.tar.gz
Fix build under NetBSD 1.5.2.
-rw-r--r--devel/kyua-cli/distinfo3
-rw-r--r--devel/kyua-cli/patches/patch-aa54
2 files changed, 56 insertions, 1 deletions
diff --git a/devel/kyua-cli/distinfo b/devel/kyua-cli/distinfo
index 44e5e47c727..fbb8db93dfe 100644
--- a/devel/kyua-cli/distinfo
+++ b/devel/kyua-cli/distinfo
@@ -1,5 +1,6 @@
-$NetBSD: distinfo,v 1.8 2012/07/10 22:09:32 jmmv Exp $
+$NetBSD: distinfo,v 1.9 2012/09/06 02:51:43 jmmv Exp $
SHA1 (kyua-cli-0.5.tar.gz) = 4463af8f01e7dd77cfd69593ee9512eff017b14e
RMD160 (kyua-cli-0.5.tar.gz) = 20e9c2bf64a40852525a7cda2a092eb1bb68d43d
Size (kyua-cli-0.5.tar.gz) = 648398 bytes
+SHA1 (patch-aa) = 26055063aeca63accf9e6de3953c83237e6ff096
diff --git a/devel/kyua-cli/patches/patch-aa b/devel/kyua-cli/patches/patch-aa
new file mode 100644
index 00000000000..d7b36242072
--- /dev/null
+++ b/devel/kyua-cli/patches/patch-aa
@@ -0,0 +1,54 @@
+$NetBSD: patch-aa,v 1.3 2012/09/06 02:51:44 jmmv Exp $
+
+Fix build under NetBSD 1.5.2
+
+Change utils::stream_length() to return a std::size_t instead of
+a std::streampos. This allows the later comparison against an
+integer without having to use a cast.
+
+This is upstream change: 2a62375a170b4bed0fd760e7c6e8c4d1433da147
+--- utils/stream.cpp
++++ utils/stream.cpp
+@@ -39,10 +39,13 @@
+ ///
+ /// \param is The input stream for which to calculate its length.
+ ///
+-/// \return The length of the stream.
++/// \return The length of the stream. This is of size_t type instead of
++/// directly std::streampos to simplify the caller. Some systems do not
++/// support comparing a std::streampos directly to an integer (see
++/// NetBSD 1.5.x), which is what we often want to do.
+ ///
+ /// \throw std::exception If calculating the length fails due to a stream error.
+-std::streampos
++std::size_t
+ utils::stream_length(std::istream& is)
+ {
+ const std::streampos current_pos = is.tellg();
+@@ -50,7 +53,7 @@ utils::stream_length(std::istream& is)
+ is.seekg(0, std::ios::end);
+ const std::streampos length = is.tellg();
+ is.seekg(current_pos, std::ios::beg);
+- return length;
++ return static_cast< std::size_t >(length);
+ } catch (...) {
+ is.seekg(current_pos, std::ios::beg);
+ throw;
+--- utils/stream.hpp
++++ utils/stream.hpp
+@@ -35,13 +35,14 @@
+ #if !defined(UTILS_STREAM_HPP)
+ #define UTILS_STREAM_HPP
+
++#include <cstddef>
+ #include <istream>
+ #include <string>
+
+ namespace utils {
+
+
+-std::streampos stream_length(std::istream&);
++std::size_t stream_length(std::istream&);
+ std::string read_stream(std::istream&);
+
+