Mir

Merge lp:~alan-griffiths/mir/fix-1475994-g++-5-backport-to-0.13 into lp:mir/0.13

Proposed by Alan Griffiths
Status: Work in progress
Proposed branch: lp:~alan-griffiths/mir/fix-1475994-g++-5-backport-to-0.13
Merge into: lp:mir/0.13
Diff against target: 205 lines (+25/-71)
8 files modified
debian/changelog (+9/-0)
examples/basic.c (+2/-2)
examples/flicker.c (+2/-2)
src/client/rpc/mir_protobuf_rpc_channel.cpp (+0/-1)
src/include/common/mir/protobuf/google_protobuf_guard.h (+0/-40)
src/protobuf/google_protobuf_guard.cpp (+10/-23)
src/server/frontend/protobuf_connection_creator.cpp (+0/-1)
tests/unit-tests/android_input/property_map.cpp (+2/-2)
To merge this branch: bzr merge lp:~alan-griffiths/mir/fix-1475994-g++-5-backport-to-0.13
Reviewer Review Type Date Requested Status
Mir development team Pending
Review via email: mp+265661@code.launchpad.net

Commit message

Fix compiler errors from g++-5

Description of the change

Fix compiler errors from g++-5

To post a comment you must log in.

Unmerged revisions

2558. By Alan Griffiths

Update changelog

2557. By Alan Griffiths

