You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.6 KiB

  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. Define global variables as extern in header to fix the build with gcc 10
  6. which default to -fno-common: https://gcc.gnu.org/gcc-10/porting_to.html
  7. Fixes:
  8. - http://autobuild.buildroot.org/results/55a8581f11e776439782c228441ef1c8c1243386
  9. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  10. [Upstream status: sent to iftop-users@lists.beasts.org]
  11. ---
  12. ui_common.c | 6 ++++++
  13. ui_common.h | 10 +++++-----
  14. 2 files changed, 11 insertions(+), 5 deletions(-)
  15. diff --git a/ui_common.c b/ui_common.c
  16. index dcf6646..b1027ec 100644
  17. --- a/ui_common.c
  18. +++ b/ui_common.c
  19. @@ -17,6 +17,12 @@
  20. #include "ui_common.h"
  21. +sorted_list_type screen_list;
  22. +host_pair_line totals;
  23. +int peaksent, peakrecv, peaktotal;
  24. +hash_type* screen_hash;
  25. +hash_type* service_hash;
  26. +
  27. /* 2, 10 and 40 seconds */
  28. int history_divs[HISTORY_DIVISIONS] = {1, 5, 20};
  29. diff --git a/ui_common.h b/ui_common.h
  30. index 63ae5bb..add72fe 100644
  31. --- a/ui_common.h
  32. +++ b/ui_common.h
  33. @@ -33,12 +33,12 @@ typedef struct host_pair_line_tag {
  34. extern options_t options;
  35. -sorted_list_type screen_list;
  36. -host_pair_line totals;
  37. -int peaksent, peakrecv, peaktotal;
  38. +extern sorted_list_type screen_list;
  39. +extern host_pair_line totals;
  40. +extern int peaksent, peakrecv, peaktotal;
  41. extern history_type history_totals;
  42. -hash_type* screen_hash;
  43. -hash_type* service_hash;
  44. +extern hash_type* screen_hash;
  45. +extern hash_type* service_hash;
  46. void analyse_data(void);
  47. void screen_list_init(void);