llist: only provide Curl_llist_tail in unit test builds

... since it is not used otherwsie. Also fix Curl_node_prev to have the
same status.

Closes #14790
This commit is contained in:
Daniel Stenberg 2024-09-05 11:45:21 +02:00
parent 6aa5f25c64
commit f905769fe2
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -209,6 +209,7 @@ struct Curl_llist_node *Curl_llist_head(struct Curl_llist *list)
return VERIFYNODE(list->_head);
}
#ifdef UNITTESTS
/* Curl_llist_tail() returns the last 'struct Curl_llist_node *', which
might be NULL */
struct Curl_llist_node *Curl_llist_tail(struct Curl_llist *list)
@ -217,6 +218,7 @@ struct Curl_llist_node *Curl_llist_tail(struct Curl_llist *list)
DEBUGASSERT(list->_init == LLISTINIT);
return VERIFYNODE(list->_tail);
}
#endif
/* Curl_llist_count() returns a size_t the number of nodes in the list */
size_t Curl_llist_count(struct Curl_llist *list)
@ -243,7 +245,7 @@ struct Curl_llist_node *Curl_node_next(struct Curl_llist_node *n)
return VERIFYNODE(n->_next);
}
#ifdef UNITTEST
#ifdef UNITTESTS
/* Curl_node_prev() returns the previous element in a list from a given
Curl_llist_node */