Mingw32 doesn't have sys/types.h, arpa/inet.h or netinet/in.h.  But if
you include winsock2.h instead of those three header files, most (?)
POSIX socket functions work.

The simplest solutions would be to replace:

#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>

with:

#include "glsocket.h"

or something, and glsocket.h does the right thing.  But I don't like
that, including the POSIX headers in my application is more readable.

Would it be possible to create those three POSIX header files if they
don't exist on the system, and if winsock2.h do exist?  The created
files would simply #include <winsock2.h>.  Creating them would be done
like getopt_.h and others.  The complication is that this has to be
done in a sub-directory somehow, so that #include for sys/socket.h
works.

What do you think?

Perhaps this should be considered a mingw32 bug instead?  Problem is
this mingw32 cross compiler will likely be around for a while, since
it is shipped with the latest Debian release..  So it might be useful
to support even if it is broken.

Thanks,
Simon


_______________________________________________
bug-gnulib mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-gnulib

Reply via email to