patches/glibc/ports-2.13/150-queue-header-updates.patch
author Anthony Foiani <anthony.foiani@gmail.com>
Thu May 19 23:09:43 2011 +0200 (2011-05-19)
changeset 2462 139b85d70b62
permissions -rw-r--r--
complibs/ppl: fix 0.11-0.11.2 to compile with --disable-shared

PPL 0.11 (through 0.11.2) had a small bug where it still tried to build
and test its Java interface even when shared libraries are disabled.
Since that's exactly what ct-ng does, it explodes.

This is the patch from the PPL authors (see final link below).

More information can be found in these messages/threads:

Anthony's initial report and analysis with Yann:
http://www.cygwin.com/ml/crossgcc/2011-05/msg00046.html

Ron Flory hit the same problem:
http://www.cygwin.com/ml/crossgcc/2011-05/msg00054.html

Anthony's report to the ppl-devel list:
http://www.cs.unipr.it/pipermail/ppl-devel/2011-May/017450.html

Roberto's reply with a link to the fix in the PPL git repo:
http://www.cs.unipr.it/pipermail/ppl-devel/2011-May/017455.html

Signed-Off-By: Anthony Foiani <anthony.foiani@gmail.com>
     1 grab some updates from FreeBSD
     2 
     3 http://bugs.gentoo.org/201979
     4 
     5 diff -durN glibc-2.13.orig/misc/sys/queue.h glibc-2.13/misc/sys/queue.h
     6 
     7 diff -durN glibc-2.13.orig/misc/sys/queue.h glibc-2.13/misc/sys/queue.h
     8 --- glibc-2.13.orig/misc/sys/queue.h	2008-03-05 06:50:30.000000000 +0100
     9 +++ glibc-2.13/misc/sys/queue.h	2009-11-13 00:49:51.000000000 +0100
    10 @@ -136,6 +136,11 @@
    11  		(var);							\
    12  		(var) = ((var)->field.le_next))
    13  
    14 +#define	LIST_FOREACH_SAFE(var, head, field, tvar)			\
    15 +	for ((var) = LIST_FIRST((head));				\
    16 +	    (var) && ((tvar) = LIST_NEXT((var), field), 1);		\
    17 +	    (var) = (tvar))
    18 +
    19  /*
    20   * List access methods.
    21   */
    22 @@ -197,6 +202,16 @@
    23  #define	SLIST_FOREACH(var, head, field)					\
    24  	for((var) = (head)->slh_first; (var); (var) = (var)->field.sle_next)
    25  
    26 +#define	SLIST_FOREACH_SAFE(var, head, field, tvar)			\
    27 +	for ((var) = SLIST_FIRST((head));				\
    28 +	    (var) && ((tvar) = SLIST_NEXT((var), field), 1);		\
    29 +	    (var) = (tvar))
    30 +
    31 +#define	SLIST_FOREACH_PREVPTR(var, varp, head, field)			\
    32 +	for ((varp) = &SLIST_FIRST((head));				\
    33 +	    ((var) = *(varp)) != NULL;					\
    34 +	    (varp) = &SLIST_NEXT((var), field))
    35 +
    36  /*
    37   * Singly-linked List access methods.
    38   */
    39 @@ -242,6 +257,12 @@
    40  	(head)->stqh_last = &(elm)->field.stqe_next;			\
    41  } while (/*CONSTCOND*/0)
    42  
    43 +#define	STAILQ_LAST(head, type, field)					\
    44 +	(STAILQ_EMPTY((head)) ?						\
    45 +		NULL :							\
    46 +	        ((struct type *)(void *)				\
    47 +		((char *)((head)->stqh_last) - __offsetof(struct type, field))))
    48 +
    49  #define	STAILQ_INSERT_AFTER(head, listelm, elm, field) do {		\
    50  	if (((elm)->field.stqe_next = (listelm)->field.stqe_next) == NULL)\
    51  		(head)->stqh_last = &(elm)->field.stqe_next;		\
    52 @@ -271,6 +292,11 @@
    53  		(var);							\
    54  		(var) = ((var)->field.stqe_next))
    55  
    56 +#define STAILQ_FOREACH_SAFE(var, head, field, tvar)			\
    57 +	for ((var) = STAILQ_FIRST((head));				\
    58 +		(var) && ((tvar) = STAILQ_NEXT((var), field), 1);	\
    59 +		(var) = (tvar))
    60 +
    61  #define	STAILQ_CONCAT(head1, head2) do {				\
    62  	if (!STAILQ_EMPTY((head2))) {					\
    63  		*(head1)->stqh_last = (head2)->stqh_first;		\
    64 @@ -437,11 +463,21 @@
    65  		(var);							\
    66  		(var) = ((var)->field.tqe_next))
    67  
    68 +#define TAILQ_FOREACH_SAFE(var, head, field, tvar)			\
    69 +	for ((var) = TAILQ_FIRST((head));				\
    70 +		(var) && ((tvar) = TAILQ_NEXT((var), field), 1);	\
    71 +		(var) = (tvar))
    72 +
    73  #define	TAILQ_FOREACH_REVERSE(var, head, headname, field)		\
    74  	for ((var) = (*(((struct headname *)((head)->tqh_last))->tqh_last));	\
    75  		(var);							\
    76  		(var) = (*(((struct headname *)((var)->field.tqe_prev))->tqh_last)))
    77  
    78 +#define TAILQ_FOREACH_REVERSE_SAFE(var, head, headname, field, tvar)	\
    79 +	for ((var) = TAILQ_LAST((head), headname);			\
    80 +		(var) && ((tvar) = TAILQ_PREV((var), headname, field), 1);	\
    81 +		(var) = (tvar))
    82 +
    83  #define	TAILQ_CONCAT(head1, head2, field) do {				\
    84  	if (!TAILQ_EMPTY(head2)) {					\
    85  		*(head1)->tqh_last = (head2)->tqh_first;		\