]>
Commit | Line | Data |
---|---|---|
de154302 JR |
1 | Author: Pino Toscano <pino@debian.org> |
2 | Description: Fix building with GCC 4.7 | |
3 | This patch fixes the two kinds of issues that arise with GCC 4.7: | |
4 | - include <unistd.h> for functions like access(), fork(), readlink(), etc | |
5 | - fix argument-dependent lookup issues by qualifying the lookup of functions | |
6 | Forwarded: no | |
7 | Last-Update: 2012-04-04 | |
8 | ||
9 | --- a/ggadget/scriptable_enumerator.h | |
10 | +++ b/ggadget/scriptable_enumerator.h | |
11 | @@ -68,22 +68,22 @@ | |
12 | ||
13 | protected: | |
14 | virtual void DoClassRegister() { | |
15 | - RegisterMethod("atEnd", | |
16 | + this->RegisterMethod("atEnd", | |
17 | NewSlot(&E::AtEnd, | |
18 | &ScriptableEnumerator<E, Wrapper, Param, ClassId> | |
19 | ::enumerator_)); | |
20 | - RegisterMethod("moveFirst", | |
21 | + this->RegisterMethod("moveFirst", | |
22 | NewSlot(&E::MoveFirst, | |
23 | &ScriptableEnumerator<E, Wrapper, Param, ClassId> | |
24 | ::enumerator_)); | |
25 | - RegisterMethod("moveNext", | |
26 | + this->RegisterMethod("moveNext", | |
27 | NewSlot(&E::MoveNext, | |
28 | &ScriptableEnumerator<E, Wrapper, Param, ClassId> | |
29 | ::enumerator_)); | |
30 | - RegisterMethod("item", | |
31 | + this->RegisterMethod("item", | |
32 | NewSlot(&ScriptableEnumerator<E, Wrapper, Param, ClassId> | |
33 | ::GetItem)); | |
34 | - RegisterProperty("count", | |
35 | + this->RegisterProperty("count", | |
36 | NewSlot(&E::GetCount, | |
37 | &ScriptableEnumerator<E, Wrapper, Param, ClassId> | |
38 | ::enumerator_), | |
39 | --- a/ggadget/uuid.cc | |
40 | +++ b/ggadget/uuid.cc | |
41 | @@ -24,6 +24,7 @@ | |
42 | #include <cstdlib> | |
43 | #include <cstring> | |
44 | #include <ctime> | |
45 | +#include <unistd.h> | |
46 | ||
47 | #include "string_utils.h" | |
48 | ||
49 | --- a/ggadget/xml_dom.cc | |
50 | +++ b/ggadget/xml_dom.cc | |
51 | @@ -1327,15 +1327,15 @@ | |
52 | ||
53 | virtual void DoClassRegister() { | |
54 | Super::DoClassRegister(); | |
55 | - RegisterProperty("data", NewSlot(&DOMCharacterData::GetData), | |
56 | + this->RegisterProperty("data", NewSlot(&DOMCharacterData::GetData), | |
57 | NewSlot(&DOMCharacterData::SetData)); | |
58 | - RegisterProperty("length", NewSlot(&DOMCharacterData::GetLength), NULL); | |
59 | - RegisterMethod("substringData", | |
60 | + this->RegisterProperty("length", NewSlot(&DOMCharacterData::GetLength), NULL); | |
61 | + this->RegisterMethod("substringData", | |
62 | NewSlot(&DOMCharacterData::ScriptSubstringData)); | |
63 | - RegisterMethod("appendData", NewSlot(&DOMCharacterData::AppendData)); | |
64 | - RegisterMethod("insertData", NewSlot(&DOMCharacterData::ScriptInsertData)); | |
65 | - RegisterMethod("deleteData", NewSlot(&DOMCharacterData::ScriptDeleteData)); | |
66 | - RegisterMethod("replaceData", | |
67 | + this->RegisterMethod("appendData", NewSlot(&DOMCharacterData::AppendData)); | |
68 | + this->RegisterMethod("insertData", NewSlot(&DOMCharacterData::ScriptInsertData)); | |
69 | + this->RegisterMethod("deleteData", NewSlot(&DOMCharacterData::ScriptDeleteData)); | |
70 | + this->RegisterMethod("replaceData", | |
71 | NewSlot(&DOMCharacterData::ScriptReplaceData)); | |
72 | } | |
73 | ||
74 | @@ -1377,20 +1377,20 @@ | |
75 | private: | |
76 | UTF16String ScriptSubstringData(size_t offset, size_t count) { | |
77 | UTF16String result; | |
78 | - CheckException(SubstringData(offset, count, &result)); | |
79 | + this->CheckException(SubstringData(offset, count, &result)); | |
80 | return result; | |
81 | } | |
82 | ||
83 | void ScriptInsertData(size_t offset, const UTF16String &arg) { | |
84 | - CheckException(InsertData(offset, arg)); | |
85 | + this->CheckException(InsertData(offset, arg)); | |
86 | } | |
87 | ||
88 | void ScriptDeleteData(size_t offset, size_t count) { | |
89 | - CheckException(DeleteData(offset, count)); | |
90 | + this->CheckException(DeleteData(offset, count)); | |
91 | } | |
92 | ||
93 | void ScriptReplaceData(size_t offset, size_t count, const UTF16String &arg) { | |
94 | - CheckException(ReplaceData(offset, count, arg)); | |
95 | + this->CheckException(ReplaceData(offset, count, arg)); | |
96 | } | |
97 | ||
98 | DOMCharacterDataImpl impl_; | |
99 | @@ -1417,10 +1417,10 @@ | |
100 | ||
101 | virtual void DoClassRegister() { | |
102 | Super::DoClassRegister(); | |
103 | - RegisterProperty("name", NewSlot(&DOMAttr::GetName), NULL); | |
104 | + this->RegisterProperty("name", NewSlot(&DOMAttr::GetName), NULL); | |
105 | // Our DOMAttrs are always specified, because we don't support DTD for now. | |
106 | - RegisterConstant("specified", true); | |
107 | - RegisterProperty("value", NewSlot(&DOMAttr::GetValue), | |
108 | + this->RegisterConstant("specified", true); | |
109 | + this->RegisterProperty("value", NewSlot(&DOMAttr::GetValue), | |
110 | NewSlot(&DOMAttr::SetValue)); | |
111 | // ownerElement is a DOM2 property, so not registered for now. | |
112 | } | |
113 | @@ -1516,19 +1516,19 @@ | |
114 | ||
115 | virtual void DoClassRegister() { | |
116 | Super::DoClassRegister(); | |
117 | - RegisterProperty("tagName", NewSlot(&DOMElement::GetTagName), NULL); | |
118 | - RegisterMethod("getAttribute", NewSlot(&DOMElement::GetAttribute)); | |
119 | - RegisterMethod("setAttribute", | |
120 | + this->RegisterProperty("tagName", NewSlot(&DOMElement::GetTagName), NULL); | |
121 | + this->RegisterMethod("getAttribute", NewSlot(&DOMElement::GetAttribute)); | |
122 | + this->RegisterMethod("setAttribute", | |
123 | NewSlot(&DOMElement::ScriptSetAttribute)); | |
124 | - RegisterMethod("removeAttribute", | |
125 | + this->RegisterMethod("removeAttribute", | |
126 | NewSlot(&DOMElement::RemoveAttribute)); | |
127 | - RegisterMethod("getAttributeNode", | |
128 | + this->RegisterMethod("getAttributeNode", | |
129 | NewSlot(&DOMElement::GetAttributeNodeNotConst)); | |
130 | - RegisterMethod("setAttributeNode", | |
131 | + this->RegisterMethod("setAttributeNode", | |
132 | NewSlot(&DOMElement::ScriptSetAttributeNode)); | |
133 | - RegisterMethod("removeAttributeNode", | |
134 | + this->RegisterMethod("removeAttributeNode", | |
135 | NewSlot(&DOMElement::ScriptRemoveAttributeNode)); | |
136 | - RegisterMethod("getElementsByTagName", | |
137 | + this->RegisterMethod("getElementsByTagName", | |
138 | NewSlot(&Super::GetElementsByTagNameNotConst)); | |
139 | } | |
140 | ||
141 | @@ -1696,16 +1696,16 @@ | |
142 | } | |
143 | ||
144 | virtual void DoClassRegister() { | |
145 | - RegisterProperty("length", NewSlot(&AttrsNamedMap::GetLength), NULL); | |
146 | - RegisterMethod("getNamedItem", | |
147 | + this->RegisterProperty("length", NewSlot(&AttrsNamedMap::GetLength), NULL); | |
148 | + this->RegisterMethod("getNamedItem", | |
149 | NewSlot(&AttrsNamedMap::GetNamedItemNotConst)); | |
150 | - RegisterMethod("setNamedItem", | |
151 | + this->RegisterMethod("setNamedItem", | |
152 | NewSlot(&AttrsNamedMap::ScriptSetNamedItem)); | |
153 | - RegisterMethod("removeNamedItem", | |
154 | + this->RegisterMethod("removeNamedItem", | |
155 | NewSlot(&AttrsNamedMap::ScriptRemoveNamedItem)); | |
156 | - RegisterMethod("item", NewSlot(&AttrsNamedMap::GetItemNotConst)); | |
157 | + this->RegisterMethod("item", NewSlot(&AttrsNamedMap::GetItemNotConst)); | |
158 | // Microsoft compatibility. | |
159 | - RegisterMethod("", NewSlot(&AttrsNamedMap::GetItemNotConst)); | |
160 | + this->RegisterMethod("", NewSlot(&AttrsNamedMap::GetItemNotConst)); | |
161 | } | |
162 | ||
163 | virtual DOMNodeInterface *GetNamedItem(const std::string &name) { | |
164 | @@ -1875,7 +1875,7 @@ | |
165 | ||
166 | virtual void DoClassRegister() { | |
167 | Super::DoClassRegister(); | |
168 | - RegisterMethod("splitText", NewSlot(&DOMText::ScriptSplitText)); | |
169 | + this->RegisterMethod("splitText", NewSlot(&DOMText::ScriptSplitText)); | |
170 | } | |
171 | ||
172 | virtual NodeType GetNodeType() const { return TEXT_NODE; } | |
173 | @@ -2060,9 +2060,9 @@ | |
174 | ||
175 | virtual void DoClassRegister() { | |
176 | Super::DoClassRegister(); | |
177 | - RegisterProperty("target", | |
178 | + this->RegisterProperty("target", | |
179 | NewSlot(&DOMProcessingInstruction::GetTarget), NULL); | |
180 | - RegisterProperty("data", NewSlot(&DOMProcessingInstruction::GetData), | |
181 | + this->RegisterProperty("data", NewSlot(&DOMProcessingInstruction::GetData), | |
182 | NewSlot(&DOMProcessingInstruction::SetData)); | |
183 | } | |
184 | ||
185 | @@ -2109,7 +2109,7 @@ | |
186 | DEFINE_CLASS_ID(0xd23149a89cf24e12, DOMImplementationInterface); | |
187 | ||
188 | virtual void DoClassRegister() { | |
189 | - RegisterMethod("hasFeature", NewSlot(&DOMImplementation::HasFeature)); | |
190 | + this->RegisterMethod("hasFeature", NewSlot(&DOMImplementation::HasFeature)); | |
191 | } | |
192 | ||
193 | virtual bool HasFeature(const char *feature, const char *version) const { | |
194 | @@ -2129,13 +2129,13 @@ | |
195 | void SetCode(int code) { code_ = code; } | |
196 | ||
197 | virtual void DoClassRegister() { | |
198 | - RegisterProperty("errorCode", NewSlot(&ParseError::GetCode), NULL); | |
199 | - RegisterConstant("filepos", 0); | |
200 | - RegisterConstant("line", 0); | |
201 | - RegisterConstant("linepos", 0); | |
202 | - RegisterConstant("reason", ""); | |
203 | - RegisterConstant("srcText", ""); | |
204 | - RegisterConstant("url", ""); | |
205 | + this->RegisterProperty("errorCode", NewSlot(&ParseError::GetCode), NULL); | |
206 | + this->RegisterConstant("filepos", 0); | |
207 | + this->RegisterConstant("line", 0); | |
208 | + this->RegisterConstant("linepos", 0); | |
209 | + this->RegisterConstant("reason", ""); | |
210 | + this->RegisterConstant("srcText", ""); | |
211 | + this->RegisterConstant("url", ""); | |
212 | } | |
213 | ||
214 | private: | |
215 | @@ -2180,45 +2180,45 @@ | |
216 | ||
217 | virtual void DoClassRegister() { | |
218 | Super::DoClassRegister(); | |
219 | - RegisterConstant("doctype", static_cast<ScriptableInterface *>(NULL)); | |
220 | - RegisterConstant("implementation", &dom_implementation_); | |
221 | - RegisterProperty("documentElement", | |
222 | + this->RegisterConstant("doctype", static_cast<ScriptableInterface *>(NULL)); | |
223 | + this->RegisterConstant("implementation", &dom_implementation_); | |
224 | + this->RegisterProperty("documentElement", | |
225 | NewSlot(&DOMDocument::GetDocumentElementNotConst), NULL); | |
226 | - RegisterMethod("loadXML", NewSlot(&DOMDocument::LoadXML)); | |
227 | - RegisterMethod("createElement", | |
228 | + this->RegisterMethod("loadXML", NewSlot(&DOMDocument::LoadXML)); | |
229 | + this->RegisterMethod("createElement", | |
230 | NewSlot(&DOMDocument::ScriptCreateElement)); | |
231 | - RegisterMethod("createDocumentFragment", | |
232 | + this->RegisterMethod("createDocumentFragment", | |
233 | NewSlot(&DOMDocument::CreateDocumentFragment)); | |
234 | - RegisterMethod("createTextNode", | |
235 | + this->RegisterMethod("createTextNode", | |
236 | NewSlot(&DOMDocument::CreateTextNode)); | |
237 | - RegisterMethod("createComment", NewSlot(&DOMDocument::CreateComment)); | |
238 | - RegisterMethod("createCDATASection", | |
239 | + this->RegisterMethod("createComment", NewSlot(&DOMDocument::CreateComment)); | |
240 | + this->RegisterMethod("createCDATASection", | |
241 | NewSlot(&DOMDocument::CreateCDATASection)); | |
242 | - RegisterMethod("createProcessingInstruction", | |
243 | + this->RegisterMethod("createProcessingInstruction", | |
244 | NewSlot(&DOMDocument::ScriptCreateProcessingInstruction)); | |
245 | - RegisterMethod("createAttribute", | |
246 | + this->RegisterMethod("createAttribute", | |
247 | NewSlot(&DOMDocument::ScriptCreateAttribute)); | |
248 | - RegisterMethod("createEntityReference", | |
249 | + this->RegisterMethod("createEntityReference", | |
250 | NewSlot(&DOMDocument::ScriptCreateEntityReference)); | |
251 | - RegisterMethod("getElementsByTagName", | |
252 | + this->RegisterMethod("getElementsByTagName", | |
253 | NewSlot(&Super::GetElementsByTagNameNotConst)); | |
254 | - RegisterMethod("importNode", NewSlot(&DOMDocument::ScriptImportNode)); | |
255 | + this->RegisterMethod("importNode", NewSlot(&DOMDocument::ScriptImportNode)); | |
256 | // Compatibility with Microsoft DOM. | |
257 | - RegisterProperty("parsed", NewFixedGetterSlot(true), NULL); | |
258 | - RegisterProperty("parseError", NewSlot(&DOMDocument::GetParseError), NULL); | |
259 | - RegisterProperty("resolveExternals", NULL, NewSlot(&DummySetter)); | |
260 | - RegisterProperty("validateOnParse", NULL, NewSlot(&DummySetter)); | |
261 | - RegisterProperty("preserveWhiteSpace", | |
262 | + this->RegisterProperty("parsed", NewFixedGetterSlot(true), NULL); | |
263 | + this->RegisterProperty("parseError", NewSlot(&DOMDocument::GetParseError), NULL); | |
264 | + this->RegisterProperty("resolveExternals", NULL, NewSlot(&DummySetter)); | |
265 | + this->RegisterProperty("validateOnParse", NULL, NewSlot(&DummySetter)); | |
266 | + this->RegisterProperty("preserveWhiteSpace", | |
267 | NewSlot(&DOMDocument::PreservesWhiteSpace), | |
268 | NewSlot(&DOMDocument::SetPreserveWhiteSpace)); | |
269 | - RegisterMethod("getProperty", NewSlot(DummyGetProperty)); | |
270 | - RegisterMethod("setProperty", NewSlot(DummySetProperty)); | |
271 | + this->RegisterMethod("getProperty", NewSlot(DummyGetProperty)); | |
272 | + this->RegisterMethod("setProperty", NewSlot(DummySetProperty)); | |
273 | // Compatibility with Microsoft DOM: XMLHttpRequest functions. | |
274 | - RegisterProperty("async", NewSlot(&DOMDocument::IsAsync), | |
275 | + this->RegisterProperty("async", NewSlot(&DOMDocument::IsAsync), | |
276 | NewSlot(&DOMDocument::SetAsync)); | |
277 | - RegisterProperty("readyState", NewSlot(&DOMDocument::GetReadyState), NULL); | |
278 | - RegisterMethod("load", NewSlot(&DOMDocument::Load)); | |
279 | - RegisterClassSignal("onreadystatechange", | |
280 | + this->RegisterProperty("readyState", NewSlot(&DOMDocument::GetReadyState), NULL); | |
281 | + this->RegisterMethod("load", NewSlot(&DOMDocument::Load)); | |
282 | + this->RegisterClassSignal("onreadystatechange", | |
283 | &DOMDocument::onreadystatechange_signal_); | |
284 | } | |
285 | ||
286 | --- a/ggadget/xdg/icon_theme.cc | |
287 | +++ b/ggadget/xdg/icon_theme.cc | |
288 | @@ -16,6 +16,7 @@ | |
289 | #include <sys/time.h> | |
290 | #include <time.h> | |
291 | #include <cstdlib> | |
292 | +#include <unistd.h> | |
293 | ||
294 | #include <map> | |
295 | #include <vector> | |
296 | --- a/extensions/qt_system_framework/qt_system_framework.cc | |
297 | +++ b/extensions/qt_system_framework/qt_system_framework.cc | |
298 | @@ -32,6 +32,7 @@ | |
299 | #include <ggadget/xdg/desktop_entry.h> | |
300 | #include <ggadget/xdg/icon_theme.h> | |
301 | #include <ggadget/xdg/utilities.h> | |
302 | +#include <unistd.h> | |
303 | ||
304 | #define Initialize qt_system_framework_LTX_Initialize | |
305 | #define Finalize qt_system_framework_LTX_Finalize | |
306 | --- a/extensions/linux_system_framework/process.cc | |
307 | +++ b/extensions/linux_system_framework/process.cc | |
308 | @@ -17,6 +17,7 @@ | |
309 | #include <sys/types.h> | |
310 | #include <dirent.h> | |
311 | #include <cstdlib> | |
312 | +#include <unistd.h> | |
313 | ||
314 | #ifdef HAVE_X11 | |
315 | #include <X11/Xlib.h> | |
316 | --- a/gadgets/designer/designer_script_utils.cc | |
317 | +++ b/gadgets/designer/designer_script_utils.cc | |
318 | @@ -39,6 +39,7 @@ | |
319 | #include <ggadget/system_utils.h> | |
320 | #include <ggadget/uuid.h> | |
321 | #include <ggadget/view_interface.h> | |
322 | +#include <unistd.h> | |
323 | ||
324 | namespace ggadget { | |
325 | namespace designer { |