Browse Source

compat: define tfind family of functions regardless of the search.h status

The existence of search.h is not relevant for that. search.h may exist but does
not provide tfind, as on Windows.

If tfind.c is included for compilation, then the code needs to be built.
pull/141/head
Steve Lhomme 4 years ago
parent
commit
6a46f1152d
  1. 5
      compat/tfind.c
  2. 4
      include/vlc_fixups.h

5
compat/tfind.c

@ -6,9 +6,6 @@
# include <config.h>
#endif
/** search.h is not present so every t* functions has to be implemented */
#ifndef HAVE_SEARCH_H
#include <assert.h>
#include <stdlib.h>
@ -240,5 +237,3 @@ twalk(const void *vroot, cmp_fn_t action) /* Root of the tree to be walked */
if (vroot != NULL && action != NULL)
trecurse(vroot, action, 0);
}
#endif // HAVE_SEARCH_H

4
include/vlc_fixups.h

@ -481,7 +481,7 @@ ssize_t sendmsg(int, const struct msghdr *, int);
#endif
/* search.h */
#ifndef HAVE_SEARCH_H
#ifndef HAVE_TFIND
typedef enum {
preorder,
postorder,
@ -498,7 +498,7 @@ void twalk( const void *root, void(*action)(const void *nodep, VISIT which, int
void *lfind( const void *key, const void *base, size_t *nmemb,
size_t size, int(*cmp)(const void *, const void *) );
#endif
#endif /* HAVE_SEARCH_H */
#endif /* HAVE_TFIND */
#ifndef HAVE_TDESTROY
void tdestroy( void *root, void (*free_node)(void *nodep) );

Loading…
Cancel
Save