hc
2024-11-01 a01b5c9f91adaee088a817861603a5dbe14775c2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
From f04f24dd5ca5c1c13608b144ab66e2ccd47f106a Mon Sep 17 00:00:00 2001
From: Sergei Trofimovich <slyfox@gentoo.org>
Date: Sun, 19 Jan 2020 19:53:41 +0000
Subject: [PATCH] src/headers/daemon.h: avoid redefinition of
 'last_selection_time'
 
Noticed build failure on gcc-10 as:
 
```
gcc  -L/home/slyfox/dev/git/gpm/src  -o gpm mice.o ... report.o tools.o   -lm
ld: twiddler.o:gpm/src/headers/daemon.h:183:
  multiple definition of `last_selection_time'; mice.o:gpm/src/headers/daemon.h:183: first defined here
ld: synaptics.o:git/gpm/src/headers/daemon.h:183:
  multiple definition of `last_selection_time'; mice.o:git/gpm/src/headers/daemon.h:183: first defined here
```
 
gcc-10 will change the default from -fcommon to fno-common:
https://gcc.gnu.org/PR85678.
 
The error also happens if CFLAGS=-fno-common passed explicitly.
 
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
---
 src/headers/daemon.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 
diff --git a/src/headers/daemon.h b/src/headers/daemon.h
index a8936ad..24a1a97 100644
--- a/src/headers/daemon.h
+++ b/src/headers/daemon.h
@@ -180,7 +180,7 @@ extern struct mouse_features  mouse_table[3],
 extern Gpm_Type         mice[];
 extern Gpm_Type         *repeated_type;
 
-time_t                  last_selection_time;
+extern time_t           last_selection_time;
 
 
 
-- 
2.20.1