From a09edcda9e87271b4e7d550c11fdf7ec295b29d5 Mon Sep 17 00:00:00 2001 From: Jeremy Sowden Date: Fri, 17 Apr 2020 17:34:03 +0100 Subject: [PATCH] Fix multiple definitions of display variable. The display variable is declared in a header with no explicit linkage. This results in there being multiple definitions of it in wmbiff.o and libwmgeneral.a and a failure during linking with gcc 10. Add `extern` to the header declaration and a separate declaration with no linkage in wmgeneral.c where it is assigned. Link: https://bugs.debian.org/957937 Signed-off-by: Jeremy Sowden --- wmbiff/wmgeneral/wmgeneral.c | 1 + wmbiff/wmgeneral/wmgeneral.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/wmbiff/wmgeneral/wmgeneral.c b/wmbiff/wmgeneral/wmgeneral.c index 0f8c267..6dfc644 100644 --- a/wmbiff/wmgeneral/wmgeneral.c +++ b/wmbiff/wmgeneral/wmgeneral.c @@ -65,6 +65,7 @@ /* X11 Variables */ /*****************/ +Display *display; Window Root; int screen; int x_fd; diff --git a/wmbiff/wmgeneral/wmgeneral.h b/wmbiff/wmgeneral/wmgeneral.h index 8496966..33295b4 100644 --- a/wmbiff/wmgeneral/wmgeneral.h +++ b/wmbiff/wmgeneral/wmgeneral.h @@ -36,7 +36,7 @@ typedef struct { /* Global variable */ /*******************/ -Display *display; +extern Display *display; /***********************/ /* Function Prototypes */