[PATCH 4/4] Check for __linux__ instead of linux during compilation

Jasper St. Pierre jstpierre at mecheye.net
Mon Feb 9 13:59:26 PST 2015


This makes sense.

Reviewed-by: Jasper St. Pierre <jstpierre at mecheye.net>

On Mon, Feb 9, 2015 at 1:56 PM, Emil Velikov <emil.l.velikov at gmail.com>
wrote:

> Would anyone have some input - apart from the missing libpciaccess
> prefix of course ?
> Fwiw src/common_interface.c already checks for __linux__, so this
> patch makes things more consistent as an added bonus :-P
>
> Cheers,
> Emil
>
> On 6 February 2015 at 17:29, Emil Velikov <emil.l.velikov at gmail.com>
> wrote:
> > From: Eero Tamminen <eero.t.tamminen at intel.com>
> >
> > "__linux__" is the POSIX define for checking for Linux OS, "linux" is
> > deprecated and apparently not supported by Android.
> >
> > Besides correcting the define, patch adds error for the case OS isn't
> > unrecognized.
> >
> > Signed-off-by: Eero Tamminen <eero.t.tamminen at intel.com>
> > [Emil Velikov: Remove irrelevant Android details from commit msg.]
> > Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
> > ---
> >  src/common_init.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/src/common_init.c b/src/common_init.c
> > index a127a8b..b1c0c3e 100644
> > --- a/src/common_init.c
> > +++ b/src/common_init.c
> > @@ -52,7 +52,7 @@ pci_system_init( void )
> >  {
> >      int err = ENOSYS;
> >
> > -#ifdef linux
> > +#ifdef __linux__
> >      err = pci_system_linux_sysfs_create();
> >  #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) ||
> defined(__DragonFly__)
> >      err = pci_system_freebsd_create();
> > @@ -64,6 +64,8 @@ pci_system_init( void )
> >      err = pci_system_solx_devfs_create();
> >  #elif defined(__GNU__) || defined(__CYGWIN__)
> >      err = pci_system_x86_create();
> > +#else
> > +# error "Unsupported OS"
> >  #endif
> >
> >      return err;
> > --
> > 2.2.2
> >
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel
>



-- 
  Jasper
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.x.org/archives/xorg-devel/attachments/20150209/65f58209/attachment.html>


More information about the xorg-devel mailing list