patches/glibc/ports-2.10.1/150-queue-header-updates.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Jul 17 17:54:21 2011 +0200 (2011-07-17)
changeset 2888 dd71df95903a
parent 1625 fde082da9813
permissions -rw-r--r--
cc/gcc: pass the companion libs prefix to cc_core

In case of canadian-cross, the companion libraries are not the same for
the core cc (they run on 'build') as they are for the final cc (they run
on 'host').

Prepare for this differentiation (coming later), while retaining the
current behavior (to use the same compblibs).

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
     1 grab some updates from FreeBSD
     2 
     3 http://bugs.gentoo.org/201979
     4 
     5 diff -durN glibc-2.10.1.orig/misc/sys/queue.h glibc-2.10.1/misc/sys/queue.h
     6 
     7 diff -durN glibc-2.10.1.orig/misc/sys/queue.h glibc-2.10.1/misc/sys/queue.h
     8 --- glibc-2.10.1.orig/misc/sys/queue.h	2008-03-05 06:50:30.000000000 +0100
     9 +++ glibc-2.10.1/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;		\