File fcitx5-gcc7.patch of Package fcitx5

Index: fcitx5-5.0.7/src/frontend/ibusfrontend/ibusfrontend.cpp
===================================================================
--- fcitx5-5.0.7.orig/src/frontend/ibusfrontend/ibusfrontend.cpp
+++ fcitx5-5.0.7/src/frontend/ibusfrontend/ibusfrontend.cpp
@@ -580,14 +580,23 @@ private:
         ([]() -> dbus::DBusStruct<uint32_t, uint32_t> {
             return {0, 0};
         }),
+#if __GNUC__ < 9
+        ([&](dbus::DBusStruct<uint32_t, uint32_t> type) {
+#else
         ([this](dbus::DBusStruct<uint32_t, uint32_t> type) {
+#endif
             setContentType(std::get<0>(type), std::get<1>(type));
         }),
         dbus::PropertyOption::Hidden);
     FCITX_OBJECT_VTABLE_WRITABLE_PROPERTY(
         clientCommitPreedit, "ClientCommitPreedit", "(b)",
+#if __GNUC__ < 9
+        ([&]() -> dbus::DBusStruct<bool> { return {clientCommitPreedit_}; }),
+        ([&](dbus::DBusStruct<bool> value) {
+#else
         ([this]() -> dbus::DBusStruct<bool> { return {clientCommitPreedit_}; }),
         ([this](dbus::DBusStruct<bool> value) {
+#endif
             clientCommitPreedit_ = std::get<0>(value);
         }),
         dbus::PropertyOption::Hidden);
Index: fcitx5-5.0.7/test/testdbus.cpp
===================================================================
--- fcitx5-5.0.7.orig/test/testdbus.cpp
+++ fcitx5-5.0.7/test/testdbus.cpp
@@ -67,7 +67,11 @@ private:
                                  []() { return 5; });
     FCITX_OBJECT_VTABLE_WRITABLE_PROPERTY(
         testProperty2, "testProperty2", "i", [this]() { return prop2; },
-        [this](int32_t v) { prop2 = v; });
+#if __GNUC__ < 9
+        [&](int32_t v) { prop2 = v; });
+#else
+        [this](int32_t v) { prop2 = v; });
+#endif
 };
 
 #define TEST_SERVICE "org.fcitx.Fcitx.TestDBus"
openSUSE Build Service is sponsored by