[vlc-devel] [PATCH 1/3] vlc_fixup: remap win64 lfind as it expects a unsigned* where we get a size_t*

Rémi Denis-Courmont remi at remlab.net
Tue Jul 16 09:59:34 CEST 2019


Hi,

I don't see any reason to diverge from the existing strategy of including or not system headers here. Only Win64 needs this hack if MingW is not fixed.

Le 16 juillet 2019 10:26:43 GMT+03:00, Steve Lhomme <robux4 at ycbcr.xyz> a écrit :
>So now we include search.h for every file we compile.
>
>Co-authored-by: Rémi Denis-Courmont <remi at remlab.net>
>---
> include/vlc_fixups.h | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
>diff --git a/include/vlc_fixups.h b/include/vlc_fixups.h
>index 2164f690b1..6822feeaeb 100644
>--- a/include/vlc_fixups.h
>+++ b/include/vlc_fixups.h
>@@ -489,10 +489,18 @@ void *tdelete( const void *key, void **rootp,
>int(*cmp)(const void *, const void
>void twalk( const void *root, void(*action)(const void *nodep, VISIT
>which, int depth) );
> void *lfind( const void *key, const void *base, size_t *nmemb,
>              size_t size, int(*cmp)(const void *, const void *) );
>-#endif /* HAVE_SEARCH_H */
>+#else /* !HAVE_SEARCH_H */
>+#include <search.h>
>+#endif /* !HAVE_SEARCH_H */
> #ifndef HAVE_TDESTROY
> void tdestroy( void *root, void (*free_node)(void *nodep) );
> #endif
>+#ifdef _WIN64
>+/* the Win32 prorotype of lfind() expects an unsigned* for 'nelp' */
>+# define lfind(a,b,c,d,e) \
>+         lfind(a,b, &(unsigned){ (*(c) > UINT_MAX) ? UINT_MAX : *(c)
>}, d,e)
>+#endif /* _WIN64 */
>+
> 
> /* Random numbers */
> #ifndef HAVE_NRAND48
>-- 
>2.17.1
>
>_______________________________________________
>vlc-devel mailing list
>To unsubscribe or modify your subscription options:
>https://mailman.videolan.org/listinfo/vlc-devel

-- 
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20190716/025b3081/attachment.html>


More information about the vlc-devel mailing list