add patch from jwakely to fix build with Boost 1.58

This commit is contained in:
Adam Williamson 2015-07-27 14:14:46 -07:00
parent 32917d76c9
commit a054d30201
2 changed files with 102 additions and 1 deletions

95
422.patch Normal file
View File

@ -0,0 +1,95 @@
From bcaca24de4264f89a94069701361988007e22e58 Mon Sep 17 00:00:00 2001
From: Jonathan Wakely <jwakely@redhat.com>
Date: Mon, 27 Jul 2015 20:37:16 +0100
Subject: [PATCH] Convert boost::optional objects to bool explicitly.
Fixes #417.
---
src/account.h | 6 +-----
src/item.h | 6 +-----
src/parser.h | 2 +-
src/post.h | 6 +-----
src/times.h | 6 +-----
5 files changed, 5 insertions(+), 21 deletions(-)
diff --git a/src/account.h b/src/account.h
index 7fae93e..7de4e56 100644
--- a/src/account.h
+++ b/src/account.h
@@ -261,11 +261,7 @@ class account_t : public supports_flags<>, public scope_t
mutable optional<xdata_t> xdata_;
bool has_xdata() const {
-#if BOOST_VERSION >= 105600
- return xdata_ != NULL;
-#else
- return xdata_;
-#endif
+ return static_cast<bool>(xdata_);
}
void clear_xdata();
xdata_t& xdata() {
diff --git a/src/item.h b/src/item.h
index ba81217..dbba53a 100644
--- a/src/item.h
+++ b/src/item.h
@@ -174,11 +174,7 @@ class item_t : public supports_flags<uint_least16_t>, public scope_t
static bool use_aux_date;
virtual bool has_date() const {
-#if BOOST_VERSION >= 105600
- return _date != NULL;
-#else
- return _date;
-#endif
+ return static_cast<bool>(_date);
}
virtual date_t date() const {
diff --git a/src/parser.h b/src/parser.h
index e46fc71..25c4a7e 100644
--- a/src/parser.h
+++ b/src/parser.h
@@ -118,7 +118,7 @@ class expr_t::parser_t : public noncopyable
ptr_op_t parse(std::istream& in,
const parse_flags_t& flags = PARSE_DEFAULT,
- const optional<string>& original_string = NULL);
+ const optional<string>& original_string = boost::none);
};
} // namespace ledger
diff --git a/src/post.h b/src/post.h
index 0fb45e9..5f22fa3 100644
--- a/src/post.h
+++ b/src/post.h
@@ -205,11 +205,7 @@ class post_t : public item_t
mutable optional<xdata_t> xdata_;
bool has_xdata() const {
-#if BOOST_VERSION >= 105600
- return xdata_ != NULL;
-#else
- return xdata_;
-#endif
+ return static_cast<bool>(xdata_);
}
void clear_xdata() {
xdata_ = none;
diff --git a/src/times.h b/src/times.h
index 421d146..e1a9e84 100644
--- a/src/times.h
+++ b/src/times.h
@@ -500,11 +500,7 @@ class date_interval_t : public equality_comparable<date_interval_t>
void stabilize(const optional<date_t>& date = none);
bool is_valid() const {
-#if BOOST_VERSION >= 105600
- return start != NULL;
-#else
- return start;
-#endif
+ return static_cast<bool>(start);
}
/** Find the current or next period containing date. Returns false if

View File

@ -22,6 +22,8 @@ Patch6: %{name}-3.1-0006-Fix-numbers-from-example.patch
Patch7: %{name}-3.1-0007-Update-ledger3.texi.patch
Patch8: %{name}-3.1-0008-Update-ledger3.texi.patch
Patch9: %{name}-3.1-0009-Some-minor-changes.patch
# Fixes build with Boost 1.58.
Patch10: https://github.com/ledger/ledger/pull/422.patch
BuildRequires: boost-devel
BuildRequires: cmake
@ -97,6 +99,7 @@ emacs-%{name} instead.
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%build
@ -196,7 +199,10 @@ fi
%changelog
* Wed Jul 22 2015 David Tardon <dtardon@redhat.com> - 3.1-7
* Mon Jul 27 2015 Adam Williamson <awilliam@redhat.com> - 3.1-7
- add patch from jwakely to fix build with Boost 1.58
* Wed Jul 22 2015 David Tardon <dtardon@redhat.com>
- rebuild for Boost 1.58
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.1-6