[97166] trunk/dports/x11/xorg-server-devel
jeremyhu at macports.org
jeremyhu at macports.org
Tue Aug 28 12:53:58 PDT 2012
Revision: 97166
https://trac.macports.org/changeset/97166
Author: jeremyhu at macports.org
Date: 2012-08-28 12:53:55 -0700 (Tue, 28 Aug 2012)
Log Message:
-----------
xorg-server-devel: Patch buggy list implementation and allow optimization again
Modified Paths:
--------------
trunk/dports/x11/xorg-server-devel/Portfile
Added Paths:
-----------
trunk/dports/x11/xorg-server-devel/files/1001-list-Use-offsetof-to-determine-member-offsets-within.patch
Modified: trunk/dports/x11/xorg-server-devel/Portfile
===================================================================
--- trunk/dports/x11/xorg-server-devel/Portfile 2012-08-28 18:52:47 UTC (rev 97165)
+++ trunk/dports/x11/xorg-server-devel/Portfile 2012-08-28 19:53:55 UTC (rev 97166)
@@ -6,6 +6,7 @@
conflicts xorg-server
set my_name xorg-server
version 1.12.99.905
+revision 1
categories x11 devel
maintainers jeremyhu openmaintainer
description The X.org / Xquartz X server.
@@ -69,14 +70,11 @@
# GL/internal/dri_interface.h is missing in prefix (provided by libdrm for the xorg DDX... not helpful for us)
configure.cppflags-append -I/usr/include -I${filespath}/dri
-# <rdar://problem/12186841>
-configure.cflags-delete -O2
-configure.cflags-append -O0
-
configure.env-append \
RAWCPP=${configure.cpp}
patchfiles \
+ 1001-list-Use-offsetof-to-determine-member-offsets-within.patch \
5000-sdksyms.sh-Use-CPPFLAGS-not-CFLAGS.patch \
5001-Workaround-the-GC-clipping-problem-in-miPaintWindow-.patch \
5002-fb-Revert-fb-changes-that-broke-XQuartz.patch
Added: trunk/dports/x11/xorg-server-devel/files/1001-list-Use-offsetof-to-determine-member-offsets-within.patch
===================================================================
--- trunk/dports/x11/xorg-server-devel/files/1001-list-Use-offsetof-to-determine-member-offsets-within.patch (rev 0)
+++ trunk/dports/x11/xorg-server-devel/files/1001-list-Use-offsetof-to-determine-member-offsets-within.patch 2012-08-28 19:53:55 UTC (rev 97166)
@@ -0,0 +1,55 @@
+From 4939530bb86b9356156ac83d720e2b157e37deae Mon Sep 17 00:00:00 2001
+From: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
+Date: Tue, 28 Aug 2012 10:06:51 -0700
+Subject: [PATCH] list: Use offsetof() to determine member offsets within a
+ structure
+
+Some compilers have difficulty with the previous implementation which
+relies on undefined behavior according to the C standard. Using
+offsetof() from <stddef.h> (which most likely just uses
+__builtin_offsetof on modern compilers) allows us to accomplish this
+without ambiguity.
+
+Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
+---
+ include/list.h | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/include/list.h b/include/list.h
+index d54a207..ae5431c 100644
+--- a/include/list.h
++++ b/include/list.h
+@@ -26,6 +26,8 @@
+ #ifndef _XORG_LIST_H_
+ #define _XORG_LIST_H_
+
++#include <stddef.h> /* offsetof() */
++
+ /**
+ * @file Classic doubly-link circular list implementation.
+ * For real usage examples of the linked list, see the file test/list.c
+@@ -232,7 +234,7 @@ xorg_list_is_empty(struct xorg_list *head)
+ */
+ #ifndef container_of
+ #define container_of(ptr, type, member) \
+- (type *)((char *)(ptr) - (char *) &((type *)0)->member)
++ (type *)((char *)(ptr) - (char *) offsetof(type, member))
+ #endif
+
+ /**
+@@ -271,9 +273,9 @@ xorg_list_is_empty(struct xorg_list *head)
+ #define xorg_list_last_entry(ptr, type, member) \
+ xorg_list_entry((ptr)->prev, type, member)
+
+-#define __container_of(ptr, sample, member) \
+- (void *)((char *)(ptr) \
+- - ((char *)&(sample)->member - (char *)(sample)))
++#define __container_of(ptr, sample, member) \
++ container_of(ptr, typeof(*sample), member)
++
+ /**
+ * Loop through the list given by head and set pos to struct in the list.
+ *
+--
+1.7.11.5
+
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120828/c721bcd6/attachment.html>
More information about the macports-changes
mailing list