From: Takashi Iwai <tiwai@suse.de>
To: Thomas Klausner <tk@giga.or.at>
Cc: alsa-devel@alsa-project.org
Subject: Re: [PATCH] define more missing types for non-Linux
Date: Thu, 03 Mar 2016 10:32:04 +0100 [thread overview]
Message-ID: <s5h60x3sy97.wl-tiwai@suse.de> (raw)
In-Reply-To: <20160302221454.GC8492@danbala.tuwien.ac.at>
On Wed, 02 Mar 2016 23:14:54 +0100,
Thomas Klausner wrote:
>
> >From 634255a4d87a12132bb65868f5658fd14cd2bfd7 Mon Sep 17 00:00:00 2001
> From: Thomas Klausner <wiz@NetBSD.org>
> Date: Wed, 2 Mar 2016 23:11:54 +0100
> Subject: [PATCH] Define some types if missing.
>
> For portability with non-Linux.
>
> Include Linux header on Linux only.
> ---
> include/local.h | 39 +++++++++++++++++++++++++++++++++++++++
> 1 file changed, 39 insertions(+)
>
> diff --git a/include/local.h b/include/local.h
> index 28ed106..9728598 100644
> --- a/include/local.h
> +++ b/include/local.h
> @@ -50,13 +50,52 @@
> #include <sys/poll.h>
> #include <sys/types.h>
> #include <errno.h>
> +#if defined(__linux__)
> #include <linux/types.h>
> #include <linux/ioctl.h>
> +#endif
>
> #ifndef EBADFD
> #define EBADFD EBADF
> #endif
>
> +#ifndef __u16
> +#define __u16 uint16_t
> +#endif
> +#ifndef __u32
> +#define __u32 uint32_t
> +#endif
> +#ifndef __u64
> +#define __u64 uint64_t
> +#endif
> +#ifndef __le16
> +#define __le16 uint16_t
> +#endif
> +#ifndef __le32
> +#define __le32 uint32_t
> +#endif
> +#ifndef __le64
> +#define __le64 uint64_t
> +#endif
> +#ifndef u_int8_t
> +#define u_int8_t uint8_t
> +#endif
> +#ifndef u_int16_t
> +#define u_int16_t uint16_t
> +#endif
> +#ifndef u_int32_t
> +#define u_int32_t uint32_t
> +#endif
> +#ifndef u_int32_t
> +#define u_int32_t uint64_t
> +#endif
> +#ifndef __kernel_pid_t
> +#define __kernel_pid_t pid_t
> +#endif
> +#ifndef __kernel_off_t
> +#define __kernel_off_t off_t
> +#endif
Can we put this in include/type_compat.h or something like that, and
include it in #else block of #ifdef __linux__?
As a bonus, the EBADFD definition can also go to there, too.
thanks,
Takashi
next prev parent reply other threads:[~2016-03-03 9:32 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-18 15:47 feeding back pkgsrc changs Thomas Klausner
2016-02-18 15:51 ` Takashi Iwai
2016-02-23 14:09 ` portability patch: EBADF [was Re: feeding back pkgsrc changs] Thomas Klausner
2016-02-23 15:53 ` Takashi Iwai
2016-02-24 13:16 ` Thomas Klausner
2016-02-24 15:36 ` Takashi Iwai
2016-02-25 23:31 ` portability: types Thomas Klausner
2016-02-26 8:45 ` Clemens Ladisch
2016-02-29 15:05 ` [PATCH 1/3] Use POSIX uint*_t instead of u_int*_t Thomas Klausner
2016-02-29 15:05 ` [PATCH 2/3] Use pid_t, off_t instead of __kernel_*_t for better portability Thomas Klausner
2016-02-29 16:10 ` Takashi Iwai
2016-03-02 22:14 ` [PATCH] define more missing types for non-Linux Thomas Klausner
2016-03-03 9:32 ` Takashi Iwai [this message]
2016-03-03 9:50 ` Thomas Klausner
2016-03-03 9:53 ` Takashi Iwai
2016-03-03 9:55 ` Takashi Iwai
2016-03-03 9:58 ` Thomas Klausner
2016-03-03 10:01 ` Takashi Iwai
2016-03-03 10:10 ` byteswap.h Thomas Klausner
2016-03-03 10:21 ` byteswap.h Takashi Iwai
2016-03-03 11:18 ` byteswap.h Thomas Klausner
2016-03-03 11:37 ` byteswap.h Takashi Iwai
2016-03-03 11:39 ` byteswap.h Thomas Klausner
2016-03-03 12:02 ` Remaining compatibility patches for NetBSD Thomas Klausner
2016-03-03 13:35 ` Takashi Iwai
2016-03-03 13:46 ` Thomas Klausner
2016-03-03 13:54 ` Takashi Iwai
2016-03-03 14:23 ` Thomas Klausner
2016-02-29 15:05 ` [PATCH 3/3] Use uint*_t instead of __le* Thomas Klausner
2016-02-29 15:10 ` [PATCH 4/4] Replace __u* with uint*_t Thomas Klausner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=s5h60x3sy97.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=tk@giga.or.at \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox