On Tue, 2011-02-08 at 14:18 -0500, Rich Felker wrote:
> On Tue, Feb 08, 2011 at 09:56:24AM -0500, David Lynch Jr. wrote:
> >     I am not specifically familiar with Windows CE. But I have done lots of
> > cross platform work with windows.  Ignoring tangents like the Windows
> > Posix subsystem and Cygwin, normal windows - microsoft's C libraries
> > provides a significant portion of POSIX support.  The critical problem
> > is that windows developers almost univerally use the Windows specific
> > API's over the more portable POSIX API's. 
> 
> This is not true. The Microsoft libc (MSVCRT) does not even conform to
> ancient versions of the C standard, much less C99, and the degree to
> which the functions with names that mirror POSIX functions differ from
> the POSIX-specified behavior is laughable. (For instance, sockets and
> file descriptors are not the same and cannot be used interchangibly,
> and they're not allocated in lowest-available order.)
> 

        I did not claim that Microsoft conformed to the POSIX spec, just that
with a small amount of care on the part of the developers, it was
possible to write portable code. 
        I am not particularly enamored of the POSIX standards. Not that there
is something wrong with them, but I know very very few developers that
use more than a small fraction of the API. In general I encourage
developers NOT to deviate very far from the normal useage of API's or
the most common core API's. While it is likely that developers will see
expected behavior under Linux and other purportedly Posix compatible
environments, if you really do alot of cross platform work you will
encounter situations were rarely used API's or rarely used options bite
you in the ass. 

        In the instances I was dealing with I was trying use code that was
written for Windows under Linux, OpenBSD, and OSX with the minimum of
ifdef's and OS specific code. The projects I dealt with were fairly
large and worked well across many platforms - in fact despite being
written for windows the performance under Linux was superior. 

        If you are looking to port an existing *nix application to windows that
makes heavy use of less common API's you are looking at an enormous
amount of work. 
        But if you are trying to develop applications that you expect to build
and work on many platforms, and you have control over the coding
standards, portability is not that hard to achieve. 

        The Cygwin developers deserve credit for an enormous amount of hard
work, but their solution has sufficient complexity that you might as
well switch to Linux. 

_______________________________________________
uClibc mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/uclibc

Reply via email to