Skip to content
Snippets Groups Projects
Commit 9e095923 authored by Martin Storsjö's avatar Martin Storsjö
Browse files

contrib: libshout: Apply a patch to avoid implicit declarations of gettimeofday

This patch has been sent upstream at
https://gitlab.xiph.org/xiph/icecast-common/-/merge_requests/2
but hasn't been acted upon there yet.

When building for a mingw target, HAVE_GETTIMEOFDAY is defined
(as the gettimeofday function was found), but the #ifdef _WIN32 #else
block never tried to include <sys/time.h> (which provides the
declaration) and/or <time.h> for such targets. This caused
gettimeofday to be used without a prior declaration.

This has been visible as an easily overlooked warning, but Clang 15
changed this into a fatal error by default, when building in C99
mode (or newer). [1] (While Clang 15 still is under development, this
may still change before it's released, but the warning is valid
in any case.)

Decouple including of those headers from the #ifdef _WIN32 #else
block and just check their corresponding availability defines.

[1] https://github.com/llvm/llvm-project/commit/7d644e1215b376ec5e915df9ea2eeb56e2d94626
parent 83d7194d
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment