wok-current view dbus-c++/stuff/dbus-c++-0.9.0-template-operators.patch @ rev 25727
Add miss stuff folder for libxml++, dbus-c++
author | Stanislas Leduc <shann@slitaz.org> |
---|---|
date | Tue Nov 05 13:46:37 2024 +0000 (2 weeks ago) |
parents | |
children |
line source
1 commit a0b9ef3b469ca23c6a3229d8abb967cbbddcee38
2 Author: Peter Williams <peter@newton.cx>
3 Date: Sat Dec 19 21:12:46 2015 -0500
5 Fix some weird template/operator issues on OS X.
7 I frankly don't understand at all what's going on here. These fixes
8 derive from:
10 https://chromium.googlesource.com/chromiumos/third_party/dbus-cplusplus/+/c3f69f6be02e31521474dce7eadf6ba4f4a7ce94
11 https://chromium.googlesource.com/chromiumos/third_party/dbus-cplusplus/+/7104857773f790a549d399715482fa23d9b736cd
13 Except I've dropped some changes that break the OS X build for me. Frankly, if
14 it compiles, that's good enough for me.
16 diff --git a/include/dbus-c++/types.h b/include/dbus-c++/types.h
17 index 044e72b..7b3108f 100644
18 --- a/include/dbus-c++/types.h
19 +++ b/include/dbus-c++/types.h
20 @@ -89,13 +89,7 @@ public:
21 }
23 template <typename T>
24 - operator T() const
25 - {
26 - T cast;
27 - MessageIter ri = _msg.reader();
28 - ri >> cast;
29 - return cast;
30 - }
31 + operator T() const;
33 private:
35 @@ -316,7 +310,7 @@ struct type< Struct<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
36 }
37 };
39 -} /* namespace DBus */
40 +extern DXXAPI DBus::MessageIter &operator << (DBus::MessageIter &iter, const DBus::Variant &val);
42 inline DBus::MessageIter &operator << (DBus::MessageIter &iter, const DBus::Invalid &)
43 {
44 @@ -551,6 +545,8 @@ inline DBus::MessageIter &operator >> (DBus::MessageIter &iter, DBus::Signature
45 return ++iter;
46 }
48 +extern DXXAPI DBus::MessageIter &operator >> (DBus::MessageIter &iter, DBus::Variant &val);
49 +
50 template<typename E>
51 inline DBus::MessageIter &operator >> (DBus::MessageIter &iter, std::vector<E>& val)
52 {
53 @@ -644,7 +640,16 @@ inline DBus::MessageIter &operator >> (DBus::MessageIter &iter, DBus::Struct<T1,
54 return ++iter;
55 }
57 -extern DXXAPI DBus::MessageIter &operator >> (DBus::MessageIter &iter, DBus::Variant &val);
58 +template <typename T>
59 +inline DBus::Variant::operator T() const
60 +{
61 + T cast;
62 + DBus::MessageIter ri = _msg.reader();
63 + ri >> cast;
64 + return cast;
65 +}
66 +
67 +} /* namespace DBus */
69 #endif//__DBUSXX_TYPES_H
71 diff --git a/src/types.cpp b/src/types.cpp
72 index d414a3e..70f9ac0 100644
73 --- a/src/types.cpp
74 +++ b/src/types.cpp
75 @@ -34,7 +34,7 @@
76 #include "message_p.h"
77 #include "internalerror.h"
79 -using namespace DBus;
80 +namespace DBus {
82 Variant::Variant()
83 : _msg(CallMessage()) // dummy message used as temporary storage for variant data
84 @@ -104,3 +104,4 @@ MessageIter &operator >> (MessageIter &iter, Variant &val)
85 return ++iter;
86 }
88 +} /* namespace DBus */