Make alsa asound.h header more portable.
PATCH 1/1 Make alsa asound.h header more portable.
From: Thomas Klausner <[email protected]>
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).
--- include/uapi/sound/asound.h | 4 ++++ 1 file changed, 4 insertions(+)
include/uapi/sound/asound.h +4 -0
@@ -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>
Signature · 1 line
2.7.1
Quoted 6 lines · Thomas Klausner
From: Thomas Klausner <[email protected]>
This header is used as-is in the alsa-lib userland library, which is portable to other operating systems.
For this reason, includelinux/types.honly on Linux systems.
This is needed also for building the Linux kernel. So...
Quoted 12 lines
Add
sys/ioctl.hfor _IOR/_IOW/etc. (works at least on *BSD and Solaris).Signed-off-by Thomas Klausner <[email protected]>--- include/uapi/sound/asound.h | 4 ++++ 1 file changed, 4 insertions(+)include/uapi/sound/asound.h +0
-0
include/uapi/sound/asound.h line 26
Quoted 4 lines
include/uapi/sound/asound.h +1
-0@@ -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
PATCH 1/1 Make alsa asound.h header more portable.
From: Thomas Klausner <[email protected]>
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).
--- include/uapi/sound/asound.h | 4 ++++ 1 file changed, 4 insertions(+)
include/uapi/sound/asound.h +4 -0
@@ -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>
Signature · 1 line
2.7.1
Takashi Iwai
AppliedQuoted 10 lines · Thomas Klausner
From: Thomas Klausner <[email protected]>
This header is used as-is in the alsa-lib userland library, which is portable to other operating systems.
For this reason, includelinux/types.honly on Linux systems.Add
sys/ioctl.hfor _IOR/_IOW/etc. (works at least on *BSD and Solaris).Signed-off-by Thomas Klausner <[email protected]>
Applied, thanks.
Takashi
Quoted 23 lines
--- include/uapi/sound/asound.h | 4 ++++ 1 file changed, 4 insertions(+)include/uapi/sound/asound.h +4
-0@@ -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> Signature · 1 line
2.7.1
Quoted 26 lines · Takashi Iwai
Quoted 6 lines · Thomas Klausner
From: Thomas Klausner <[email protected]>
This header is used as-is in the alsa-lib userland library, which is portable to other operating systems.
For this reason, includelinux/types.honly on Linux systems.This is needed also for building the Linux kernel. So...
Quoted 15 lines
Add
sys/ioctl.hfor _IOR/_IOW/etc. (works at least on *BSD and Solaris).Signed-off-by Thomas Klausner <[email protected]>--- include/uapi/sound/asound.h | 4 ++++ 1 file changed, 4 insertions(+)include/uapi/sound/asound.h +0
-0@@ -23,7 +23,11 @@#ifndef _UAPI__SOUND_ASOUND_H#define _UAPI__SOUND_ASOUND_H
Quoted 7 lines
include/uapi/sound/asound.h line 26
Quoted 1 line
include/uapi/sound/asound.h +1
-0+#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