patches/glibc/ports-2.10.1/150-queue-header-updates.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Jan 17 23:06:02 2010 +0100 (2010-01-17)
changeset 1740 c57458bb354d
child 2169 8b470eaf3d85
permissions -rw-r--r--
configure: do not require hg when configuring in an hg clone

When configuring in an hg clone, we need hg to compute the version string.
It can happen that users do not have Mercurial (eg. if they got a snapshot
rather that they did a full clone). In this case, we can still run, of
course, so simply fill the version string with a sufficiently explicit
value, that does not require hg. The date is a good candidate.
     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;		\