Andrew Geissler | bffdb3e | 2020-08-21 16:13:29 -0500 | [diff] [blame] | 1 | From 6c6de7c07290248a3c72a50c7790885ee4bc13a2 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 | |
| 6 | Fixes #16436, RHBZ#1800268 |
| 7 | |
| 8 | Upstream-Status: Pending |
| 9 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 10 | --- |
| 11 | include/sensors-interface-common.h | 22 ++++++++++++++-------- |
| 12 | lib/sensors-interface-common.c | 1 + |
| 13 | 2 files changed, 15 insertions(+), 8 deletions(-) |
| 14 | |
| 15 | diff --git a/include/sensors-interface-common.h b/include/sensors-interface-common.h |
| 16 | index 62a27eb..05146c5 100644 |
| 17 | --- a/include/sensors-interface-common.h |
| 18 | +++ b/include/sensors-interface-common.h |
| 19 | @@ -146,6 +146,12 @@ t_sensors_dialog; |
| 20 | |
| 21 | |
| 22 | |
| 23 | +#ifdef XFCE4_SENSORS_INTERFACE_COMMON_DEFINING |
| 24 | +#define EXTERN |
| 25 | +#else |
| 26 | +#define EXTERN extern |
| 27 | +#endif |
| 28 | + |
| 29 | /* Extern functions that need to be re-implemented in the sensors-viewer and |
| 30 | * the panel code. |
| 31 | * They kind of need to be registered at the library by any software |
| 32 | @@ -157,7 +163,7 @@ t_sensors_dialog; |
| 33 | * @param ptr_widget: Pointer to original widget, i.e, the update timer box |
| 34 | * @param ptr_sensorsdialog: argument pointer to sensors dialog data |
| 35 | */ |
| 36 | -void |
| 37 | +EXTERN void |
| 38 | (*adjustment_value_changed) (GtkWidget *ptr_widget, |
| 39 | t_sensors_dialog *ptr_sensorsdialog); |
| 40 | |
| 41 | @@ -167,7 +173,7 @@ void |
| 42 | * @param ptr_widget: Pointer to original widget, i.e, the sensor entry combobox |
| 43 | * @param ptr_sensorsdialog: argument pointer to sensors dialog data |
| 44 | */ |
| 45 | -void |
| 46 | +EXTERN void |
| 47 | (*sensor_entry_changed) (GtkWidget *ptr_widget, |
| 48 | t_sensors_dialog *ptr_sensorsdialog); |
| 49 | |
| 50 | @@ -178,7 +184,7 @@ void |
| 51 | * @param ptr_str_newtext: Pointer to the string containing the new label |
| 52 | * @param ptr_sensorsdialog: argument pointer to sensors dialog data |
| 53 | */ |
| 54 | -void |
| 55 | +EXTERN void |
| 56 | (*list_cell_text_edited) (GtkCellRendererText *ptr_cellrenderertext, |
| 57 | gchar *ptr_str_path, gchar *ptr_str_newtext, |
| 58 | t_sensors_dialog *ptr_sensorsdialog); |
| 59 | @@ -189,7 +195,7 @@ void |
| 60 | * @param ptr_str_path: pointer to the string with the path of the changed item |
| 61 | * @param ptr_sensorsdialog: argument pointer to sensors dialog data |
| 62 | */ |
| 63 | -void |
| 64 | +EXTERN void |
| 65 | (*list_cell_toggle) (GtkCellRendererToggle *ptr_cellrenderertoggle, gchar *ptr_str_path, |
| 66 | t_sensors_dialog *ptr_sensorsdialog); |
| 67 | |
| 68 | @@ -201,7 +207,7 @@ void |
| 69 | * hexadecimal rgb format #0011ff |
| 70 | * @param ptr_sensorsdialog: argument pointer to sensors dialog data |
| 71 | */ |
| 72 | -void |
| 73 | +EXTERN void |
| 74 | (*list_cell_color_edited) (GtkCellRendererText *ptr_cellrenderertext, |
| 75 | gchar *ptr_str_path, gchar *ptr_str_newcolor, |
| 76 | t_sensors_dialog *ptr_sensorsdialog); |
| 77 | @@ -214,7 +220,7 @@ void |
| 78 | * temperature |
| 79 | * @param ptr_sensorsdialog: argument pointer to sensors dialog data |
| 80 | */ |
| 81 | -void |
| 82 | +EXTERN void |
| 83 | (*minimum_changed) (GtkCellRendererText *ptr_cellrenderertext, gchar *ptr_str_path, |
| 84 | gchar *ptr_str_newmin, t_sensors_dialog *ptr_sensorsdialog); |
| 85 | |
| 86 | @@ -226,7 +232,7 @@ void |
| 87 | * temperature |
| 88 | * @param ptr_sensorsdialog: argument pointer to sensors dialog data |
| 89 | */ |
| 90 | -void |
| 91 | +EXTERN void |
| 92 | (*maximum_changed) (GtkCellRendererText *ptr_cellrenderertext, gchar *ptr_str_path, |
| 93 | gchar *ptr_str_newmax, t_sensors_dialog *ptr_sensorsdialog); |
| 94 | |
| 95 | @@ -236,7 +242,7 @@ void |
| 96 | * @param ptr_widget: Pointer to original widget, i.e, the update timer box |
| 97 | * @param ptr_sensorsdialog: argument pointer to sensors dialog data |
| 98 | */ |
| 99 | -void |
| 100 | +EXTERN void |
| 101 | (*temperature_unit_change) (GtkWidget *ptr_widget, |
| 102 | t_sensors_dialog *ptr_sensorsdialog); |
| 103 | |
| 104 | diff --git a/lib/sensors-interface-common.c b/lib/sensors-interface-common.c |
| 105 | index 70aa154..8c79f1d 100644 |
| 106 | --- a/lib/sensors-interface-common.c |
| 107 | +++ b/lib/sensors-interface-common.c |
| 108 | @@ -28,6 +28,7 @@ |
| 109 | #include <libxfce4panel/xfce-panel-plugin.h> |
| 110 | |
| 111 | /* Local/package includes */ |
| 112 | +#define XFCE4_SENSORS_INTERFACE_COMMON_DEFINING |
| 113 | #include <configuration.h> |
| 114 | #include <sensors-interface-common.h> |
| 115 | #include <middlelayer.h> |
| 116 | -- |
| 117 | 2.24.1 |
| 118 | |