[PATCH alsa-lib] header: Fix build error with old kernel headers

Takashi Iwai tiwai at suse.de
Wed May 6 22:42:29 CEST 2020


Old development environment doesn't necessarily contain the headers
defining __kernel_long_t that is recently used for y2038 timespec
conditional.  Define it explicitly in such a case.

Signed-off-by: Takashi Iwai <tiwai at suse.de>
---
 include/sound/asound.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/include/sound/asound.h b/include/sound/asound.h
index 3be4d850a073..89dd7d2f61b8 100644
--- a/include/sound/asound.h
+++ b/include/sound/asound.h
@@ -1 +1,11 @@
+/* workaround for building with old glibc / kernel headers */
+#ifdef __linux__
+#include <linux/types.h>
+#else
+#include <sys/types.h>
+#endif
+#ifndef __kernel_long_t
+#define __kernel_long_t long
+#endif
+
 #include <alsa/sound/uapi/asound.h>
-- 
2.16.4



More information about the Alsa-devel mailing list