Line 0
Link Here
|
|
|
1 |
Gentoo bug https://bugs.gentoo.org/932303 |
2 |
|
3 |
From fcee4201e254a417f8146723b24ce0716840c96b Mon Sep 17 00:00:00 2001 |
4 |
From: Nicholas Vinson <nvinson234@gmail.com> |
5 |
Date: Tue, 21 May 2024 01:10:10 +0200 |
6 |
Subject: [PATCH] build: Add missing math.h includes |
7 |
|
8 |
Commit 0f786ce451297f8d26d41dc8492c10db08d8f87f added a math.h include |
9 |
statement to libxfce4panel/xfce-panel-image.c to fix issue #833. |
10 |
However, libm functions are used in more files than just |
11 |
xfce-panel-image.c. |
12 |
|
13 |
Therefore, add math.h include to other files that use math functions. |
14 |
|
15 |
Signed-off-by: Nicholas Vinson <nvinson234 at gmail.com> |
16 |
Fixes: https://bugs.gentoo.org/932303 |
17 |
--- |
18 |
panel/panel-base-window.c | 4 +++- |
19 |
panel/panel-itembar.c | 4 ++++ |
20 |
panel/panel-preferences-dialog.c | 4 +++- |
21 |
plugins/clock/clock-analog.c | 4 ++++ |
22 |
plugins/clock/clock-binary.c | 4 +++- |
23 |
plugins/clock/clock-lcd.c | 4 ++++ |
24 |
plugins/clock/clock.c | 4 ++++ |
25 |
plugins/systray/systray-box.c | 4 ++++ |
26 |
8 files changed, 29 insertions(+), 3 deletions(-) |
27 |
|
28 |
diff --git a/panel/panel-base-window.c b/panel/panel-base-window.c |
29 |
index 5e0f3a688..832520be6 100644 |
30 |
--- a/panel/panel-base-window.c |
31 |
+++ b/panel/panel-base-window.c |
32 |
@@ -35,7 +35,9 @@ |
33 |
#define gtk_layer_is_supported() FALSE |
34 |
#endif |
35 |
|
36 |
- |
37 |
+#ifdef HAVE_MATH_H |
38 |
+#include <math.h> |
39 |
+#endif |
40 |
|
41 |
#define PANEL_BASE_CSS ".xfce4-panel.background { border-style: solid; }" \ |
42 |
".xfce4-panel.background button { background: transparent; padding: 0; }" \ |
43 |
diff --git a/panel/panel-itembar.c b/panel/panel-itembar.c |
44 |
index 4ffcb5ba4..11ccf5d1d 100644 |
45 |
--- a/panel/panel-itembar.c |
46 |
+++ b/panel/panel-itembar.c |
47 |
@@ -29,6 +29,10 @@ |
48 |
#include "libxfce4panel/libxfce4panel.h" |
49 |
#include "libxfce4panel/xfce-panel-plugin-provider.h" |
50 |
|
51 |
+#ifdef HAVE_MATH_H |
52 |
+#include <math.h> |
53 |
+#endif |
54 |
+ |
55 |
#define IS_HORIZONTAL(itembar) ((itembar)->mode == XFCE_PANEL_PLUGIN_MODE_HORIZONTAL) |
56 |
#define HIGHLIGHT_SIZE 2 |
57 |
|
58 |
diff --git a/panel/panel-preferences-dialog.c b/panel/panel-preferences-dialog.c |
59 |
index 9a54e9ab3..dfcc67db3 100644 |
60 |
--- a/panel/panel-preferences-dialog.c |
61 |
+++ b/panel/panel-preferences-dialog.c |
62 |
@@ -37,7 +37,9 @@ |
63 |
#include <libxfce4ui/libxfce4ui.h> |
64 |
#include <libxfce4util/libxfce4util.h> |
65 |
|
66 |
- |
67 |
+#ifdef HAVE_MATH_H |
68 |
+#include<math.h> |
69 |
+#endif |
70 |
|
71 |
static void |
72 |
panel_preferences_dialog_finalize (GObject *object); |
73 |
diff --git a/plugins/clock/clock-analog.c b/plugins/clock/clock-analog.c |
74 |
index ae4ae21f4..50196352d 100644 |
75 |
--- a/plugins/clock/clock-analog.c |
76 |
+++ b/plugins/clock/clock-analog.c |
77 |
@@ -27,6 +27,10 @@ |
78 |
|
79 |
#include <cairo/cairo.h> |
80 |
|
81 |
+#ifdef HAVE_MATH_H |
82 |
+#include <math.h> |
83 |
+#endif |
84 |
+ |
85 |
#define CLOCK_SCALE 0.08 |
86 |
#define TICKS_TO_RADIANS(x) (G_PI - (G_PI / 30.0) * (x)) |
87 |
#define HOURS_TO_RADIANS(x, y) (G_PI - (G_PI / 6.0) * (((x) > 12 ? (x) - 12 : (x)) + (y) / 60.0)) |
88 |
diff --git a/plugins/clock/clock-binary.c b/plugins/clock/clock-binary.c |
89 |
index 5ac4151af..36fe31c72 100644 |
90 |
--- a/plugins/clock/clock-binary.c |
91 |
+++ b/plugins/clock/clock-binary.c |
92 |
@@ -27,7 +27,9 @@ |
93 |
|
94 |
#include <cairo/cairo.h> |
95 |
|
96 |
- |
97 |
+#ifdef HAVE_MATH_H |
98 |
+#include <math.h> |
99 |
+#endif |
100 |
|
101 |
static void |
102 |
xfce_clock_binary_set_property (GObject *object, |
103 |
diff --git a/plugins/clock/clock-lcd.c b/plugins/clock/clock-lcd.c |
104 |
index 97e041d58..8b7454dfd 100644 |
105 |
--- a/plugins/clock/clock-lcd.c |
106 |
+++ b/plugins/clock/clock-lcd.c |
107 |
@@ -27,6 +27,10 @@ |
108 |
|
109 |
#include <cairo/cairo.h> |
110 |
|
111 |
+#ifdef HAVE_MATH_H |
112 |
+#include <math.h> |
113 |
+#endif |
114 |
+ |
115 |
#define RELATIVE_SPACE (0.10) |
116 |
#define RELATIVE_DIGIT (5 * RELATIVE_SPACE) |
117 |
#define RELATIVE_DOTS (3 * RELATIVE_SPACE) |
118 |
diff --git a/plugins/clock/clock.c b/plugins/clock/clock.c |
119 |
index 472ff8f17..ee1d4402b 100644 |
120 |
--- a/plugins/clock/clock.c |
121 |
+++ b/plugins/clock/clock.c |
122 |
@@ -39,6 +39,10 @@ |
123 |
#include <gtk/gtk.h> |
124 |
#include <libxfce4ui/libxfce4ui.h> |
125 |
|
126 |
+#ifdef HAVE_MATH_H |
127 |
+#include <math.h> |
128 |
+#endif |
129 |
+ |
130 |
/* TRANSLATORS: adjust this accordingly for your locale format */ |
131 |
#define DEFAULT_TOOLTIP_FORMAT NC_ ("Date", "%A %d %B %Y") |
132 |
|
133 |
diff --git a/plugins/systray/systray-box.c b/plugins/systray/systray-box.c |
134 |
index 1fc22c925..f808acb97 100644 |
135 |
--- a/plugins/systray/systray-box.c |
136 |
+++ b/plugins/systray/systray-box.c |
137 |
@@ -27,6 +27,10 @@ |
138 |
#include "common/panel-debug.h" |
139 |
#include "common/panel-private.h" |
140 |
|
141 |
+#ifdef HAVE_MATH_H |
142 |
+#include <math.h> |
143 |
+#endif |
144 |
+ |
145 |
#define SPACING (2) |
146 |
#define OFFSCREEN (-9999) |
147 |
|
148 |
-- |
149 |
GitLab |
150 |
|