b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame^] | 1 | From 18a9f7732944bfe45023f9dd7528295e7d43e678 Mon Sep 17 00:00:00 2001 |
| 2 | From: Fabrice Fontaine <fontaine.fabrice@gmail.com> |
| 3 | Date: Wed, 12 Aug 2020 22:31:33 +0200 |
| 4 | Subject: [PATCH] ui_common.h: fix build with gcc 10 |
| 5 | |
| 6 | Define global variables as extern in header to fix the build with gcc 10 |
| 7 | which default to -fno-common: https://gcc.gnu.org/gcc-10/porting_to.html |
| 8 | |
| 9 | Fixes: |
| 10 | - http://autobuild.buildroot.org/results/55a8581f11e776439782c228441ef1c8c1243386 |
| 11 | |
| 12 | Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> |
| 13 | [Upstream status: sent to iftop-users@lists.beasts.org] |
| 14 | --- |
| 15 | ui_common.c | 6 ++++++ |
| 16 | ui_common.h | 10 +++++----- |
| 17 | 2 files changed, 11 insertions(+), 5 deletions(-) |
| 18 | |
| 19 | --- a/ui_common.c |
| 20 | +++ b/ui_common.c |
| 21 | @@ -17,6 +17,12 @@ |
| 22 | |
| 23 | #include "ui_common.h" |
| 24 | |
| 25 | +sorted_list_type screen_list; |
| 26 | +host_pair_line totals; |
| 27 | +int peaksent, peakrecv, peaktotal; |
| 28 | +hash_type* screen_hash; |
| 29 | +hash_type* service_hash; |
| 30 | + |
| 31 | /* 2, 10 and 40 seconds */ |
| 32 | int history_divs[HISTORY_DIVISIONS] = {1, 5, 20}; |
| 33 | |
| 34 | --- a/ui_common.h |
| 35 | +++ b/ui_common.h |
| 36 | @@ -33,12 +33,12 @@ typedef struct host_pair_line_tag { |
| 37 | |
| 38 | extern options_t options; |
| 39 | |
| 40 | -sorted_list_type screen_list; |
| 41 | -host_pair_line totals; |
| 42 | -int peaksent, peakrecv, peaktotal; |
| 43 | +extern sorted_list_type screen_list; |
| 44 | +extern host_pair_line totals; |
| 45 | +extern int peaksent, peakrecv, peaktotal; |
| 46 | extern history_type history_totals; |
| 47 | -hash_type* screen_hash; |
| 48 | -hash_type* service_hash; |
| 49 | +extern hash_type* screen_hash; |
| 50 | +extern hash_type* service_hash; |
| 51 | |
| 52 | void analyse_data(void); |
| 53 | void screen_list_init(void); |