mutter/mutter-math-workaround.patch

91 lines
2.8 KiB
Diff

Workaround for https://bugzilla.redhat.com/show_bug.cgi?id=520209
diff --git a/src/compositor/mutter-window-group.c b/src/compositor/mutter-window-group.c
index e89327e..fdb75a2 100644
--- a/src/compositor/mutter-window-group.c
+++ b/src/compositor/mutter-window-group.c
@@ -1,6 +1,6 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-#define _ISOC99_SOURCE /* for roundf */
+#define _BSD_SOURCE /* for rintf */
#include <math.h>
#include "mutter-window-private.h"
@@ -27,7 +27,7 @@ G_DEFINE_TYPE (MutterWindowGroup, mutter_window_group, CLUTTER_TYPE_GROUP);
static inline int
round_to_fixed (float x)
{
- return roundf (x * 256);
+ return rintf (x * 256);
}
/* We can only (easily) apply our logic for figuring out what a window
diff --git a/src/compositor/mutter-window.c b/src/compositor/mutter-window.c
index 83080f8..e07be3d 100644
--- a/src/compositor/mutter-window.c
+++ b/src/compositor/mutter-window.c
@@ -1,6 +1,6 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-#define _ISOC99_SOURCE /* for roundf */
+#define _BSD_SOURCE /* for rintf */
#include <math.h>
#include <X11/extensions/shape.h>
@@ -1420,10 +1420,10 @@ mutter_window_set_visible_region_beneath (MutterWindow *self,
*/
clutter_actor_get_allocation_box (priv->shadow, &box);
- shadow_rect.x = roundf (box.x1);
- shadow_rect.y = roundf (box.y1);
- shadow_rect.width = roundf (box.x2 - box.x1);
- shadow_rect.height = roundf (box.y2 - box.y1);
+ shadow_rect.x = rintf (box.x1);
+ shadow_rect.y = rintf (box.y1);
+ shadow_rect.width = rintf (box.x2 - box.x1);
+ shadow_rect.height = rintf (box.y2 - box.y1);
overlap = gdk_region_rect_in (beneath_region, &shadow_rect);
diff --git a/src/compositor/shadow.c b/src/compositor/shadow.c
index b204440..67fa538 100644
--- a/src/compositor/shadow.c
+++ b/src/compositor/shadow.c
@@ -1,6 +1,6 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-#define _GNU_SOURCE /* For M_PI */
+#define _BSD_SOURCE /* For M_PI */
#include <math.h>
diff --git a/src/tools/mutter-mag.c b/src/tools/mutter-mag.c
index 7c5cb3e..09e2a43 100644
--- a/src/tools/mutter-mag.c
+++ b/src/tools/mutter-mag.c
@@ -19,8 +19,7 @@
* 02111-1307, USA.
*/
-#define _GNU_SOURCE
-#define _XOPEN_SOURCE 600 /* C99 -- for rint() */
+#define _BSD_SOURCE /* for rint() */
#include <gtk/gtk.h>
#include <gdk/gdkx.h>
diff --git a/src/ui/preview-widget.c b/src/ui/preview-widget.c
index 32fbc70..adfa922 100644
--- a/src/ui/preview-widget.c
+++ b/src/ui/preview-widget.c
@@ -21,9 +21,6 @@
* 02111-1307, USA.
*/
-#define _GNU_SOURCE
-#define _XOPEN_SOURCE 600 /* for the maths routines over floats */
-
#include <math.h>
#include <gtk/gtk.h>
#include "preview-widget.h"