From: Jim Kingdon Date: Fri, 3 Mar 1995 21:38:54 +0000 (+0000) Subject: * utils.c [_AIX]: Include stddef.h instead of #defining size_t. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0d172a2ef470ff8fdb4d64e532ab6a6d92a07e1d;p=binutils-gdb.git * utils.c [_AIX]: Include stddef.h instead of #defining size_t. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 8110f06547a..c451caeb34d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +Fri Mar 3 12:27:28 1995 Jim Kingdon + + * utils.c [_AIX]: Include stddef.h instead of #defining size_t. + Fri Mar 3 12:33:24 1995 Michael Meissner * rs6000-tdep.c (skip_prologue): Skip multiple stores of the saved diff --git a/gdb/utils.c b/gdb/utils.c index e7f4b9cee29..8bdd1413903 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -1,5 +1,5 @@ /* General utility routines for GDB, the GNU debugger. - Copyright 1986, 1989, 1990, 1991, 1992 Free Software Foundation, Inc. + Copyright 1986, 1989, 1990, 1991, 1992, 1995 Free Software Foundation, Inc. This file is part of GDB. @@ -18,7 +18,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "defs.h" -#if !defined(__GO32__) +#if !defined(__GO32__) && !defined(WIN32) #include #include #include @@ -284,8 +284,12 @@ error (va_alist) va_list args; char *string; - error_begin (); va_start (args); + + if (error_hook) + error_hook (args); /* Never returns */ + + error_begin (); string = va_arg (args, char *); vfprintf_filtered (gdb_stderr, string, args); fprintf_filtered (gdb_stderr, "\n"); @@ -474,7 +478,7 @@ quit () } -#ifdef __GO32__ +#if defined(__GO32__)||defined(WIN32) /* In the absence of signals, poll keyboard for a quit. Called from #define QUIT pollquit() in xm-go32.h. */ @@ -503,7 +507,7 @@ pollquit() #endif -#ifdef __GO32__ +#if defined(__GO32__)||defined(WIN32) void notice_quit() { if (kbhit ()) @@ -554,19 +558,31 @@ request_quit (signo) #if defined (NO_MMALLOC) +/* Make a substitute size_t for non-ANSI compilers. */ + +#ifdef _AIX +#include +#else /* Not AIX */ +#ifndef __STDC__ +#ifndef size_t +#define size_t unsigned int +#endif +#endif +#endif /* Not AIX */ + PTR mmalloc (md, size) PTR md; - long size; + size_t size; { - return (malloc (size)); + return malloc (size); } PTR mrealloc (md, ptr, size) PTR md; PTR ptr; - long size; + size_t size; { if (ptr == 0) /* Guard against old realloc's */ return malloc (size); @@ -824,6 +840,12 @@ query (va_alist) register int ans2; int retval; + if (query_hook) + { + va_start (args); + return query_hook (args); + } + /* Automatically answer "yes" if input is not from a terminal. */ if (!input_from_terminal_p ()) return 1; @@ -1226,6 +1248,12 @@ void gdb_flush (stream) FILE *stream; { + if (flush_hook) + { + flush_hook (stream); + return; + } + fflush (stream); } @@ -1252,7 +1280,7 @@ fputs_maybe_filtered (linebuffer, stream, filter) if (linebuffer == 0) return; - + /* Don't do any filtering if it is disabled. */ if (stream != gdb_stdout || (lines_per_page == UINT_MAX && chars_per_line == UINT_MAX)) @@ -1703,7 +1731,7 @@ strcmp_iw (string1, string2) void -_initialize_utils () +initialize_utils () { struct cmd_list_element *c; @@ -1722,7 +1750,7 @@ _initialize_utils () /* These defaults will be used if we are unable to get the correct values from termcap. */ -#if defined(__GO32__) +#if defined(__GO32__) || defined(WIN32) lines_per_page = ScreenRows(); chars_per_line = ScreenCols(); #else