[alsa-devel] [PATCH] Make alsa asound.h header more portable.
From: Thomas Klausner wiz@NetBSD.org
This header is used as-is in the alsa-lib userland library, which is portable to other operating systems. For this reason, include linux/types.h only on Linux systems.
Add sys/ioctl.h for _IOR/_IOW/etc. (works at least on *BSD and Solaris).
Signed-off-by: Thomas Klausner wiz@NetBSD.org --- include/uapi/sound/asound.h | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/include/uapi/sound/asound.h b/include/uapi/sound/asound.h index a82108e..3d581b5 100644 --- a/include/uapi/sound/asound.h +++ b/include/uapi/sound/asound.h @@ -23,7 +23,11 @@ #ifndef _UAPI__SOUND_ASOUND_H #define _UAPI__SOUND_ASOUND_H
+#ifdef __linux__ #include <linux/types.h> +#else +#include <sys/ioctl.h> +#endif
#ifndef __KERNEL__ #include <stdlib.h>
On Thu, 03 Mar 2016 15:21:39 +0100, Thomas Klausner wrote:
From: Thomas Klausner wiz@NetBSD.org
This header is used as-is in the alsa-lib userland library, which is portable to other operating systems. For this reason, include linux/types.h only on Linux systems.
This is needed also for building the Linux kernel. So...
Add sys/ioctl.h for _IOR/_IOW/etc. (works at least on *BSD and Solaris).
Signed-off-by: Thomas Klausner wiz@NetBSD.org
include/uapi/sound/asound.h | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/include/uapi/sound/asound.h b/include/uapi/sound/asound.h index a82108e..3d581b5 100644 --- a/include/uapi/sound/asound.h +++ b/include/uapi/sound/asound.h @@ -23,7 +23,11 @@ #ifndef _UAPI__SOUND_ASOUND_H #define _UAPI__SOUND_ASOUND_H
+#ifdef __linux__
... the following might be better.
#if defined(__KERNEL__) || defined(__linux__)
At least the same style is found in include/uapi/drm/drm.h, too.
thanks,
Takashi
From: Thomas Klausner wiz@NetBSD.org
This header is used as-is in the alsa-lib userland library, which is portable to other operating systems. For this reason, include linux/types.h only on Linux systems.
Add sys/ioctl.h for _IOR/_IOW/etc. (works at least on *BSD and Solaris).
Signed-off-by: Thomas Klausner wiz@NetBSD.org --- include/uapi/sound/asound.h | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/include/uapi/sound/asound.h b/include/uapi/sound/asound.h index a82108e..67bf49d 100644 --- a/include/uapi/sound/asound.h +++ b/include/uapi/sound/asound.h @@ -23,7 +23,11 @@ #ifndef _UAPI__SOUND_ASOUND_H #define _UAPI__SOUND_ASOUND_H
+#if defined(__KERNEL__) || defined(__linux__) #include <linux/types.h> +#else +#include <sys/ioctl.h> +#endif
#ifndef __KERNEL__ #include <stdlib.h>
On Thu, 03 Mar 2016 16:28:22 +0100, Thomas Klausner wrote:
From: Thomas Klausner wiz@NetBSD.org
This header is used as-is in the alsa-lib userland library, which is portable to other operating systems. For this reason, include linux/types.h only on Linux systems.
Add sys/ioctl.h for _IOR/_IOW/etc. (works at least on *BSD and Solaris).
Signed-off-by: Thomas Klausner wiz@NetBSD.org
Applied, thanks.
Takashi
include/uapi/sound/asound.h | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/include/uapi/sound/asound.h b/include/uapi/sound/asound.h index a82108e..67bf49d 100644 --- a/include/uapi/sound/asound.h +++ b/include/uapi/sound/asound.h @@ -23,7 +23,11 @@ #ifndef _UAPI__SOUND_ASOUND_H #define _UAPI__SOUND_ASOUND_H
+#if defined(__KERNEL__) || defined(__linux__) #include <linux/types.h> +#else +#include <sys/ioctl.h> +#endif
#ifndef __KERNEL__
#include <stdlib.h>
2.7.1
On Thu, Mar 03, 2016 at 04:21:32PM +0100, Takashi Iwai wrote:
On Thu, 03 Mar 2016 15:21:39 +0100, Thomas Klausner wrote:
From: Thomas Klausner wiz@NetBSD.org
This header is used as-is in the alsa-lib userland library, which is portable to other operating systems. For this reason, include linux/types.h only on Linux systems.
This is needed also for building the Linux kernel. So...
Add sys/ioctl.h for _IOR/_IOW/etc. (works at least on *BSD and Solaris).
Signed-off-by: Thomas Klausner wiz@NetBSD.org
include/uapi/sound/asound.h | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/include/uapi/sound/asound.h b/include/uapi/sound/asound.h index a82108e..3d581b5 100644 --- a/include/uapi/sound/asound.h +++ b/include/uapi/sound/asound.h @@ -23,7 +23,11 @@ #ifndef _UAPI__SOUND_ASOUND_H #define _UAPI__SOUND_ASOUND_H
+#ifdef __linux__
... the following might be better.
#if defined(__KERNEL__) || defined(__linux__)
At least the same style is found in include/uapi/drm/drm.h, too.
Thank you! New patch sent. Thomas
participants (2)
-
Takashi Iwai
-
Thomas Klausner