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.

53 lines
1.5 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. --- a/ui_common.c
  16. +++ b/ui_common.c
  17. @@ -17,6 +17,12 @@
  18. #include "ui_common.h"
  19. +sorted_list_type screen_list;
  20. +host_pair_line totals;
  21. +int peaksent, peakrecv, peaktotal;
  22. +hash_type* screen_hash;
  23. +hash_type* service_hash;
  24. +
  25. /* 2, 10 and 40 seconds */
  26. int history_divs[HISTORY_DIVISIONS] = {1, 5, 20};
  27. --- a/ui_common.h
  28. +++ b/ui_common.h
  29. @@ -33,12 +33,12 @@ typedef struct host_pair_line_tag {
  30. extern options_t options;
  31. -sorted_list_type screen_list;
  32. -host_pair_line totals;
  33. -int peaksent, peakrecv, peaktotal;
  34. +extern sorted_list_type screen_list;
  35. +extern host_pair_line totals;
  36. +extern int peaksent, peakrecv, peaktotal;
  37. extern history_type history_totals;
  38. -hash_type* screen_hash;
  39. -hash_type* service_hash;
  40. +extern hash_type* screen_hash;
  41. +extern hash_type* service_hash;
  42. void analyse_data(void);
  43. void screen_list_init(void);