diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2020-02-17 17:29:12 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2020-02-23 09:49:33 +0100 |
commit | 823b2104c3e579e8c3db8baab263dca0aa9d48bc (patch) | |
tree | 270aeb87d68c9669d37b1b8e78e48ff74ad12519 | |
parent | 517bf15603aba37014b62553eb008e26f2a1db48 (diff) | |
download | rneovim-823b2104c3e579e8c3db8baab263dca0aa9d48bc.tar.gz rneovim-823b2104c3e579e8c3db8baab263dca0aa9d48bc.tar.bz2 rneovim-823b2104c3e579e8c3db8baab263dca0aa9d48bc.zip |
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
-rw-r--r-- | src/nvim/channel.c | 1 | ||||
-rw-r--r-- | src/nvim/channel.h | 2 | ||||
-rw-r--r-- | 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 c66a0682e3..5eb29a7290 100644 --- a/src/nvim/channel.c +++ b/src/nvim/channel.c @@ -19,7 +19,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 c733e276be..9d26852ce5 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 56d9030a7f..4a9f2371a2 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -10,6 +10,7 @@ #include <msgpack.h> #include "nvim/ascii.h" +#include "nvim/channel.h" #include "nvim/vim.h" #include "nvim/main.h" #include "nvim/aucmd.h" |