Browse Source
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] 7d644e1215
pull/134/head
2 changed files with 23 additions and 0 deletions
@ -0,0 +1,22 @@ |
|||
--- libshout/src/common/timing/timing.c.orig 2022-04-21 15:00:39.729501137 +0300
|
|||
+++ libshout/src/common/timing/timing.c 2022-04-21 15:00:43.565527749 +0300
|
|||
@@ -37,6 +37,9 @@
|
|||
#include <mmsystem.h> |
|||
#include <winsock2.h> |
|||
#else |
|||
+#include <unistd.h>
|
|||
+#endif
|
|||
+
|
|||
#ifdef TIME_WITH_SYS_TIME |
|||
# include <sys/time.h> |
|||
# include <time.h> |
|||
@@ -48,9 +51,6 @@
|
|||
# endif |
|||
#endif |
|||
|
|||
-#include <unistd.h>
|
|||
-#endif
|
|||
-
|
|||
#ifdef HAVE_SYS_SELECT_H |
|||
#include <sys/select.h> |
|||
#endif |
|||
Loading…
Reference in new issue