1From d91e947bda590765e1c791f40e8ffb4135ab1cd3 Mon Sep 17 00:00:00 2001
2From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
3Date: Tue, 11 Jan 2022 00:01:49 +0100
4Subject: [PATCH] include time.h before asound.h
5
6Include time.h before asound.h to avoid the following build failure on
7musl that was already fixed a long time with
8https://github.com/tinyalsa/tinyalsa/commit/c8333f8c7a4e4b9549abeef7530b2cd20a18e537
9but reappeared on version 2.0.0:
10
11In file included from ../src/pcm_hw.c:42:
12/home/peko/autobuild/instance-1/output-1/host/i586-buildroot-linux-musl/sysroot/usr/include/sound/asound.h:444:18: error: field 'trigger_tstamp' has incomplete type
13  444 |  struct timespec trigger_tstamp; /* time when stream was started/stopped/paused */
14      |                  ^~~~~~~~~~~~~~
15
16Fixes:
17 - http://autobuild.buildroot.org/results/a75e23dc585bd071f4d65face5489ed6ac22edbe
18
19Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
20[Retrieved from:
21https://github.com/tinyalsa/tinyalsa/commit/c127110249967e0722d80bb41e33713accdcff8f]
22---
23 src/mixer.c      | 1 +
24 src/mixer_hw.c   | 1 +
25 src/pcm_hw.c     | 1 +
26 src/pcm_plugin.c | 1 +
27 4 files changed, 4 insertions(+)
28
29diff --git a/src/mixer.c b/src/mixer.c
30index afbc015..029fc84 100644
31--- a/src/mixer.c
32+++ b/src/mixer.c
33@@ -55,6 +55,7 @@
34 #define __user
35 #endif
36
37+#include <time.h>
38 #include <sound/asound.h>
39
40 #include <tinyalsa/mixer.h>
41diff --git a/src/mixer_hw.c b/src/mixer_hw.c
42index da5a390..50e9d07 100644
43--- a/src/mixer_hw.c
44+++ b/src/mixer_hw.c
45@@ -42,6 +42,7 @@
46 #include <sys/ioctl.h>
47
48 #include <linux/ioctl.h>
49+#include <time.h>
50 #include <sound/asound.h>
51
52 #include "mixer_io.h"
53diff --git a/src/pcm_hw.c b/src/pcm_hw.c
54index 5eb53be..2383ae0 100644
55--- a/src/pcm_hw.c
56+++ b/src/pcm_hw.c
57@@ -41,6 +41,7 @@
58 #include <sys/ioctl.h>
59 #include <sys/mman.h>
60 #include <linux/ioctl.h>
61+#include <time.h>
62 #include <sound/asound.h>
63 #include <tinyalsa/asoundlib.h>
64
65diff --git a/src/pcm_plugin.c b/src/pcm_plugin.c
66index 47bf4a5..b6b69aa 100644
67--- a/src/pcm_plugin.c
68+++ b/src/pcm_plugin.c
69@@ -40,6 +40,7 @@
70
71 #include <sys/ioctl.h>
72 #include <linux/ioctl.h>
73+#include <time.h>
74 #include <sound/asound.h>
75 #include <tinyalsa/asoundlib.h>
76 #include <tinyalsa/plugin.h>
77