File seafile-client_fix-compilation-glib2_68.patch of Package seafile-client
From abea2a0afa14ed2976a5fbc00094a2933b946b56 Mon Sep 17 00:00:00 2001
From: Aleksei Bavshin <alebastr89@gmail.com>
Date: Fri, 19 Feb 2021 14:01:31 +0000
Subject: [PATCH] Remove `extern "C"` around glib headers
Glib release 2.67.3 started conditionally using some C++ code[1] in the
public headers and it's no longer legal to include "glib.h" or anything
that includes it transitively from `extern "C"` block.
---
src/open-local-helper.cpp | 3 ---
src/rpc/rpc-client.cpp | 4 ----
src/rpc/rpc-client.h | 4 ----
src/rpc/rpc-server.cpp | 4 ++--
src/utils/uninstall-helpers.cpp | 3 ---
5 files changed, 2 insertions(+), 16 deletions(-)
diff --git a/src/open-local-helper.cpp b/src/open-local-helper.cpp
index a06d46532..2e4c26adb 100644
--- a/src/open-local-helper.cpp
+++ b/src/open-local-helper.cpp
@@ -7,7 +7,6 @@
#include <QUrlQuery>
#include <QVariant>
-extern "C" {
#include <searpc-client.h>
#include <searpc.h>
@@ -19,8 +18,6 @@ extern "C" {
#include <seafile/seafile-object.h>
#endif
-}
-
#include "utils/utils.h"
#include "seafile-applet.h"
#include "ui/main-window.h"
diff --git a/src/rpc/rpc-client.cpp b/src/rpc/rpc-client.cpp
index 2c8b7fdf3..e60741b74 100644
--- a/src/rpc/rpc-client.cpp
+++ b/src/rpc/rpc-client.cpp
@@ -1,5 +1,3 @@
-extern "C" {
-
#include <searpc-client.h>
#include <searpc-named-pipe-transport.h>
@@ -12,8 +10,6 @@ extern "C" {
#include <seafile/seafile-object.h>
#endif
-}
-
#include <QtDebug>
#include <QMutexLocker>
diff --git a/src/rpc/rpc-client.h b/src/rpc/rpc-client.h
index e92d06281..011656c81 100644
--- a/src/rpc/rpc-client.h
+++ b/src/rpc/rpc-client.h
@@ -6,14 +6,10 @@
#include <QObject>
#include <QMutex>
-extern "C" {
-
struct _GList;
// Can't forward-declare type SearpcClient here because it is an anonymous typedef struct
#include <searpc-client.h>
-}
-
// Here we can't forward-declare type json_t because it is an anonymous typedef
// struct, and unlike libsearpc we have no way to rewrite its definition to give
// it a name.
diff --git a/src/rpc/rpc-server.cpp b/src/rpc/rpc-server.cpp
index a17b50e0c..dbe78ccb8 100644
--- a/src/rpc/rpc-server.cpp
+++ b/src/rpc/rpc-server.cpp
@@ -1,10 +1,10 @@
-extern "C" {
-
#include <searpc.h>
#include <searpc-client.h>
#include <searpc-server.h>
#include <searpc-named-pipe-transport.h>
+extern "C" {
+
#include "searpc-signature.h"
#include "searpc-marshal.h"
diff --git a/src/utils/uninstall-helpers.cpp b/src/utils/uninstall-helpers.cpp
index a238cf45e..e99db527d 100644
--- a/src/utils/uninstall-helpers.cpp
+++ b/src/utils/uninstall-helpers.cpp
@@ -1,4 +1,3 @@
-extern "C" {
#include <searpc-client.h>
#include <searpc.h>
@@ -10,8 +9,6 @@ extern "C" {
#include <seafile/seafile-object.h>
#endif
-}
-
#include <QtGlobal>
#if defined(Q_OS_WIN32)