[vlc-devel] [PATCH] access: dtv: fix lfind call with different prototypes in mingw32
robux4 at ycbcr.xyz
Fri Jul 12 11:43:43 CEST 2019
On 2019-07-12 9:14, Rémi Denis-Courmont wrote:
> size_t and unsigned should be the same on Win32, so I don't exactly see the point.
> Of course, there *is* a problem on Win64, but either MingW should be fixed or a systematic work-around should be used,m (e.g. #define lfind lfind_size_t), otherwise the same bug will reoccur silently (only on 64-bits Windows) every time lfind() is used.
I can make a local fix by remapping lfind() to a local function with the
correct signature, but if we want to make it generic it's trickier. It
is used by plugins, so it either needs to be exported by the core (nope)
or added in compat.
I don't think it's possible to do a header-only fix as we need to call
the actual lfind() and redefine it at the same time.
> Le 12 juillet 2019 09:21:32 GMT+03:00, Steve Lhomme <robux4 at ycbcr.xyz> a écrit :
>> It expects an input 'unsigned int' instead of 'size_t' even though it's
>> writing on the source.
>> Given there's no versioning on mingw32 we can't rely on such a header
>> to do this trick or not
>> modules/access/dtv/access.c | 7 ++++++-
>> 1 file changed, 6 insertions(+), 1 deletion(-)
>> diff --git a/modules/access/dtv/access.c b/modules/access/dtv/access.c
>> index 0a4b0ae3c1..ef70be324a 100644
>> --- a/modules/access/dtv/access.c
>> +++ b/modules/access/dtv/access.c
>> @@ -666,7 +666,12 @@ static const char *var_InheritModulation
>> (vlc_object_t *obj, const char *var)
>> if (mod == NULL)
>> return "";
>> - size_t n = sizeof (modulation_vlc) / sizeof (modulation_vlc);
>> +#ifdef _WIN32
>> + unsigned int n;
>> +#else /* !_WIN32 */
>> + size_t n;
>> +#endif /* !_WIN32 */
>> + n = sizeof (modulation_vlc) / sizeof (modulation_vlc);
>> const char *const *p = lfind (mod, modulation_vlc, &n, sizeof (mod),
>> if (p != NULL)
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
> Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
More information about the vlc-devel