diff options
author | Mark Mitchell <mark@codesourcery.com> | 2005-04-21 05:34:33 +0000 |
---|---|---|
committer | Mark Mitchell <mark@codesourcery.com> | 2005-04-21 05:34:33 +0000 |
commit | b450502905875e85aab17371f78bb6befe5a3059 (patch) | |
tree | 74c33d9db60a1f34eb7d4501a3d412e31c4628e8 /gdb/ser-pipe.c | |
parent | 20b26460df083b26399a8e0dfe385077833db7a7 (diff) | |
download | gdb-b450502905875e85aab17371f78bb6befe5a3059.zip gdb-b450502905875e85aab17371f78bb6befe5a3059.tar.gz gdb-b450502905875e85aab17371f78bb6befe5a3059.tar.bz2 |
* configure.ac: On MinGW, define USE_WIN32API and link with
-lws2_32.
* ser-tcp.c (<winsock2.h>): Include, for Windows.
(ETIMEDOUT): Define, for Windows.
(ioctl): Likewise.
(closesocket): Define, for POSIX.
(net_open): Adjust for differences in socket functions between
Windows and UNIX.
(net_close): Likweise.
(net_read_prim): New function.
(net_write_prim): Likewise.
(_initialize_ser_tcp): Initialize winsock. Fill in read_prim and
write_prim.
* ser-unix.h (ser_unix_readcchar): Remove.
(ser_unix_read_prim): Declare.
(ser_unix_write_prim): Likewise.
* ser-unix.c (generic_readchar): Move to ser-base.c.
(ser_unix_wait_for): Likewise.
(do_unix_readchar): Likewise.
(ser_unix_readchar): Likewise.
(_initialize_ser_hardwire): Initialize read_prim and write_prim.
(ser_unix_read_prim): New function.
(ser_unix_write_prim): Likewise.
* ser-base.h (generic_readchar): Declare.
(ser_base_readchar): Likewise.
* ser-base.c (<winsock2.h>): Include, for windows.
(fd_event): Use the read primitive specified by the serial
interface.
(ser_base_wait_for): Moved from ser-unix.c
(do_ser_base_read_char): Likewise.
(generic_readchar): Likewise.
(ser_base_readchar): Likewise.
(ser_base_write): Use the write primitive specified by the serial
interface.
* ser-pipe.c (_initialize_ser_pipe): Use ser_base_readchar, not
ser_unix_readchar. Initialize read_prim and write_prim.
* serial.c (struct serial_ops): Add read_prim and write_prim.
* configure: Regenerate.
Diffstat (limited to 'gdb/ser-pipe.c')
-rw-r--r-- | gdb/ser-pipe.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gdb/ser-pipe.c b/gdb/ser-pipe.c index b6bb8d5..f127f5d 100644 --- a/gdb/ser-pipe.c +++ b/gdb/ser-pipe.c @@ -144,7 +144,7 @@ _initialize_ser_pipe (void) ops->next = 0; ops->open = pipe_open; ops->close = pipe_close; - ops->readchar = ser_unix_readchar; + ops->readchar = ser_base_readchar; ops->write = ser_base_write; ops->flush_output = ser_base_flush_output; ops->flush_input = ser_base_flush_input; @@ -158,5 +158,7 @@ _initialize_ser_pipe (void) ops->setstopbits = ser_base_setstopbits; ops->drain_output = ser_base_drain_output; ops->async = ser_base_async; + ops->read_prim = ser_unix_read_prim; + ops->write_prim = ser_unix_write_prim; serial_add_interface (ops); } |