[vlc-devel] [PATCH] timespec_get: fix sys/time.h include usage

Rémi Denis-Courmont remi at remlab.net
Tue Oct 24 17:29:49 CEST 2017


Le tiistaina 24. lokakuuta 2017, 14.00.11 EEST Steve Lhomme a écrit :
> If gettimeofday doesn't exist we shouldn't include it.
> Matched the include used in vlc_fixups.h
> ---
>  compat/timespec_get.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/compat/timespec_get.c b/compat/timespec_get.c
> index 350e912fd0..24bc894cad 100644
> --- a/compat/timespec_get.c
> +++ b/compat/timespec_get.c
> @@ -28,7 +28,9 @@
>  #define _POSIX_TIMERS (-1)
>  #endif
>  #if (_POSIX_TIMERS <= 0)
> -# include <sys/time.h> /* gettimeofday() */
> +# ifdef HAVE_GETTIMEOFDAY
> +#  include <sys/time.h> /* gettimeofday() */
> +# endif
>  #endif

This is totally counter-sensical.

> 
>  int timespec_get(struct timespec *ts, int base)


-- 
雷米‧德尼-库尔蒙
https://www.remlab.net/



More information about the vlc-devel mailing list