xfce4-sensors-plugin-1.3.92-gcc-10.patch 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. From 108ffac9eac23a5d87f142e36d162d62be0619e2 Mon Sep 17 00:00:00 2001
  2. From: Robin Lee <cheeselee@fedoraproject.org>
  3. Date: Mon, 24 Feb 2020 17:52:39 +0800
  4. Subject: [PATCH] Fix multiple definition errors under GCC 10.0
  5. Fixes issue #9, RHBZ#1800268
  6. ---
  7. include/sensors-interface-common.h | 22 ++++++++++++++--------
  8. lib/sensors-interface-common.c | 1 +
  9. 2 files changed, 15 insertions(+), 8 deletions(-)
  10. diff --git a/include/sensors-interface-common.h b/include/sensors-interface-common.h
  11. index 62a27eb..05146c5 100644
  12. --- a/include/sensors-interface-common.h
  13. +++ b/include/sensors-interface-common.h
  14. @@ -146,6 +146,12 @@ t_sensors_dialog;
  15. +#ifdef XFCE4_SENSORS_INTERFACE_COMMON_DEFINING
  16. +#define EXTERN
  17. +#else
  18. +#define EXTERN extern
  19. +#endif
  20. +
  21. /* Extern functions that need to be re-implemented in the sensors-viewer and
  22. * the panel code.
  23. * They kind of need to be registered at the library by any software
  24. @@ -157,7 +163,7 @@ t_sensors_dialog;
  25. * @param ptr_widget: Pointer to original widget, i.e, the update timer box
  26. * @param ptr_sensorsdialog: argument pointer to sensors dialog data
  27. */
  28. -void
  29. +EXTERN void
  30. (*adjustment_value_changed) (GtkWidget *ptr_widget,
  31. t_sensors_dialog *ptr_sensorsdialog);
  32. @@ -167,7 +173,7 @@ void
  33. * @param ptr_widget: Pointer to original widget, i.e, the sensor entry combobox
  34. * @param ptr_sensorsdialog: argument pointer to sensors dialog data
  35. */
  36. -void
  37. +EXTERN void
  38. (*sensor_entry_changed) (GtkWidget *ptr_widget,
  39. t_sensors_dialog *ptr_sensorsdialog);
  40. @@ -178,7 +184,7 @@ void
  41. * @param ptr_str_newtext: Pointer to the string containing the new label
  42. * @param ptr_sensorsdialog: argument pointer to sensors dialog data
  43. */
  44. -void
  45. +EXTERN void
  46. (*list_cell_text_edited) (GtkCellRendererText *ptr_cellrenderertext,
  47. gchar *ptr_str_path, gchar *ptr_str_newtext,
  48. t_sensors_dialog *ptr_sensorsdialog);
  49. @@ -189,7 +195,7 @@ void
  50. * @param ptr_str_path: pointer to the string with the path of the changed item
  51. * @param ptr_sensorsdialog: argument pointer to sensors dialog data
  52. */
  53. -void
  54. +EXTERN void
  55. (*list_cell_toggle) (GtkCellRendererToggle *ptr_cellrenderertoggle, gchar *ptr_str_path,
  56. t_sensors_dialog *ptr_sensorsdialog);
  57. @@ -201,7 +207,7 @@ void
  58. * hexadecimal rgb format #0011ff
  59. * @param ptr_sensorsdialog: argument pointer to sensors dialog data
  60. */
  61. -void
  62. +EXTERN void
  63. (*list_cell_color_edited) (GtkCellRendererText *ptr_cellrenderertext,
  64. gchar *ptr_str_path, gchar *ptr_str_newcolor,
  65. t_sensors_dialog *ptr_sensorsdialog);
  66. @@ -214,7 +220,7 @@ void
  67. * temperature
  68. * @param ptr_sensorsdialog: argument pointer to sensors dialog data
  69. */
  70. -void
  71. +EXTERN void
  72. (*minimum_changed) (GtkCellRendererText *ptr_cellrenderertext, gchar *ptr_str_path,
  73. gchar *ptr_str_newmin, t_sensors_dialog *ptr_sensorsdialog);
  74. @@ -226,7 +232,7 @@ void
  75. * temperature
  76. * @param ptr_sensorsdialog: argument pointer to sensors dialog data
  77. */
  78. -void
  79. +EXTERN void
  80. (*maximum_changed) (GtkCellRendererText *ptr_cellrenderertext, gchar *ptr_str_path,
  81. gchar *ptr_str_newmax, t_sensors_dialog *ptr_sensorsdialog);
  82. @@ -236,7 +242,7 @@ void
  83. * @param ptr_widget: Pointer to original widget, i.e, the update timer box
  84. * @param ptr_sensorsdialog: argument pointer to sensors dialog data
  85. */
  86. -void
  87. +EXTERN void
  88. (*temperature_unit_change) (GtkWidget *ptr_widget,
  89. t_sensors_dialog *ptr_sensorsdialog);
  90. diff --git a/lib/sensors-interface-common.c b/lib/sensors-interface-common.c
  91. index 70aa154..8c79f1d 100644
  92. --- a/lib/sensors-interface-common.c
  93. +++ b/lib/sensors-interface-common.c
  94. @@ -28,6 +28,7 @@
  95. #include <libxfce4panel/xfce-panel-plugin.h>
  96. /* Local/package includes */
  97. +#define XFCE4_SENSORS_INTERFACE_COMMON_DEFINING
  98. #include <configuration.h>
  99. #include <sensors-interface-common.h>
  100. #include <middlelayer.h>
  101. --
  102. GitLab