Add a workaround for Red Hat bug #520209

This commit is contained in:
Owen Taylor 2009-08-29 00:01:48 +00:00
parent deaa3dd08f
commit c349b07bcf
2 changed files with 98 additions and 1 deletions

View File

@ -0,0 +1,90 @@
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"

View File

@ -1,6 +1,6 @@
Name: mutter
Version: 2.27.3
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Window and compositing manager based on Clutter
Group: User Interface/Desktops
@ -9,6 +9,9 @@ URL: http://git.gnome.org/cgit/mutter
Source0: ftp://ftp.gnome.org/pub/gnome/sources/%{name}/2.27/%{name}-%{version}.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
# Workaround for glibc bug https://bugzilla.redhat.com/show_bug.cgi?id=520209
Patch0: mutter-math-workaround.patch
BuildRequires: clutter-devel
BuildRequires: pango-devel
BuildRequires: startup-notification-devel
@ -61,6 +64,7 @@ utilities for testing Metacity/Mutter themes.
%prep
%setup -q
%patch0 -p1 -b .math-workaround
%build
%configure --with-clutter --disable-static
@ -147,6 +151,9 @@ gconftool-2 --makefile-install-rule \
%doc %{_mandir}/man1/mutter-window-demo.1.gz
%changelog
* Fri Aug 28 2009 Owen Taylor <otaylor@redhat.com> - 2.27.3-2
- Add a workaround for Red Hat bug #520209
* Fri Aug 28 2009 Owen Taylor <otaylor@redhat.com> - 2.27.3-1
- Update to 2.27.3, remove mutter-metawindow.patch