From: Daniel Stenberg Date: Thu, 5 Sep 2024 09:45:21 +0000 (+0200) Subject: llist: only provide Curl_llist_tail in unit test builds X-Git-Tag: curl-8_10_0~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f905769fe27b1d92601dd70fd4eb50ef3ccf2e3b;p=thirdparty%2Fcurl.git 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 --- diff --git a/lib/llist.c b/lib/llist.c index f0e5fe08bb..7e19cd5095 100644 --- a/lib/llist.c +++ b/lib/llist.c @@ -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 */