diff mbox

Remaining compatibility patches for NetBSD

Message ID 20160303120242.GL8492@danbala.tuwien.ac.at (mailing list archive)
State New, archived
Headers show

Commit Message

Thomas Klausner March 3, 2016, 12:02 p.m. UTC
Here are the remaining patches to make the build succeed on NetBSD.
More patches are needed for FreeBSD and Solaris, but let's take it one
at a time :-)

I think the first two (0002 and 0003) should be uncontroversial.

For patch 0004 it would perhaps be good to have versionsort/alphasort
in a central place instead of two. Do you have a suggestion where?

I'm not sure what to do about 0005 since you said you don't want to
modify include/sound/asound.h.

endian.h seems to be unneeded on src/topology/tplg_local.h; if it's
needed, I can move it inside the #ifdef.
 Thomas
From b8abae028c02294906e99b1bc66423a89dce54ec Mon Sep 17 00:00:00 2001
From: Thomas Klausner <wiz@NetBSD.org>
Date: Thu, 3 Mar 2016 12:56:58 +0100
Subject: [PATCH 2/5] Add more compatibility defines.

---
 include/type_compat.h | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Takashi Iwai March 3, 2016, 1:35 p.m. UTC | #1
On Thu, 03 Mar 2016 13:02:42 +0100,
Thomas Klausner wrote:
> 
> Here are the remaining patches to make the build succeed on NetBSD.
> More patches are needed for FreeBSD and Solaris, but let's take it one
> at a time :-)
> 
> I think the first two (0002 and 0003) should be uncontroversial.
> 
> For patch 0004 it would perhaps be good to have versionsort/alphasort
> in a central place instead of two. Do you have a suggestion where?
> 
> I'm not sure what to do about 0005 since you said you don't want to
> modify include/sound/asound.h.

Right.  If we need to modify, it must be applied to Linux kernel tree
at first, then copy back to alsa-lib.

> endian.h seems to be unneeded on src/topology/tplg_local.h; if it's
> needed, I can move it inside the #ifdef.

src/topology/parser.c contains the code depending on the endian.
The include can be moved there, too.


Takashi
Thomas Klausner March 3, 2016, 1:46 p.m. UTC | #2
On Thu, Mar 03, 2016 at 02:35:06PM +0100, Takashi Iwai wrote:
> On Thu, 03 Mar 2016 13:02:42 +0100,
> Thomas Klausner wrote:
> > 
> > Here are the remaining patches to make the build succeed on NetBSD.
> > More patches are needed for FreeBSD and Solaris, but let's take it one
> > at a time :-)
> > 
> > I think the first two (0002 and 0003) should be uncontroversial.
> > 
> > For patch 0004 it would perhaps be good to have versionsort/alphasort
> > in a central place instead of two. Do you have a suggestion where?
> > 
> > I'm not sure what to do about 0005 since you said you don't want to
> > modify include/sound/asound.h.
> 
> Right.  If we need to modify, it must be applied to Linux kernel tree
> at first, then copy back to alsa-lib.

I haven't done this before.

I see on https://www.kernel.org/doc/linux/MAINTAINERS

SOUND
M:	Jaroslav Kysela <perex@perex.cz>
M:	Takashi Iwai <tiwai@suse.com>
L:	alsa-devel@alsa-project.org (moderated for non-subscribers)
W:	http://www.alsa-project.org/
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git
T:	git git://git.alsa-project.org/alsa-kernel.git
Q:	http://patchwork.kernel.org/project/alsa-devel/list/
S:	Maintained
F:	Documentation/sound/
F:	include/sound/
F:	include/uapi/sound/
F:	sound/

Against which of the two git trees should I prepare the patch?

> > endian.h seems to be unneeded on src/topology/tplg_local.h; if it's
> > needed, I can move it inside the #ifdef.
> 
> src/topology/parser.c contains the code depending on the endian.
> The include can be moved there, too.

local.h already handles endianness:

#ifdef HAVE_ENDIAN_H
#include <endian.h>
#elif defined(HAVE_SYS_ENDIAN_H)
#include <sys/endian.h>
#ifndef __BYTE_ORDER
#define __BYTE_ORDER BYTE_ORDER
#endif
#ifndef __LITTLE_ENDIAN
#define __LITTLE_ENDIAN LITTLE_ENDIAN
#endif
#ifndef __BIG_ENDIAN
#define __BIG_ENDIAN BIG_ENDIAN
#endif
#else
#error Header defining endianness not defined
#endif

So I think the endian.h include is not necessary and can just be removed.
 Thomas
