0001-wave-add-time.h-missing-header-inclusion.patch 1.2 KB

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