Skip to content

Commit

Permalink
ALSA: uapi: #include <time.h> in asound.h
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
danielmentzgoogle authored and tiwai committed Apr 2, 2019
1 parent ea5c7eb commit b5bdbb6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions include/uapi/sound/asound.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

#ifndef __KERNEL__
#include <stdlib.h>
#include <time.h>
#endif

/*
Expand Down

0 comments on commit b5bdbb6

Please sign in to comment.