DOS/Windows-specific code: sparcl-tdep.c

Andrew Cagney ac131313@cygnus.com
Thu May 10 08:33:00 GMT 2001


> On May 8,  2:49pm, Eli Zaretskii wrote:
> 
> 
>> * sparcl-tdep.c:
>> 
>> #if (!defined(__GO32__) && !defined(_WIN32)) || defined(__CYGWIN32__)
>> #define HAVE_SOCKETS
>> #include <sys/time.h>
>> #include <sys/socket.h>
>> #include <netinet/in.h>
>> #include <netdb.h>
>> #endif
>> 
>> Looks like an Autoconf test for HAVE_SOCKETS should do here.
> 
> 
> Why not just add an autoconf test for the sys/socket.h header file and
> then do:
> 
>     #ifdef HAVE_SYS_SOCKET_H
>     #define HAVE_SOCKETS
>     #include <sys/time.h>
> #include <sys/socket.h>
> #include <netinet/in.h>
> #include <netdb.h>
> #endif

I'm actually wondering why a *-tdep.c file is even playing around with 
sockets!  Normally that code appears in *-rom.c or *-mon.c files.  One 
interesting thing, the code uses UDP so, for ser*.c to ever replace it, 
the ser*.c code would need to gain UDP support.

Anyway, Kevin's suggestion should do the trick.


	Andrew




More information about the Gdb mailing list