Blob Blame Raw
From 04bed51561fba5496e10422aa7e8d622749db8d5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Tue, 21 Jan 2020 17:12:44 +0100
Subject: [PATCH] Define global variables only once
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

GCC 10 stopped hiding doubled variable definition. That leads to
linker errors like this:

wmfrog-0.3.1/Src/xutils.h:25: multiple definition of `DisplayDepth'; wmFrog.o:/builddir/build/BUILD/wmfrog-0.3.1/Src/xutils.h:25: first defined here

This patch fixes it.

Signed-off-by: Petr Písař <ppisar@redhat.com>
---
 Src/xutils.c |  9 +++++++++
 Src/xutils.h | 10 +++++-----
 2 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/Src/xutils.c b/Src/xutils.c
index 5a2928b..ea660e1 100644
--- a/Src/xutils.c
+++ b/Src/xutils.c
@@ -40,6 +40,15 @@
 #include "xutils.h"
 
 
+/*
+ *   Global variable
+ */
+Display		*display;
+Window		Root;
+Window		iconwin, win;
+int		screen;
+int		DisplayDepth;
+
 
 /*
  *   X11 Variables 
diff --git a/Src/xutils.h b/Src/xutils.h
index 5b6231f..9f52881 100644
--- a/Src/xutils.h
+++ b/Src/xutils.h
@@ -18,11 +18,11 @@ typedef struct {
 /*
  *   Global variable
  */
-Display		*display;
-Window          Root;
-Window          iconwin, win;
-int             screen; 
-int             DisplayDepth;
+extern Display		*display;
+extern Window		Root;
+extern Window		iconwin, win;
+extern int		screen;
+extern int		DisplayDepth;
 
 
 
-- 
2.21.1