[ofa-general] RE: [ofw] RE: porting IB management code to Windows

Jason Gunthorpe jgunthorpe at obsidianresearch.com
Tue Dec 16 12:04:49 PST 2008


On Tue, Dec 16, 2008 at 11:01:09AM -0800, Smith, Stan wrote:

> So if 'everyone' is in favor of having a common src base, what's so
> hard about having a few #ifdef __WIN32?  Yes it's not the optimal
> approach, although changing compilers, building elsewhere, adding
> binaries are all certainly more offensive IMHO.

I think you have to appreciate that the code written for Linux is
written in C99 and for the POSIX API. WDK does not provide that kind
of environment and trying to bake over that with #ifdef is a huge
ongoing job. Just look at what Sean has done already, he had to
provide an independent getopt implementation just for a tiny utility.

> BTW, since the 'common src' will he maintained in the Linux world -
> who is to say patches will consider Windows ramifications and be
> tested in the Windows environment anyway?  History has not
> demonstrated this type of development diligence, hence the code fork
> which brings us to today's situation.

In my experience the #1 reason this happens is because people try to
'port' the code to a completely different environment rather than
accepting that POSIX code needs to run on POSIX libraries
(SFU/cygwin/etc) and Windows code needs to run on WIN32 libraries
(wine/mainwin/etc). Trying to patch over the huge differences with
ifdefs will always cause problems in the future as changes are made.

> Make the process easy one everyone and one day into the future,
> maybe MS will wakeup and the WDK will be c99 compliant?

MS already has a C99 POSIX environment they support and distribute, it
is called SFU and the bundled Intrix library set.

Jason



More information about the general mailing list