patches/glibc/2.9/190-queue-header-updates.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Mon Aug 23 14:32:16 2010 +0200 (2010-08-23)
changeset 2100 f9fcfc002c8a
parent 1201 c9967a6e3b25
permissions -rw-r--r--
debug/gdb: install dependable libs in a generic target static libs dir

For now, ncurses is the only dependable target library built for gdb.
But expat is coming, and there's no reason to install each library in
its own place.

So, install ncurses in a generic directory, where other dependable
libraries can be installed as well.

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