diff mbox series

ALSA: uapi: #include <time.h> in asound.h

Message ID 20190329224854.38009-1-danielmentz@google.com (mailing list archive)
State New, archived
Headers show
Series ALSA: uapi: #include <time.h> in asound.h | expand

Commit Message

Daniel Mentz March 29, 2019, 10:48 p.m. UTC
The uapi header asound.h defines types based on struct timespec. We need
to #include <time.h> to get access to the definition of this struct.

Previously, we encountered the following error message when building
applications with a clang/bionic toolchain:

kernel-headers/sound/asound.h:350:19: error: field has incomplete type 'struct timespec'
  struct timespec trigger_tstamp;
                  ^

The absence of the time.h #include statement does not cause build errors
with glibc, because its version of stdlib.h indirectly includes time.h.

Signed-off-by: Daniel Mentz <danielmentz@google.com>
---
 include/uapi/sound/asound.h | 1 +
 1 file changed, 1 insertion(+)

Comments

Takashi Iwai April 1, 2019, 10:33 a.m. UTC | #1
On Fri, 29 Mar 2019 23:48:54 +0100,
Daniel Mentz wrote:
> 
> The uapi header asound.h defines types based on struct timespec. We need
> to #include <time.h> to get access to the definition of this struct.
> 
> Previously, we encountered the following error message when building
> applications with a clang/bionic toolchain:
> 
> kernel-headers/sound/asound.h:350:19: error: field has incomplete type 'struct timespec'
>   struct timespec trigger_tstamp;
>                   ^
> 
> The absence of the time.h #include statement does not cause build errors
> with glibc, because its version of stdlib.h indirectly includes time.h.
> 
> Signed-off-by: Daniel Mentz <danielmentz@google.com>

Applied, thanks.


Takashi
diff mbox series

Patch

diff --git a/include/uapi/sound/asound.h b/include/uapi/sound/asound.h
index 404d4b9ffe76..df1153cea0b7 100644
--- a/include/uapi/sound/asound.h
+++ b/include/uapi/sound/asound.h
@@ -32,6 +32,7 @@ 
 
 #ifndef __KERNEL__
 #include <stdlib.h>
+#include <time.h>
 #endif
 
 /*