1From 7d3b8ac47789545af5a4cd2fc1cf9bcfb91ae3b0 Mon Sep 17 00:00:00 2001
2From: Julien Olivain <ju.o@free.fr>
3Date: Sat, 29 Oct 2022 12:51:17 +0200
4Subject: [PATCH] wave: add <time.h> missing header inclusion
5
6When compiling tinycompress with some libc other than glibc
7(e.g. musl libc), compilation fails with the following error:
8
9    In file included from wave.c:11:0:
10    /path/to/gcc/sysroot/usr/include/sound/asound.h:404:18: error: field 'trigger_tstamp' has incomplete type
11      struct timespec trigger_tstamp; /* time when stream was started/stopped/paused */
12    [...]
13
14According to POSIX, "struct timespec" is defined in <time.h>. See:
15https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/time.h.html
16
17This patch fixes this build failure by including <time.h> prior
18<sound/asound.h>.
19
20Signed-off-by: Julien Olivain <ju.o@free.fr>
21---
22 src/utils/wave.c | 1 +
23 1 file changed, 1 insertion(+)
24
25diff --git a/src/utils/wave.c b/src/utils/wave.c
26index a74149a..d17f66a 100644
27--- a/src/utils/wave.c
28+++ b/src/utils/wave.c
29@@ -8,6 +8,7 @@
30 #include <stdio.h>
31 #include <stdint.h>
32 #include <string.h>
33+#include <time.h>
34 #include <sound/asound.h>
35
36 #include "tinycompress/tinywave.h"
37--
382.38.1
39
40