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
signature.asc
Description: PGP signature