Takashi Iwai March 3, 2016, 1:54 p.m. UTC | #3
On Thu, 03 Mar 2016 14:46:41 +0100,
Thomas Klausner wrote:
> 
> On Thu, Mar 03, 2016 at 02:35:06PM +0100, Takashi Iwai wrote:
> > On Thu, 03 Mar 2016 13:02:42 +0100,
> > Thomas Klausner wrote:
> > > 
> > > Here are the remaining patches to make the build succeed on NetBSD.
> > > More patches are needed for FreeBSD and Solaris, but let's take it one
> > > at a time :-)
> > > 
> > > I think the first two (0002 and 0003) should be uncontroversial.
> > > 
> > > For patch 0004 it would perhaps be good to have versionsort/alphasort
> > > in a central place instead of two. Do you have a suggestion where?
> > > 
> > > I'm not sure what to do about 0005 since you said you don't want to
> > > modify include/sound/asound.h.
> > 
> > Right.  If we need to modify, it must be applied to Linux kernel tree
> > at first, then copy back to alsa-lib.
> 
> I haven't done this before.
> 
> I see on https://www.kernel.org/doc/linux/MAINTAINERS
> 
> SOUND
> M:	Jaroslav Kysela <perex@perex.cz>
> M:	Takashi Iwai <tiwai@suse.com>
> L:	alsa-devel@alsa-project.org (moderated for non-subscribers)
> W:	http://www.alsa-project.org/
> T:	git git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git
> T:	git git://git.alsa-project.org/alsa-kernel.git
> Q:	http://patchwork.kernel.org/project/alsa-devel/list/
> S:	Maintained
> F:	Documentation/sound/
> F:	include/sound/
> F:	include/uapi/sound/
> F:	sound/
> 
> Against which of the two git trees should I prepare the patch?

Use my sound git tree.


> > > endian.h seems to be unneeded on src/topology/tplg_local.h; if it's
> > > needed, I can move it inside the #ifdef.
> > 
> > src/topology/parser.c contains the code depending on the endian.
> > The include can be moved there, too.
> 
> local.h already handles endianness:
> 
> #ifdef HAVE_ENDIAN_H
> #include <endian.h>
> #elif defined(HAVE_SYS_ENDIAN_H)
> #include <sys/endian.h>
> #ifndef __BYTE_ORDER
> #define __BYTE_ORDER BYTE_ORDER
> #endif
> #ifndef __LITTLE_ENDIAN
> #define __LITTLE_ENDIAN LITTLE_ENDIAN
> #endif
> #ifndef __BIG_ENDIAN
> #define __BIG_ENDIAN BIG_ENDIAN
> #endif
> #else
> #error Header defining endianness not defined
> #endif
> 
> So I think the endian.h include is not necessary and can just be removed.

Yes, looks so.


Takashi
Thomas Klausner March 3, 2016, 2:23 p.m. UTC | #4
On Thu, Mar 03, 2016 at 02:54:09PM +0100, Takashi Iwai wrote:
> On Thu, 03 Mar 2016 14:46:41 +0100,
> Thomas Klausner wrote:
> > 
> > On Thu, Mar 03, 2016 at 02:35:06PM +0100, Takashi Iwai wrote:
> > > On Thu, 03 Mar 2016 13:02:42 +0100,
> > > Thomas Klausner wrote:
> > > > 
> > > > Here are the remaining patches to make the build succeed on NetBSD.
> > > > More patches are needed for FreeBSD and Solaris, but let's take it one
> > > > at a time :-)
> > > > 
> > > > I think the first two (0002 and 0003) should be uncontroversial.
> > > > 
> > > > For patch 0004 it would perhaps be good to have versionsort/alphasort
> > > > in a central place instead of two. Do you have a suggestion where?
> > > > 
> > > > I'm not sure what to do about 0005 since you said you don't want to
> > > > modify include/sound/asound.h.
> > > 
> > > Right.  If we need to modify, it must be applied to Linux kernel tree
> > > at first, then copy back to alsa-lib.
> > 
> > I haven't done this before.
> > 
> > I see on https://www.kernel.org/doc/linux/MAINTAINERS
> > 
> > SOUND
> > M:	Jaroslav Kysela <perex@perex.cz>
> > M:	Takashi Iwai <tiwai@suse.com>
> > L:	alsa-devel@alsa-project.org (moderated for non-subscribers)
> > W:	http://www.alsa-project.org/
> > T:	git git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git
> > T:	git git://git.alsa-project.org/alsa-kernel.git
> > Q:	http://patchwork.kernel.org/project/alsa-devel/list/
> > S:	Maintained
> > F:	Documentation/sound/
> > F:	include/sound/
> > F:	include/uapi/sound/
> > F:	sound/
> > 
> > Against which of the two git trees should I prepare the patch?
> 
> Use my sound git tree.

Ok, I've just sent a patch against that repository to this mailing list.
 Thomas
diff mbox

Patch

diff --git a/include/type_compat.h b/include/type_compat.h
index 9cc209f..0c10aed 100644
--- a/include/type_compat.h
+++ b/include/type_compat.h
@@ -25,6 +25,9 @@ 
 #ifndef EBADFD
 #define EBADFD EBADF
 #endif
+#ifndef ESTRPIPE
+#define ESTRPIPE EPIPE
+#endif
 
 #ifndef __u16
 #define __u16	uint16_t
@@ -63,4 +66,8 @@ 
 #define __kernel_off_t	off_t
 #endif
 
+#ifndef __bitwise
+#define __bitwise
+#endif
+
 #endif