From 0b6a968ee62c0e94758b5996f10509741731ec10 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Sun, 10 Jun 2001 16:25:51 +0000 Subject: [PATCH] * gnu-regex.c: Eliminate obsolete check for _MSC_VER. * utils.c (notice_quit): Remove dummy function only used for _MSC_VER. * values.c (unpack_double): Remove obsolete check for _MSC_VER. * defs.h: Ditto. * m32r-rom.c: Ditto. * p-exp.y: Ditto. * ser-e7kpc.c: Ditto. Define WIN32_LEAN_AND_MEAN under _WIN32, for faster compilation. (get_ds_base): Remove _MSC_VER version of this function. * nindy-share/ttyflush.c: Ditto. X * rdi-share/host.h: Ditto. X * ser-go32.c (dos_readchar): Remove call to obsolete function. * remote-sim.c (gdb_os_poll_quit): Ditto. * remote-e7000.c (expect): Remove obsolete #if 0'ed code. * main.c (captured_main): Eliminate special Cygwin checks. * ser-tcp.c: Remove unneeded __CYGWIN__ guard against system include. --- gdb/ChangeLog | 20 ++++++++++++++++++++ gdb/defs.h | 11 ----------- gdb/gnu-regex.c | 17 ++--------------- gdb/m32r-rom.c | 8 -------- gdb/main.c | 18 ------------------ gdb/nindy-share/ttyflush.c | 5 ----- gdb/p-exp.y | 5 ----- gdb/rdi-share/host.h | 10 +--------- gdb/remote-e7000.c | 17 ----------------- gdb/remote-sim.c | 1 - gdb/ser-e7kpc.c | 36 +----------------------------------- gdb/ser-go32.c | 1 - gdb/ser-tcp.c | 2 -- gdb/utils.c | 29 ----------------------------- gdb/values.c | 5 ----- 15 files changed, 24 insertions(+), 161 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 520cc91618..6daaf1d635 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,23 @@ +2001-06-10 Christopher Faylor + + * gnu-regex.c: Eliminate obsolete check for _MSC_VER. + * utils.c (notice_quit): Remove dummy function only used for _MSC_VER. + * values.c (unpack_double): Remove obsolete check for _MSC_VER. + * defs.h: Ditto. + * m32r-rom.c: Ditto. + * p-exp.y: Ditto. + * ser-e7kpc.c: Ditto. Define WIN32_LEAN_AND_MEAN under _WIN32, for + faster compilation. + (get_ds_base): Remove _MSC_VER version of this function. + * nindy-share/ttyflush.c: Ditto. X + * rdi-share/host.h: Ditto. X + * ser-go32.c (dos_readchar): Remove call to obsolete function. + * remote-sim.c (gdb_os_poll_quit): Ditto. + * remote-e7000.c (expect): Remove obsolete #if 0'ed code. + + * main.c (captured_main): Eliminate special Cygwin checks. + * ser-tcp.c: Remove unneeded __CYGWIN__ guard against system include. + 2001-06-09 Andrew Cagney * Makefile.in (gdbcmd_h): Add ui_out_h. diff --git a/gdb/defs.h b/gdb/defs.h index 9c33c53e84..1694739407 100644 --- a/gdb/defs.h +++ b/gdb/defs.h @@ -920,13 +920,7 @@ typedef struct ptid ptid_t; #include "fopen-same.h" #endif -/* Microsoft C can't deal with const pointers */ - -#ifdef _MSC_VER -#define CONST_PTR -#else #define CONST_PTR const -#endif /* Defaults for system-wide constants (if not defined by xm.h, we fake it). FIXME: Assumes 2's complement arithmetic */ @@ -1092,11 +1086,6 @@ extern char *getenv (const char *); #endif #ifdef HAVE_STDLIB_H -#if defined(_MSC_VER) && !defined(__cplusplus) -/* msvc defines these in stdlib.h for c code */ -#undef min -#undef max -#endif #include #endif #ifndef min diff --git a/gdb/gnu-regex.c b/gdb/gnu-regex.c index 6acdcf27a5..89e532ef6c 100644 --- a/gdb/gnu-regex.c +++ b/gdb/gnu-regex.c @@ -1590,21 +1590,8 @@ static reg_errcode_t compile_range _RE_ARGS ((const char **p_ptr, /* This is not an arbitrary limit: the arguments which represent offsets into the pattern are two bytes long. So if 2^16 bytes turns out to be too small, many things would have to change. */ -/* Any other compiler which, like MSC, has allocation limit below 2^16 - bytes will have to use approach similar to what was done below for - MSC and drop MAX_BUF_SIZE a bit. Otherwise you may end up - reallocating to 0 bytes. Such thing is not going to work too well. - You have been warned!! */ -#if defined _MSC_VER && !defined WIN32 -/* Microsoft C 16-bit versions limit malloc to approx 65512 bytes. - The REALLOC define eliminates a flurry of conversion warnings, - but is not required. */ -# define MAX_BUF_SIZE 65500L -# define REALLOC(p,s) realloc ((p), (size_t) (s)) -#else -# define MAX_BUF_SIZE (1L << 16) -# define REALLOC(p,s) realloc ((p), (s)) -#endif +#define MAX_BUF_SIZE (1L << 16) +#define REALLOC(p,s) realloc ((p), (s)) /* Extend the buffer by twice its current size via realloc and reset the pointers that pointed into the old block to point to the diff --git a/gdb/m32r-rom.c b/gdb/m32r-rom.c index ff9f5b54e0..b4bfefdf21 100644 --- a/gdb/m32r-rom.c +++ b/gdb/m32r-rom.c @@ -42,7 +42,6 @@ extern void report_transfer_performance (unsigned long, time_t, time_t); -#ifndef _MSC_VER /* * All this stuff just to get my host computer's IP address! */ @@ -52,7 +51,6 @@ extern void report_transfer_performance (unsigned long, time_t, time_t); #if 1 #include /* for inet_ntoa */ #endif -#endif static char *board_addr; /* user-settable IP address for M32R-EVA */ static char *server_addr; /* user-settable IP address for gdb host */ @@ -392,8 +390,6 @@ mon2000_open (char *args, int from_tty) monitor_open (args, &mon2000_cmds, from_tty); } -#ifndef _MSC_VER - /* Function: set_board_address Tell the BootOne monitor what it's ethernet IP address is. */ @@ -575,8 +571,6 @@ m32r_upload_command (char *args, int from_tty) clear_symtab_users (); } -#endif /* ! _MSC_VER */ - void _initialize_m32r_rom (void) { @@ -604,7 +598,6 @@ Specify the serial device it is connected to (e.g. /dev/ttya)."; mon2000_ops.to_open = mon2000_open; add_target (&mon2000_ops); -#ifndef _MSC_VER add_show_from_set (add_set_cmd ("download-path", class_obscure, var_string, (char *) &download_path, @@ -630,5 +623,4 @@ Specify the serial device it is connected to (e.g. /dev/ttya)."; "Upload the srec file via the monitor's Ethernet upload capability."); add_com ("tload", class_obscure, m32r_load, "test upload command."); -#endif } diff --git a/gdb/main.c b/gdb/main.c index ad4e3b7f59..f7aa5188f3 100644 --- a/gdb/main.c +++ b/gdb/main.c @@ -90,10 +90,6 @@ static void print_gdb_help (struct ui_file *); extern int enable_external_editor; extern char *external_editor_command; -#ifdef __CYGWIN__ -#include /* for cygwin32_conv_to_posix_path */ -#endif - /* Call command_loop. If it happens to return, pass that through as a non-zero return status. */ @@ -534,21 +530,7 @@ extern int gdbtk_test (char *); *before* all the command line arguments are processed; it sets global parameters, which are independent of what file you are debugging or what directory you are in. */ -#ifdef __CYGWIN__ - { - char *tmp = getenv ("HOME"); - - if (tmp != NULL) - { - homedir = (char *) alloca (PATH_MAX + 1); - cygwin32_conv_to_posix_path (tmp, homedir); - } - else - homedir = NULL; - } -#else homedir = getenv ("HOME"); -#endif if (homedir) { homeinit = (char *) alloca (strlen (homedir) + diff --git a/gdb/nindy-share/ttyflush.c b/gdb/nindy-share/ttyflush.c index 9754472ddd..ff3b644022 100644 --- a/gdb/nindy-share/ttyflush.c +++ b/gdb/nindy-share/ttyflush.c @@ -22,11 +22,6 @@ #include "defs.h" #include "serial.h" -#ifdef _MSC_VER -# include -# define sleep _sleep -#endif - /* Flush all pending input and output for SERIAL, wait for a second, and then if there is a character pending, discard it and flush again. */ diff --git a/gdb/p-exp.y b/gdb/p-exp.y index b09ec08e8e..d786af9f6e 100644 --- a/gdb/p-exp.y +++ b/gdb/p-exp.y @@ -58,11 +58,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "symfile.h" /* Required by objfiles.h. */ #include "objfiles.h" /* For have_full_symbols and have_partial_symbols */ -/* MSVC uses strnicmp instead of strncasecmp */ -#ifdef _MSC_VER -#define strncasecmp strnicmp -#endif - /* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc), as well as gratuitiously global symbol names, so we can have multiple yacc generated parsers in gdb. Note that these are only the variables diff --git a/gdb/rdi-share/host.h b/gdb/rdi-share/host.h index 4dffa8475f..2955583d08 100644 --- a/gdb/rdi-share/host.h +++ b/gdb/rdi-share/host.h @@ -59,13 +59,6 @@ # define COMPILING_ON_WINDOWS_CONSOLE 1 # define COMPILING_ON_WINDOWS 1 #endif -#ifdef _MSC_VER -# define COMPILING_ON_MSDOS 1 -# define COMPILING_ON_WINDOWS 1 -# if defined(__cplusplus) -# define IMPLEMENT_BOOL_AS_INT 1 /* VC++ doesn't have 'bool' (yet) */ -# endif -#endif /* The '(defined(__sparc) && defined(P_tmpdir) */ /* && !defined(__svr4__))' is to detect gcc on SunOS. */ /* C++ compilers don't have to define __STDC__ */ @@ -187,8 +180,7 @@ typedef char *ArgvType; # define FILENAME_MAX 256 #endif -#if (!defined(__STDC__) && !defined(__cplusplus) && !defined(_MSC_VER)) || \ - defined(COMPILING_ON_SUNOS) +#if (!defined(__STDC__) && !defined(__cplusplus) || defined(COMPILING_ON_SUNOS) /* Use bcopy rather than memmove, as memmove is not available. */ /* There does not seem to be a header for bcopy. */ void bcopy(const char *src, char *dst, int length); diff --git a/gdb/remote-e7000.c b/gdb/remote-e7000.c index 34ac3456d0..320584b94e 100644 --- a/gdb/remote-e7000.c +++ b/gdb/remote-e7000.c @@ -86,8 +86,6 @@ #define SR_REGNUM -1 #endif -extern void notice_quit (void); - extern void report_transfer_performance (unsigned long, time_t, time_t); extern char *sh_processor_type; @@ -260,21 +258,6 @@ expect (char *string) while (1) { c = readchar (timeout); -#if 0 - notice_quit (); - if (quit_flag == 1) - { - if (ctrl_c) - { - putchar_e7000 (CTRLC); - --ctrl_c; - } - else - { - quit (); - } - } -#endif if (echo) { diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c index 71af0742be..3e515c13af 100644 --- a/gdb/remote-sim.c +++ b/gdb/remote-sim.c @@ -611,7 +611,6 @@ gdb_os_poll_quit (host_callback *p) if (ui_loop_hook != NULL) ui_loop_hook (0); - notice_quit (); if (quit_flag) /* gdb's idea of quit */ { quit_flag = 0; /* we've stolen it */ diff --git a/gdb/ser-e7kpc.c b/gdb/ser-e7kpc.c index c529c141f6..209765ef40 100644 --- a/gdb/ser-e7kpc.c +++ b/gdb/ser-e7kpc.c @@ -24,13 +24,8 @@ #include "serial.h" #include "gdb_string.h" -/* MSVC uses strnicmp instead of strncasecmp */ -#ifdef _MSC_VER -#define strncasecmp strnicmp -#define WIN32_LEAN_AND_MEAN -#endif - #ifdef _WIN32 +#define WIN32_LEAN_AND_MEAN #include #endif @@ -129,36 +124,7 @@ sigs[] = 0 }; -#ifdef _MSC_VER -/* Get the base of the data segment. This is needed to calculate the offset - between data segment addresses and the base of linear memory, which is where - device registers reside. Note that this is really only necessary for - Win32s, since Win95 and NT keep the data segment at linear 0. */ - -static unsigned long -get_ds_base (void) -{ - unsigned short dsval; - LDT_ENTRY ldt; - unsigned long dsbase; - - __asm - { - mov dsval, ds - } - - dsbase = 0; - - GetThreadSelectorEntry (GetCurrentThread (), dsval, &ldt); - - dsbase = ldt.HighWord.Bits.BaseHi << 24 | ldt.HighWord.Bits.BaseMid << 16 - | ldt.BaseLow; - - return dsbase; -} -#else /* !_MSC_VER */ #define get_ds_base() 0 -#endif /* _MSC_VER */ static int e7000pc_init (void) diff --git a/gdb/ser-go32.c b/gdb/ser-go32.c index 3d336f77c3..a8521f2a0e 100644 --- a/gdb/ser-go32.c +++ b/gdb/ser-go32.c @@ -623,7 +623,6 @@ dos_readchar (serial_t scb, int timeout) { if (timeout >= 0 && (rawclock () - then) >= 0) return SERIAL_TIMEOUT; - notice_quit (); } return c; diff --git a/gdb/ser-tcp.c b/gdb/ser-tcp.c index d7eb9cbd7d..30281cde1e 100644 --- a/gdb/ser-tcp.c +++ b/gdb/ser-tcp.c @@ -29,9 +29,7 @@ #include #include #include -#ifndef __CYGWIN__ #include -#endif #include #include "gdb_string.h" diff --git a/gdb/utils.c b/gdb/utils.c index 1e9c44f750..294ad42658 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -868,35 +868,6 @@ quit (void) return_to_top_level (RETURN_QUIT); } - -#if defined(_MSC_VER) /* should test for wingdb instead? */ - -/* - * Windows translates all keyboard and mouse events - * into a message which is appended to the message - * queue for the process. - */ - -void -notice_quit (void) -{ - int k = win32pollquit (); - if (k == 1) - quit_flag = 1; - else if (k == 2) - immediate_quit = 1; -} - -#else /* !defined(_MSC_VER) */ - -void -notice_quit (void) -{ - /* Done by signals */ -} - -#endif /* !defined(_MSC_VER) */ - /* Control C comes here */ void request_quit (int signo) diff --git a/gdb/values.c b/gdb/values.c index f5a7ce001e..bb441cd5ea 100644 --- a/gdb/values.c +++ b/gdb/values.c @@ -695,12 +695,7 @@ unpack_double (struct type *type, char *valaddr, int *invp) else if (nosign) { /* Unsigned -- be sure we compensate for signed LONGEST. */ -#if !defined (_MSC_VER) || (_MSC_VER > 900) return (ULONGEST) unpack_long (type, valaddr); -#else - /* FIXME!!! msvc22 doesn't support unsigned __int64 -> double */ - return (LONGEST) unpack_long (type, valaddr); -#endif /* _MSC_VER */ } else { -- 2.34.1