mirror of
https://code.videolan.org/videolan/vlc
synced 2024-09-04 09:11:33 +02:00
cf9bd77c67
Fixes android build with NDK 17 as lfind is not always available.
20 lines
533 B
C
20 lines
533 B
C
/*****************************************************************************
|
|
* lfind.c : implement lfind
|
|
*****************************************************************************/
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
# include <config.h>
|
|
#endif
|
|
|
|
void *lfind(const void *key, const void *base, size_t *nmemb,
|
|
size_t size, int(*cmp)(const void *, const void *))
|
|
{
|
|
for (int i = 0; i < *nmemb; ++i)
|
|
{
|
|
const void *elem = base + i * size;
|
|
if (!cmp(key, elem))
|
|
return elem;
|
|
}
|
|
return NULL;
|
|
}
|