Merge lp:~michihenning/unity-scopes-api/boost-compile-errors into lp:unity-scopes-api

Proposed by Michi Henning
Status: Merged
Approved by: Paweł Stołowski
Approved revision: 320
Merged at revision: 317
Proposed branch: lp:~michihenning/unity-scopes-api/boost-compile-errors
Merge into: lp:unity-scopes-api
Diff against target: 190 lines (+38/-28)
5 files modified
scoperegistry/scoperegistry.cpp (+15/-15)
src/scopes/internal/LocationImpl.cpp (+10/-10)
src/scopes/internal/SearchMetadataImpl.cpp (+1/-1)
test/gtest/scopes/ChildScopes/ChildScopes_test.cpp (+2/-2)
test/gtest/scopes/internal/zmq_middleware/RegistryI/RegistryI_test.cpp (+10/-0)
To merge this branch: bzr merge lp:~michihenning/unity-scopes-api/boost-compile-errors
Reviewer Review Type Date Requested Status
Paweł Stołowski (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+249907@code.launchpad.net

Commit message

Fixed compilation problems when compiling with boost 1.56 and 1.57.

Description of the change

While checking progress on bug #1421060, I compiled with boost 1.57 and found a bunch of incompatibilities. Rather than throwing these changes away, we might as well commit them and not fix the problems a second time once boost is updated in the archives.

To post a comment you must log in.
319. By Michi Henning

Oops, major version check was too loose.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
320. By Michi Henning

Fixed major version calculation for boost.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Paweł Stołowski (stolowski) wrote :

LGTM.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'scoperegistry/scoperegistry.cpp'
2--- scoperegistry/scoperegistry.cpp 2015-01-23 04:07:14 +0000
3+++ scoperegistry/scoperegistry.cpp 2015-02-23 03:36:33 +0000
4@@ -67,35 +67,35 @@
5 // throwing an exception without joining with a thread is a bad, bad thing to do, so let's RAII to avoid doing it
6 struct SignalThreadWrapper
7 {
8- std::shared_ptr<core::posix::SignalTrap> termination_trap;
9- std::shared_ptr<core::posix::SignalTrap> child_trap;
10- std::unique_ptr<core::posix::ChildProcess::DeathObserver> death_observer;
11+ std::shared_ptr<::core::posix::SignalTrap> termination_trap;
12+ std::shared_ptr<::core::posix::SignalTrap> child_trap;
13+ std::unique_ptr<::core::posix::ChildProcess::DeathObserver> death_observer;
14 std::thread termination_trap_worker;
15 std::thread child_trap_worker;
16
17 SignalThreadWrapper() :
18 // We shutdown the runtime whenever these signals happen.
19- termination_trap(core::posix::trap_signals_for_all_subsequent_threads(
20+ termination_trap(::core::posix::trap_signals_for_all_subsequent_threads(
21 {
22- core::posix::Signal::sig_int,
23- core::posix::Signal::sig_hup,
24- core::posix::Signal::sig_term
25+ ::core::posix::Signal::sig_int,
26+ ::core::posix::Signal::sig_hup,
27+ ::core::posix::Signal::sig_term
28 })),
29 // And we maintain our list of processes with the help of sig_chld.
30- child_trap(core::posix::trap_signals_for_all_subsequent_threads(
31+ child_trap(::core::posix::trap_signals_for_all_subsequent_threads(
32 {
33- core::posix::Signal::sig_chld
34+ ::core::posix::Signal::sig_chld
35 })),
36 // The death observer is required to make sure that we reap all child processes
37 // whenever multiple sigchld's are compressed together.
38- death_observer(core::posix::ChildProcess::DeathObserver::create_once_with_signal_trap(child_trap)),
39+ death_observer(::core::posix::ChildProcess::DeathObserver::create_once_with_signal_trap(child_trap)),
40 // Starting up both traps.
41 termination_trap_worker([&]() { termination_trap->run(); }),
42 child_trap_worker([&]() { child_trap->run(); })
43 {
44 }
45
46- core::Signal<core::posix::Signal>& signal_raised()
47+ ::core::Signal<::core::posix::Signal>& signal_raised()
48 {
49 return termination_trap->signal_raised();
50 }
51@@ -578,13 +578,13 @@
52
53 // Inform the signal thread that it should shutdown the runtime
54 // if we get a termination signal.
55- signal_handler_wrapper.signal_raised().connect([runtime](core::posix::Signal signal)
56+ signal_handler_wrapper.signal_raised().connect([runtime](::core::posix::Signal signal)
57 {
58 switch(signal)
59 {
60- case core::posix::Signal::sig_int:
61- case core::posix::Signal::sig_hup:
62- case core::posix::Signal::sig_term:
63+ case ::core::posix::Signal::sig_int:
64+ case ::core::posix::Signal::sig_hup:
65+ case ::core::posix::Signal::sig_term:
66 runtime->destroy();
67 break;
68 default:
69
70=== modified file 'src/scopes/internal/LocationImpl.cpp'
71--- src/scopes/internal/LocationImpl.cpp 2014-08-04 09:20:16 +0000
72+++ src/scopes/internal/LocationImpl.cpp 2015-02-23 03:36:33 +0000
73@@ -189,52 +189,52 @@
74
75 bool LocationImpl::has_altitude() const
76 {
77- return altitude_;
78+ return bool(altitude_);
79 }
80
81 bool LocationImpl::has_area_code() const
82 {
83- return area_code_;
84+ return bool(area_code_);
85 }
86
87 bool LocationImpl::has_city() const
88 {
89- return city_;
90+ return bool(city_);
91 }
92
93 bool LocationImpl::has_country_code() const
94 {
95- return country_code_;
96+ return bool(country_code_);
97 }
98
99 bool LocationImpl::has_country_name() const
100 {
101- return country_name_;
102+ return bool(country_name_);
103 }
104
105 bool LocationImpl::has_horizontal_accuracy() const
106 {
107- return horizontal_accuracy_;
108+ return bool(horizontal_accuracy_);
109 }
110
111 bool LocationImpl::has_region_code() const
112 {
113- return region_code_;
114+ return bool(region_code_);
115 }
116
117 bool LocationImpl::has_region_name() const
118 {
119- return region_name_;
120+ return bool(region_name_);
121 }
122
123 bool LocationImpl::has_vertical_accuracy() const
124 {
125- return vertical_accuracy_;
126+ return bool(vertical_accuracy_);
127 }
128
129 bool LocationImpl::has_zip_postal_code() const
130 {
131- return zip_postal_code_;
132+ return bool(zip_postal_code_);
133 }
134
135 void LocationImpl::set_altitude(double altitude)
136
137=== modified file 'src/scopes/internal/SearchMetadataImpl.cpp'
138--- src/scopes/internal/SearchMetadataImpl.cpp 2015-01-26 08:20:45 +0000
139+++ src/scopes/internal/SearchMetadataImpl.cpp 2015-02-23 03:36:33 +0000
140@@ -88,7 +88,7 @@
141
142 bool SearchMetadataImpl::has_location() const
143 {
144- return location_;
145+ return bool(location_);
146 }
147
148 std::string SearchMetadataImpl::metadata_type() const
149
150=== modified file 'test/gtest/scopes/ChildScopes/ChildScopes_test.cpp'
151--- test/gtest/scopes/ChildScopes/ChildScopes_test.cpp 2015-01-20 06:27:04 +0000
152+++ test/gtest/scopes/ChildScopes/ChildScopes_test.cpp 2015-02-23 03:36:33 +0000
153@@ -32,8 +32,8 @@
154 using namespace unity::scopes;
155 using namespace unity::scopes::internal;
156
157-std::shared_ptr<core::posix::SignalTrap> trap(core::posix::trap_signals_for_all_subsequent_threads({core::posix::Signal::sig_chld}));
158-std::unique_ptr<core::posix::ChildProcess::DeathObserver> death_observer(core::posix::ChildProcess::DeathObserver::create_once_with_signal_trap(trap));
159+std::shared_ptr<::core::posix::SignalTrap> trap(::core::posix::trap_signals_for_all_subsequent_threads({::core::posix::Signal::sig_chld}));
160+std::unique_ptr<::core::posix::ChildProcess::DeathObserver> death_observer(::core::posix::ChildProcess::DeathObserver::create_once_with_signal_trap(trap));
161
162 class ChildScopesTest : public Test
163 {
164
165=== modified file 'test/gtest/scopes/internal/zmq_middleware/RegistryI/RegistryI_test.cpp'
166--- test/gtest/scopes/internal/zmq_middleware/RegistryI/RegistryI_test.cpp 2015-01-09 03:16:51 +0000
167+++ test/gtest/scopes/internal/zmq_middleware/RegistryI/RegistryI_test.cpp 2015-02-23 03:36:33 +0000
168@@ -33,12 +33,22 @@
169 #include <unity/scopes/ScopeExceptions.h>
170 #include <unity/UnityExceptions.h>
171
172+#pragma push_macro("BOOST_RANGE_ENABLE_CONCEPT_ASSERT")
173+
174+#if BOOST_VERSION / 100000 == 1
175+# if ((BOOST_VERSION / 100) % 1000) == 57
176+# define BOOST_RANGE_ENABLE_CONCEPT_ASSERT 0 // Iterator requirements are too strict with boost 1.57.
177+# endif
178+# endif
179+
180 #include <boost/algorithm/string.hpp>
181 #include <boost/range/adaptor/filtered.hpp>
182 #include <boost/range/algorithm/copy.hpp>
183 #include <boost/filesystem.hpp>
184 #include <boost/filesystem/path.hpp>
185
186+#pragma pop_macro("BOOST_RANGE_ENABLE_CONCEPT_ASSERT")
187+
188 #include <gtest/gtest.h>
189
190 #include <array>

Subscribers

People subscribed via source and target branches

to all changes: