bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 0/4] Use AF_ALG in checksum utilities


From: Dmitry V. Levin
Subject: Re: [PATCH 0/4] Use AF_ALG in checksum utilities
Date: Tue, 24 Apr 2018 17:31:54 +0300

On Tue, Apr 24, 2018 at 03:28:51PM +0200, Bruno Haible wrote:
> Hi Matteo,
> 
> > >   * As you already noticed, we need to avoid build failures and runtime 
> > > failures
> > >     on platforms where this is not supported.
> > >
> > 
> > I see "#ifdef __linux__" already in use in gnulibs, I assume this is
> > the preferred way.
> 
> Not really. When being compiled on an older Linux machine, that does not have 
> the
> necessary include files, this "#ifdef __linux__" would lead to a compilation 
> error.
> 
> Therefore the preferred way is to test for the essential header files. For 
> example,
> suppose AF_ALG gets defined by <linux/foobar.h> and is present in every 
> version of
> <linux/foobar.h> (even the oldest ones). Then in the Autoconf macro we would 
> need
> 
>   AC_CHECK_HEADERS([linux/foobar.h])
> 
> and in the code we would have
> 
>   #if HAVE_LINUX_FOOBAR_H

Just using the header that provides a prototype for socket(), most likely
        #include <sys/socket.h>
and checking
        #ifdef AF_ALG
should be enough in this case.


-- 
ldv

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]