Fix compiler errors from g++-5

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2015-06-17 20:02:15 +0000
3+++ debian/changelog 2015-07-23 13:27:04 +0000
4@@ -1,3 +1,12 @@
5+mir (0.13.4) UNRELEASED; urgency=medium
6+
7+ [ Alan Griffiths ]
8+ * New upstream release 0.13.4 (https://launchpad.net/mir/+milestone/0.13.4)
9+ - Bug fixes:
10+ . mir fails to build with GCC 5 (LP: #1475994)
11+
12+ -- Alan Griffiths <alan@Octopull-desktop> Thu, 23 Jul 2015 14:15:43 +0100
13+
14 mir (0.13.3+15.10.20150617-0ubuntu1) wily; urgency=medium
15
16 [ Alberto Aguirre ]
17
18=== modified file 'examples/basic.c'
19--- examples/basic.c 2015-03-31 02:35:42 +0000
20+++ examples/basic.c 2015-07-23 13:27:04 +0000
21@@ -91,7 +91,7 @@
22
23 ///\internal [connect_tag]
24 // Call mir_connect and wait for callback to complete.
25- mir_wait_for(mir_connect(server, __PRETTY_FUNCTION__, connection_callback, &mcd));
26+ mir_wait_for(mir_connect(server, __FILE__, connection_callback, &mcd));
27 puts("Connected");
28 ///\internal [connect_tag]
29
30@@ -125,7 +125,7 @@
31 MirSurfaceSpec *spec =
32 mir_connection_create_spec_for_normal_surface(mcd.connection, 640, 480, pixel_format);
33 assert(spec != NULL);
34- mir_surface_spec_set_name(spec, __PRETTY_FUNCTION__);
35+ mir_surface_spec_set_name(spec, __FILE__);
36
37 ///\internal [surface_create_tag]
38 // ...we create a surface using that format and wait for callback to complete.
39
40=== modified file 'examples/flicker.c'
41--- examples/flicker.c 2015-03-31 02:35:42 +0000
42+++ examples/flicker.c 2015-07-23 13:27:04 +0000
43@@ -129,7 +129,7 @@
44
45 puts("Starting");
46
47- connection = mir_connect_sync(socket_file, __PRETTY_FUNCTION__);
48+ connection = mir_connect_sync(socket_file, __FILE__);
49 assert(connection != NULL);
50 assert(mir_connection_is_valid(connection));
51 assert(strcmp(mir_connection_get_error_message(connection), "") == 0);
52@@ -144,7 +144,7 @@
53 MirSurfaceSpec *spec =
54 mir_connection_create_spec_for_normal_surface(connection, 640, 480, pixel_format);
55 assert(spec != NULL);
56- mir_surface_spec_set_name(spec, __PRETTY_FUNCTION__);
57+ mir_surface_spec_set_name(spec, __FILE__);
58 mir_surface_spec_set_buffer_usage(spec, mir_buffer_usage_software);
59
60 surface = mir_surface_create_sync(spec);
61
62=== modified file 'src/client/rpc/mir_protobuf_rpc_channel.cpp'
63--- src/client/rpc/mir_protobuf_rpc_channel.cpp 2015-06-17 19:11:14 +0000
64+++ src/client/rpc/mir_protobuf_rpc_channel.cpp 2015-07-23 13:27:04 +0000
65@@ -19,7 +19,6 @@
66 #include "mir_protobuf_rpc_channel.h"
67 #include "rpc_report.h"
68
69-#include "mir/protobuf/google_protobuf_guard.h"
70 #include "../surface_map.h"
71 #include "../mir_surface.h"
72 #include "../display_configuration.h"
73
74=== removed file 'src/include/common/mir/protobuf/google_protobuf_guard.h'
75--- src/include/common/mir/protobuf/google_protobuf_guard.h 2015-01-21 07:34:50 +0000
76+++ src/include/common/mir/protobuf/google_protobuf_guard.h 1970-01-01 00:00:00 +0000
77@@ -1,40 +0,0 @@
78-/*
79- * Copyright © 2012 Canonical Ltd.
80- *
81- * This program is free software: you can redistribute it and/or modify it
82- * under the terms of the GNU Lesser General Public License version 3,
83- * as published by the Free Software Foundation.
84- *
85- * This program is distributed in the hope that it will be useful,
86- * but WITHOUT ANY WARRANTY; without even the implied warranty of
87- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
88- * GNU Lesser General Public License for more details.
89- *
90- * You should have received a copy of the GNU Lesser General Public License
91- * along with this program. If not, see <http://www.gnu.org/licenses/>.
92- *
93- * Authored by: Alan Griffiths <alan@octopull.co.uk>
94- */
95-
96-#ifndef MIR_PROTOBUF_GOOGLE_PROTOBUF_GUARD_H_
97-#define MIR_PROTOBUF_GOOGLE_PROTOBUF_GUARD_H_
98-
99-namespace mir
100-{
101-
102-/// subsystem dealing with Google protobuf protocol.
103-namespace protobuf
104-{
105-void google_protobuf_guard();
106-}
107-}
108-
109-// Any translation unit that includes this header will get this as part
110-// of its initialization, and, in turn, this ensures that protobuf gets
111-// initialized (and cleaned up) in a sensible sequence.
112-namespace
113-{
114-bool force_google_protobuf_init{(mir::protobuf::google_protobuf_guard(), true)};
115-}
116-
117-#endif /* MIR_PROTOBUF_GOOGLE_PROTOBUF_GUARD_H_ */
118
119=== modified file 'src/protobuf/google_protobuf_guard.cpp'
120--- src/protobuf/google_protobuf_guard.cpp 2013-04-24 05:22:20 +0000
121+++ src/protobuf/google_protobuf_guard.cpp 2015-07-23 13:27:04 +0000
122@@ -16,39 +16,26 @@
123 * Authored by: Alan Griffiths <alan@octopull.co.uk>
124 */
125
126-#include "mir/protobuf/google_protobuf_guard.h"
127-
128 #include <google/protobuf/descriptor.h>
129-#include <mutex>
130-
131-namespace mir
132-{
133-namespace
134-{
135-std::once_flag init_flag;
136-std::once_flag shutdown_flag;
137-
138-void init_google_protobuf()
139+
140+extern "C" int __attribute__((constructor))
141+init_google_protobuf()
142 {
143 GOOGLE_PROTOBUF_VERIFY_VERSION;
144+
145+ return 0;
146 }
147
148-void shutdown_google_protobuf()
149+extern "C" int __attribute__((destructor))
150+shutdown_google_protobuf()
151 {
152 google::protobuf::ShutdownProtobufLibrary();
153+ return 0;
154 }
155
156-// Too clever? The idea is to ensure protbuf version is verified once (on
157-// the first google_protobuf_guard() call) and memory is released on exit.
158-struct google_protobuf_guard_t
159-{
160- google_protobuf_guard_t() { std::call_once(init_flag, init_google_protobuf); }
161- ~google_protobuf_guard_t() { std::call_once(shutdown_flag, shutdown_google_protobuf); }
162-};
163-}
164-}
165+// Preserve ABI
166+namespace mir { namespace protobuf { void google_protobuf_guard(); }}
167
168 void mir::protobuf::google_protobuf_guard()
169 {
170- static google_protobuf_guard_t guard;
171 }
172
173=== modified file 'src/server/frontend/protobuf_connection_creator.cpp'
174--- src/server/frontend/protobuf_connection_creator.cpp 2015-01-21 07:34:50 +0000
175+++ src/server/frontend/protobuf_connection_creator.cpp 2015-07-23 13:27:04 +0000
176@@ -27,7 +27,6 @@
177
178 #include "protobuf_ipc_factory.h"
179 #include "mir/frontend/session_authorizer.h"
180-#include "mir/protobuf/google_protobuf_guard.h"
181
182 namespace mf = mir::frontend;
183 namespace mfd = mir::frontend::detail;
184
185=== modified file 'tests/unit-tests/android_input/property_map.cpp'
186--- tests/unit-tests/android_input/property_map.cpp 2013-05-03 16:38:07 +0000
187+++ tests/unit-tests/android_input/property_map.cpp 2015-07-23 13:27:04 +0000
188@@ -36,7 +36,7 @@
189
190 static void SetUpTestCase()
191 {
192- ASSERT_TRUE(std::ofstream(test_file) <<
193+ ASSERT_TRUE((std::ofstream(test_file) <<
194 "test.string=a_string\n"
195 "#test.bool.true=true\n"
196 "test.bool.true=1\n"
197@@ -45,7 +45,7 @@
198 "# a comment\n"
199 "#test.int.ignored=1\n"
200 "test.int_32=123\n"
201- "test.float=0.5\n");
202+ "test.float=0.5\n").good());
203 }
204
205 void SetUp()

Subscribers

People subscribed via source and target branches