From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: [PATCH] define more missing types for non-Linux Date: Thu, 03 Mar 2016 10:32:04 +0100 Message-ID: References: <56D010C4.3000804@ladisch.de> <1456758321-2256-1-git-send-email-tk@giga.or.at> <1456758321-2256-2-git-send-email-tk@giga.or.at> <20160302221454.GC8492@danbala.tuwien.ac.at> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id E153A2619D0 for ; Thu, 3 Mar 2016 10:32:04 +0100 (CET) In-Reply-To: <20160302221454.GC8492@danbala.tuwien.ac.at> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Thomas Klausner Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org On Wed, 02 Mar 2016 23:14:54 +0100, Thomas Klausner wrote: > > >From 634255a4d87a12132bb65868f5658fd14cd2bfd7 Mon Sep 17 00:00:00 2001 > From: Thomas Klausner > 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 > #include > #include > +#if defined(__linux__) > #include > #include > +#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