Merge lp:~vanvugt/compiz/fix-1067598 into lp:compiz/0.9.9

Proposed by Daniel van Vugt
Status: Merged
Approved by: Brandon Schaefer
Approved revision: 3432
Merged at revision: 3432
Proposed branch: lp:~vanvugt/compiz/fix-1067598
Merge into: lp:compiz/0.9.9
Diff against target: 94 lines (+23/-5)
5 files modified
include/core/CMakeLists.txt (+1/-0)
include/core/option.h (+4/-3)
include/core/templates.h (+14/-0)
src/rect/include/core/rect.h (+2/-1)
src/region/include/core/region.h (+2/-1)
To merge this branch: bzr merge lp:~vanvugt/compiz/fix-1067598
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Brandon Schaefer (community) Approve
Compiz Maintainers Pending
Review via email: mp+130033@code.launchpad.net

Commit message

Make core extern std templates compatible with C++0x projects like Unity.
(LP: #1067598)

Description of the change

Since I can't reproduce this original problem with Unity, I'd like someone who can to test this.

To post a comment you must log in.
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

Confirmed fixing the compiler error, and the changes look good.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'include/core/CMakeLists.txt'
2--- include/core/CMakeLists.txt 2012-09-04 15:33:44 +0000
3+++ include/core/CMakeLists.txt 2012-10-17 06:28:24 +0000
4@@ -16,6 +16,7 @@
5 session.h
6 size.h
7 string.h
8+ templates.h
9 window.h
10 wrapsystem.h
11 abiversion.h
12
13=== modified file 'include/core/option.h'
14--- include/core/option.h 2012-10-16 03:36:10 +0000
15+++ include/core/option.h 2012-10-17 06:28:24 +0000
16@@ -28,6 +28,7 @@
17 #ifndef _COMPOPTION_H
18 #define _COMPOPTION_H
19
20+#include <core/templates.h>
21 #include <core/string.h>
22
23 #include <boost/variant.hpp>
24@@ -302,9 +303,9 @@
25 PrivateOption *priv;
26 };
27
28-extern template class std::vector<unsigned short>;
29-extern template class std::vector<CompOption::Value>;
30-extern template class std::vector<CompOption>;
31+COMPIZ_EXTERN_STD(vector<unsigned short>)
32+COMPIZ_EXTERN_STD(vector<CompOption::Value>)
33+COMPIZ_EXTERN_STD(vector<CompOption>)
34
35 namespace compiz {
36 namespace detail {
37
38=== added file 'include/core/templates.h'
39--- include/core/templates.h 1970-01-01 00:00:00 +0000
40+++ include/core/templates.h 2012-10-17 06:28:24 +0000
41@@ -0,0 +1,14 @@
42+#ifndef _COMPIZ_TEMPLATES_H
43+#define _COMPIZ_TEMPLATES_H
44+
45+#ifdef __GXX_EXPERIMENTAL_CXX0X__
46+// Compiz core is built for C++98. If you're not then get your own templates...
47+#define COMPIZ_EXTERN_STD(_c)
48+#else
49+#define COMPIZ_EXTERN_STD(_c) extern template class std::_c;
50+#endif
51+
52+// Non-std templates are unaffected by C++0x
53+#define COMPIZ_EXTERN(_c) extern template class _c;
54+
55+#endif
56
57=== modified file 'src/rect/include/core/rect.h'
58--- src/rect/include/core/rect.h 2012-10-16 15:57:29 +0000
59+++ src/rect/include/core/rect.h 2012-10-17 06:28:24 +0000
60@@ -26,6 +26,7 @@
61 #ifndef _COMPRECT_H
62 #define _COMPRECT_H
63
64+#include <core/templates.h>
65 #include <core/point.h>
66 #include <core/size.h>
67 #include <vector>
68@@ -135,7 +136,7 @@
69 REGION mRegion;
70 };
71
72-extern template class std::vector<CompRect>;
73+COMPIZ_EXTERN_STD(vector<CompRect>)
74
75 namespace compiz
76 {
77
78=== modified file 'src/region/include/core/region.h'
79--- src/region/include/core/region.h 2012-10-16 15:57:29 +0000
80+++ src/region/include/core/region.h 2012-10-17 06:28:24 +0000
81@@ -29,11 +29,12 @@
82 #include <X11/Xutil.h>
83 #include <X11/Xregion.h>
84
85+#include <core/templates.h>
86 #include <core/rect.h>
87 #include <core/point.h>
88
89 class CompRegion;
90-extern template class std::vector<CompRegion>;
91+COMPIZ_EXTERN_STD(vector<CompRegion>)
92
93 /**
94 * A 2D region with an (x,y) position and arbitrary dimensions similar to

Subscribers

People subscribed via source and target branches