From 0493fa00fa12a071e3a577d4aaa62454f86cc566 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 17 Feb 2020 17:29:12 +0100 Subject: [PATCH] [release-0.4] nvim: Correctly setup global channels As gcc10 uses -fno-common by default, global variables declared with the same name more than once is not allowed anymore revealing this issue. We need to define it as extern to access it. See also https://bugzilla.redhat.com/show_bug.cgi?id=1799680 --- src/nvim/channel.c | 1 - src/nvim/channel.h | 2 +- src/nvim/main.c | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nvim/channel.c b/src/nvim/channel.c index f9102fa0e23..3b7ef8346eb 100644 --- a/src/nvim/channel.c +++ b/src/nvim/channel.c @@ -15,7 +15,6 @@ #include "nvim/ascii.h" static bool did_stdio = false; -PMap(uint64_t) *channels = NULL; /// next free id for a job or rpc channel /// 1 is reserved for stdio channel diff --git a/src/nvim/channel.h b/src/nvim/channel.h index c733e276bef..9d26852ce53 100644 --- a/src/nvim/channel.h +++ b/src/nvim/channel.h @@ -85,7 +85,7 @@ struct Channel { bool callback_scheduled; }; -EXTERN PMap(uint64_t) *channels; +EXTERN PMap(uint64_t) *channels INIT(= NULL); #ifdef INCLUDE_GENERATED_DECLARATIONS # include "channel.h.generated.h" diff --git a/src/nvim/main.c b/src/nvim/main.c index 1e849e6f12a..40a0ec63277 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -10,6 +10,7 @@ #include #include "nvim/ascii.h" +#include "nvim/channel.h" #include "nvim/vim.h" #include "nvim/main.h" #include "nvim/aucmd.h"