1From 9839c169f513e65fc711646257b3e8588cce623c Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 5 Aug 2020 12:06:01 -0700
4Subject: [PATCH] libacpi: Fix build witth -fno-commom
5
6Upstream-Status: Pending
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9---
10 libacpi.c | 16 ++++++++++++++++
11 libacpi.h |  6 +++---
12 2 files changed, 19 insertions(+), 3 deletions(-)
13
14diff --git a/libacpi.c b/libacpi.c
15index 4e34725..9344ea4 100644
16--- a/libacpi.c
17+++ b/libacpi.c
18@@ -14,6 +14,22 @@
19 #include "libacpi.h"
20 #include "list.h"
21
22+/**
23+ * Array for existing batteries, loop until
24+ * globals->battery_count
25+ */
26+battery_t batteries[MAX_ITEMS];
27+/**
28+ * Array for existing thermal zones, loop until
29+ * globals->thermal_count
30+ */
31+thermal_t thermals[MAX_ITEMS];
32+/**
33+ * Array for existing fans, loop until
34+ * globals->fan_count
35+ */
36+fan_t fans[MAX_ITEMS];
37+
38 static int read_acpi_battinfo(const int num);
39 static int read_acpi_battalarm(const int num);
40 static int read_acpi_battstate(const int num);
41diff --git a/libacpi.h b/libacpi.h
42index 9334b79..5242d3d 100644
43--- a/libacpi.h
44+++ b/libacpi.h
45@@ -183,17 +183,17 @@ typedef struct {
46  * Array for existing batteries, loop until
47  * globals->battery_count
48  */
49-battery_t batteries[MAX_ITEMS];
50+extern battery_t batteries[MAX_ITEMS];
51 /**
52  * Array for existing thermal zones, loop until
53  * globals->thermal_count
54  */
55-thermal_t thermals[MAX_ITEMS];
56+extern thermal_t thermals[MAX_ITEMS];
57 /**
58  * Array for existing fans, loop until
59  * globals->fan_count
60  */
61-fan_t fans[MAX_ITEMS];
62+extern fan_t fans[MAX_ITEMS];
63 /**
64  * Finds existing batteries and fills the
65  * corresponding batteries structures with the paths
66--
672.28.0
68
69