wmmoonclock: fix multiple definitions of some global variables.

A number of variables are declared in a header with no explicit linkage.
This results in there being definitions of them in multiple object
files, which causes a link failure with GCC 10, since this uses
-fno-common by default.

Add `extern` to the header declarations and separate declarations with
no linkage in xutils.c where they are assigned.

Link: https://bugs.debian.org/957950
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
This commit is contained in:
Jeremy Sowden 2020-04-23 09:43:31 +01:00 committed by Carlos R. Mafra
parent f3c5aa1780
commit 19f9137056
2 changed files with 14 additions and 5 deletions

View file

@ -40,6 +40,15 @@
/*
* Global variable
*/
Display *display;
Window Root;
Window iconwin, win;
int screen;
int DisplayDepth;
/* /*
* X11 Variables * X11 Variables
*/ */

View file

@ -20,11 +20,11 @@ typedef struct {
/* /*
* Global variable * Global variable
*/ */
Display *display; extern Display *display;
Window Root; extern Window Root;
Window iconwin, win; extern Window iconwin, win;
int screen; extern int screen;
int DisplayDepth; extern int DisplayDepth;