Mark Kettenis wrote: > Date: Tue, 05 Apr 2005 11:05:24 -0700 > From: Mark Mitchell > > Mark -- > > A while back, I posted a patch to change ser-tcp.c to support Windows, here: > > http://sources.redhat.com/ml/gdb-patches/2005-03/msg00331.html > > Apologies for not getting back to you. I meant no criticism; I very much appreciate your help. > Actually I think the WINAPI thingy is more descriptive. In light of > the discussion above, I think there should be a single spot in > configure.ac where we decide whether we want to use the native Windows > API or the proper POSIX interfaces that Cygwin provides get used. OK; I've implemented that. > Great! In this area we also have the ioctlsock v.s. ioctl issue. Is > it possible to keep using the proper POSIX interfaces in the code and > #define ioctl ioctlsock in the USE_WIN32API case instead of the other > way around? I think that makes it easier for non-Windows programmers > to understand the code. It's possible to "#define ioctl ioctlsocket" so that ioctl doesn't need to change. However, I think it would be very confusing to do "#define close closesocket" because there's already a Windows runtime library function called "close" -- it just doesn't work on sockets. So, in the version of the patch that's attached, we still do have a call to closesocket. Here's the revised version. One note: you might wonder why ser-base.c #include's . The reason is that ser-base.c uses select, and struct timeval comes form that header on Windows. We may eventually have to use something other than select on Windows, but we don't yet. Is this version OK? -- Mark Mitchell CodeSourcery, LLC mark@codesourcery.com (916) 791-8304