Andrew Geissler | 635e0e4 | 2020-08-21 15:58:33 -0500 | [diff] [blame] | 1 | From 9839c169f513e65fc711646257b3e8588cce623c Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Wed, 5 Aug 2020 12:06:01 -0700 |
| 4 | Subject: [PATCH] libacpi: Fix build witth -fno-commom |
| 5 | |
| 6 | Upstream-Status: Pending |
| 7 | |
| 8 | Signed-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 | |
| 14 | diff --git a/libacpi.c b/libacpi.c |
| 15 | index 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); |
| 41 | diff --git a/libacpi.h b/libacpi.h |
| 42 | index 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 | -- |
| 67 | 2.28.0 |
| 68 | |