Skip to contentSkip to conversation

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

PATCH Applied Daniel Mentz 2 participants 2 messages Mar 29, 2019 – Apr 1, 2019 Sound

lore
Share & tools
lore
#0 lore raw

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

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.

---
 include/uapi/sound/asound.h | 1 +
 1 file changed, 1 insertion(+)
include/uapi/sound/asound.h +1 -0
index 404d4b9ffe76..df1153cea0b7 100644
@@ -32,6 +32,7 @@
 
 #ifndef __KERNEL__
 #include <stdlib.h>
+#include <time.h>
 #endif
 
 /*
Signature · 1 line
2.21.0.392.gf8f6787159e-goog
Applied
#1 lore raw
Quoted 7 lines · Daniel Mentz

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:

Quoted 8 lines

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.

Applied, thanks.

Takashi