Mark global wayland constant extern

Without `extern`, the changed lines are not declarations,
but "tentative definitions"
(according to GCC man page, option `-fcommon`).
When specified in a header file
that is included in more than one `.c` file,
these result in linking failure unless `-fcommon` is specified.

GCC 10 changed the default from `-fcommon` to `-fno-common`,
and as such the previous code no longer links properly.

With `extern`, these lines are considered declarations,
and the linking proceeds successfully.
This commit is contained in:
Jan Staněk 2020-02-06 17:35:20 +01:00
parent 7170c93f3a
commit 2f45c191bc
No known key found for this signature in database
GPG Key ID: 2972F2037B243B6D

View File

@ -33,8 +33,8 @@ enum mask {
MASK_LAST
};
const char *BM_XKB_MASK_NAMES[MASK_LAST];
const enum mod_bit BM_XKB_MODS[MASK_LAST];
extern const char *BM_XKB_MASK_NAMES[MASK_LAST];
extern const enum mod_bit BM_XKB_MODS[MASK_LAST];
struct xkb {
struct xkb_state *state;