[haiku-development] Re: Header file conflict between posix and freebsd_compat

  • From: "Clemens Zeidler" <clemens.zeidler@xxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Fri, 14 May 2010 14:00:51 +1200

Hi,

I think I don't get the exact problem, but what about introducing another
private BSD wireless fake header, containing the needed ioctl stuff, which can be included aside the posix header?

cheers,
        Clemens


Am 13.05.2010, 20:23 Uhr, schrieb Ithamar R. Adema
<ithamar.adema@xxxxxxxxxxxxxxxx>:

Hi,

While working on integrating the patch attached to ticket http://dev.haiku-os.org/ticket/5697 I ran into a problem. Ifconfig currently uses the posix/net/if_media.h header for definition of the IFM_* flags, which includes the full/half duplex defines.

However, to include wireless features, I needed to add the private includes for the freebsd_compat library, so we can ioctl() the wireless drivers to retrieve things like the SSID, and set the WEP keys, scan for APs, etc.

However, since the full/half duplex defines are only defined in posix/net/if_media.h, and not in the freebsd_compat headers, and those getting included first, I ran into a snag.

There are several ways of solving this:

1) Merge the header files. This sucks , since the BSD header contains a lot of defines that aren't really needed for native users of the header file. 2) Include the full/half duplex defines in the BSD header. This is a bit unlogical IMHO, since the BSD code doesn't even use those. 3) Do some creative #ifdef's in both header so I can explicitely include the posix one (#include <posix/net/if_media.h) and prevent the double define warnings. This sounds like a pretty crude solution to me.

Am I missing any other (better) solutions here, or does anyone have an explicit preference for any particular solution listed above?

We'll run into this as well with the Network panel (both current and new) when we want to add wireless support I guess....

HTH,

Ithamar.

Other related posts: