Search Linux Wireless

Re: [PATCH] wireless.h: improve userland include-ability

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

 



On Wed, 2008-06-04 at 15:26 +0100, David Woodhouse wrote:
> On Wed, 2008-06-04 at 17:23 +0300, Kirill A. Shutemov wrote:
> > What do you think about hack like this:
> > 
> > #include <linux/types.h>                /* for __u* and __s* typedefs */
> > #if defined(__KERNEL__) || !defined(_SYS_SOCKET_H)
> > #include <linux/socket.h>               /* for "struct sockaddr" et al  */
> > #endif
> > #if defined(__KERNEL__) || !defined(_NET_IF_H)
> > #include <linux/if.h>                   /* for IFNAMSIZ and co... */
> > #endif
> > 
> > It avoids conflict between glibc's and kernel's headers if glibc's headers 
> > include first.
> 
> Anything which is dependent on ordering just makes matters worse, imho.

This kind of thing might work. It think it's fine as long as _some_
userspace header gets included first (which then includes <features.h>
and thus defines __KERNEL_STRICT_NAMES.

#ifndef __KERNEL__
#include <sys/socket.h>
#endif
#include <linux/types.h>
#include <linux/socket.h>
#include <linux/if.h>

-- 
dwmw2

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux