[packages/dbus-c++] - added template-operators patch from Fedora; release 7

qboosh qboosh at pld-linux.org
Tue Mar 28 21:45:50 CEST 2023


commit 3643e1889e65b3aa60c4285e08119cda15e8a5d8
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Tue Mar 28 21:48:16 2023 +0200

    - added template-operators patch from Fedora; release 7

 dbus-c++-template-operators.patch | 88 +++++++++++++++++++++++++++++++++++++++
 dbus-c++.spec                     |  4 +-
 2 files changed, 91 insertions(+), 1 deletion(-)
---
diff --git a/dbus-c++.spec b/dbus-c++.spec
index 14c06cc..187b2c7 100644
--- a/dbus-c++.spec
+++ b/dbus-c++.spec
@@ -6,7 +6,7 @@ Summary:	Native C++ bindings for D-Bus
 Summary(pl.UTF-8):	Natywne wiązania C++ do usługi D-Bus
 Name:		dbus-c++
 Version:	0.9.0
-Release:	6
+Release:	7
 License:	LGPL v2.1+
 Group:		Libraries
 Source0:	http://downloads.sourceforge.net/dbus-cplusplus/lib%{name}-%{version}.tar.gz
@@ -16,6 +16,7 @@ Patch1:		%{name}-gcc4.7.patch
 Patch2:		%{name}-linkfix.patch
 Patch3:		%{name}-threading.patch
 Patch4:		%{name}-write.patch
+Patch5:		%{name}-template-operators.patch
 URL:		http://sourceforge.net/projects/dbus-cplusplus/
 BuildRequires:	autoconf >= 2.59
 BuildRequires:	automake
@@ -148,6 +149,7 @@ Statyczna biblioteka dbus-c++-ecore.
 %patch2 -p1
 %patch3 -p1
 %patch4 -p1
+%patch5 -p1
 
 %build
 %{__libtoolize}
diff --git a/dbus-c++-template-operators.patch b/dbus-c++-template-operators.patch
new file mode 100644
index 0000000..e1a6d10
--- /dev/null
+++ b/dbus-c++-template-operators.patch
@@ -0,0 +1,88 @@
+commit a0b9ef3b469ca23c6a3229d8abb967cbbddcee38
+Author: Peter Williams <peter at newton.cx>
+Date:   Sat Dec 19 21:12:46 2015 -0500
+
+    Fix some weird template/operator issues on OS X.
+    
+    I frankly don't understand at all what's going on here. These fixes
+    derive from:
+    
+    https://chromium.googlesource.com/chromiumos/third_party/dbus-cplusplus/+/c3f69f6be02e31521474dce7eadf6ba4f4a7ce94
+    https://chromium.googlesource.com/chromiumos/third_party/dbus-cplusplus/+/7104857773f790a549d399715482fa23d9b736cd
+    
+    Except I've dropped some changes that break the OS X build for me. Frankly, if
+    it compiles, that's good enough for me.
+
+diff --git a/include/dbus-c++/types.h b/include/dbus-c++/types.h
+index 044e72b..7b3108f 100644
+--- a/include/dbus-c++/types.h
++++ b/include/dbus-c++/types.h
+@@ -89,13 +89,7 @@ public:
+   }
+ 
+   template <typename T>
+-  operator T() const
+-  {
+-    T cast;
+-    MessageIter ri = _msg.reader();
+-    ri >> cast;
+-    return cast;
+-  }
++  operator T() const;
+ 
+ private:
+ 
+@@ -316,7 +310,7 @@ struct type< Struct<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+   }
+ };
+ 
+-} /* namespace DBus */
++extern DXXAPI DBus::MessageIter &operator << (DBus::MessageIter &iter, const DBus::Variant &val);
+ 
+ inline DBus::MessageIter &operator << (DBus::MessageIter &iter, const DBus::Invalid &)
+ {
+@@ -551,6 +545,8 @@ inline DBus::MessageIter &operator >> (DBus::MessageIter &iter, DBus::Signature
+   return ++iter;
+ }
+ 
++extern DXXAPI DBus::MessageIter &operator >> (DBus::MessageIter &iter, DBus::Variant &val);
++
+ template<typename E>
+ inline DBus::MessageIter &operator >> (DBus::MessageIter &iter, std::vector<E>& val)
+ {
+@@ -644,7 +640,16 @@ inline DBus::MessageIter &operator >> (DBus::MessageIter &iter, DBus::Struct<T1,
+   return ++iter;
+ }
+ 
+-extern DXXAPI DBus::MessageIter &operator >> (DBus::MessageIter &iter, DBus::Variant &val);
++template <typename T>
++inline DBus::Variant::operator T() const
++{
++  T cast;
++  DBus::MessageIter ri = _msg.reader();
++  ri >> cast;
++  return cast;
++}
++
++} /* namespace DBus */
+ 
+ #endif//__DBUSXX_TYPES_H
+ 
+diff --git a/src/types.cpp b/src/types.cpp
+index d414a3e..70f9ac0 100644
+--- a/src/types.cpp
++++ b/src/types.cpp
+@@ -34,7 +34,7 @@
+ #include "message_p.h"
+ #include "internalerror.h"
+ 
+-using namespace DBus;
++namespace DBus {
+ 
+ Variant::Variant()
+   : _msg(CallMessage()) // dummy message used as temporary storage for variant data
+@@ -104,3 +104,4 @@ MessageIter &operator >> (MessageIter &iter, Variant &val)
+   return ++iter;
+ }
+ 
++} /* namespace DBus */
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/dbus-c++.git/commitdiff/3643e1889e65b3aa60c4285e08119cda15e8a5d8



More information about the pld-cvs-commit mailing list