I applied the patch locally and can confirm it fixed the libvpx build.
Thank you very much for the quick diagnosis and fix!

Jeremy

On Fri, May 16, 2025 at 9:30 AM LIU Hao <[email protected]> wrote:
>
> We have declarations such as
>
>     WINPTHREAD_API int sem_timedwait64(sem_t * sem, const struct _timespec64 
> *t);
>
> When `struct _timespec64` is not forward-declared, this function declaration
> declares a new struct whose scope is limited to that function. In this case it
> is not the same type as the one in file scope, which causes errors like
>
>     C:/MSYS64/mingw64/include/semaphore.h: In function 'sem_timedwait':
>     C:/MSYS64/mingw64/include/semaphore.h:53:32: error: passing argument 2 of 
> 'sem_timedwait64' from
> incompatible pointer type [-Wincompatible-pointer-types]
>        53 |   return sem_timedwait64 (sem, (const struct _timespec64 *) t);
>           |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>           |                                |
>           |                                const struct _timespec64 *
>     C:/MSYS64/mingw64/include/semaphore.h:47:75: note: expected 'const struct 
> _timespec64 *' but argument
> is of type 'const struct _timespec64 *'
>        47 | WINPTHREAD_API int sem_timedwait64(sem_t * sem, const struct 
> _timespec64 *t);
>           |                                                 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~^
>
> We include <sys/timeb.h> so those function declarations reference the global
> types and do not declare their own.
>
> Reported-by: Jeremy Lainé <[email protected]>
> Signed-off-by: LIU Hao <[email protected]>
> ---
>   mingw-w64-libraries/winpthreads/include/pthread_time.h | 1 +
>   mingw-w64-libraries/winpthreads/include/semaphore.h    | 1 +
>   2 files changed, 2 insertions(+)
>
> diff --git a/mingw-w64-libraries/winpthreads/include/pthread_time.h
> b/mingw-w64-libraries/winpthreads/include/pthread_time.h
> index ac014aefc..27f7566f0 100644
> --- a/mingw-w64-libraries/winpthreads/include/pthread_time.h
> +++ b/mingw-w64-libraries/winpthreads/include/pthread_time.h
> @@ -23,6 +23,7 @@
>   #ifndef WIN_PTHREADS_TIME_H
>   #define WIN_PTHREADS_TIME_H
>
> +#include <sys/timeb.h>
>   #include "pthread_compat.h"
>
>   /* Posix timers are supported */
> diff --git a/mingw-w64-libraries/winpthreads/include/semaphore.h
> b/mingw-w64-libraries/winpthreads/include/semaphore.h
> index 649583ffc..9a6c211a9 100644
> --- a/mingw-w64-libraries/winpthreads/include/semaphore.h
> +++ b/mingw-w64-libraries/winpthreads/include/semaphore.h
> @@ -23,6 +23,7 @@
>   #ifndef WIN_PTHREADS_SEMAPHORE_H
>   #define WIN_PTHREADS_SEMAPHORE_H
>
> +#include <sys/timeb.h>
>   #include "pthread_compat.h"
>
>   #ifdef __cplusplus
> --
> 2.49.0
>


_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to