summaryrefslogtreecommitdiff
path: root/gcc/mips-tdump.c
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>1998-11-27 10:09:17 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>1998-11-27 10:09:17 +0000
commit2778b98d9088057e96730a5a4f314d9d57bedc65 (patch)
tree34ccf49c3a33a630b8aabf80bc4b9c4bd0db64b8 /gcc/mips-tdump.c
parent3081a3ada689c56e5a8c348aac90dfe7f00122bd (diff)
downloadgcc-2778b98d9088057e96730a5a4f314d9d57bedc65.tar.gz
system.h: Include libiberty.h.
* system.h: Include libiberty.h. * c-aux-info.c: Remove prototypes for concat/concat3. Change function `concat' from fixed parameters to variable parameters, as is done in libiberty. All callers of concat/concat3 changed to use the new `concat' with variable args. * cccp.c: Remove things made redundant by libiberty.h and/or conform to libiberty standards. * cexp.y: Likewise. * collect2.c: Likewise. * config/1750a/1750a.h: Likewise. * cppalloc.c: Likewise. * cppexp.c: Likewise. * cppfiles.c: Likewise. * cpphash.c: Likewise. * cpplib.c: Likewise. * dyn-string.c: Likewise. * fix-header.c: Likewise. * gcc.c: Likewise. * gcov.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * gencheck.c: Likewise. * gencodes.c: Likewise. * genconfig.c: Likewise. * genemit.c: Likewise. * genextract.c: Likewise. * genflags.c: Likewise. * gengenrtl.c: Likewise. * genopinit.c: Likewise. * genoutput.c: Likewise. * genpeep.c: Likewise. * genrecog.c: Likewise. * getpwd.c: Likewise. * halfpic.c: Likewise. * hash.c: Likewise. * mips-tdump.c: Likewise. Wrap malloc/realloc/calloc prototypes in NEED_DECLARATION_* macros. * mips-tfile.c: Remove things made redundant by libiberty.h and/or conform to libiberty standards. (fatal): Fix const-ification of variable `format' in !ANSI_PROTOTYPES case. * prefix.c: Remove things made redundant by libiberty.h and/or conform to libiberty standards. * print-rtl.c: Rename variable `spaces' to `xspaces' to avoid conflicting with function `spaces' from libiberty. * profile.c: Remove things made redundant by libiberty.h and/or conform to libiberty standards. * protoize.c: Likewise. * rtl.h: Likewise. * scan.h: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tree.h: Likewise. From-SVN: r23931
Diffstat (limited to 'gcc/mips-tdump.c')
-rw-r--r--gcc/mips-tdump.c69
1 files changed, 30 insertions, 39 deletions
diff --git a/gcc/mips-tdump.c b/gcc/mips-tdump.c
index 558e090a64d..fdf018ec5fa 100644
--- a/gcc/mips-tdump.c
+++ b/gcc/mips-tdump.c
@@ -47,24 +47,9 @@ Boston, MA 02111-1307, USA. */
#define MIPS_UNMARK_STAB(code) ((code)-CODE_MASK)
#endif
-#ifdef __STDC__
-typedef void *PTR_T;
-typedef const void *CPTR_T;
-#define __proto(x) x
-#else
-
-#if defined(_STDIO_H_) || defined(__STDIO_H__) /* Ultrix 4.0, SGI */
-typedef void *PTR_T;
-typedef void *CPTR_T;
-
-#else
-typedef char *PTR_T; /* Ultrix 3.1 */
-typedef char *CPTR_T;
-#endif
-
-#define __proto(x) ()
-#define const
-#endif
+#define __proto(x) PARAMS(x)
+typedef PTR PTR_T;
+typedef const PTR_T CPTR_T;
#define uchar unsigned char
#define ushort unsigned short
@@ -72,6 +57,27 @@ typedef char *CPTR_T;
#define ulong unsigned long
+static void
+fatal(s)
+ const char *s;
+{
+ fprintf(stderr, "%s\n", s);
+ exit(FATAL_EXIT_CODE);
+}
+
+/* Same as `malloc' but report error if no memory available. */
+/* Do this before size_t is fiddled with so it matches the prototype
+ in libiberty.h . */
+PTR
+xmalloc (size)
+ size_t size;
+{
+ register PTR value = (PTR) malloc (size);
+ if (value == 0)
+ fatal ("Virtual memory exhausted.");
+ return value;
+}
+
/* Do to size_t being defined in sys/types.h and different
in stddef.h, we have to do this by hand..... Note, these
types are correct for MIPS based systems, and may not be
@@ -270,10 +276,15 @@ char *lang_to_string __proto((lang_t));
char *type_to_string __proto((AUXU *, int, FDR *));
#ifndef __alpha
+# ifdef NEED_DECLARATION_MALLOC
extern PTR_T malloc __proto((size_t));
+# endif
+# ifdef NEED_DECLARATION_CALLOC
extern PTR_T calloc __proto((size_t, size_t));
+# endif
+# ifdef NEED_DECLARATION_REALLOC
extern PTR_T realloc __proto((PTR_T, size_t));
-extern void free __proto((PTR_T));
+# endif
#endif
extern char *optarg;
@@ -1590,23 +1601,3 @@ fancy_abort ()
fprintf (stderr, "mips-tdump internal error");
exit (1);
}
-
-void
-fatal(s)
-char *s;
-{
- fprintf(stderr, "%s\n", s);
- exit(1);
-}
-
-/* Same as `malloc' but report error if no memory available. */
-
-PTR_T
-xmalloc (size)
- unsigned size;
-{
- register PTR_T value = malloc (size);
- if (value == 0)
- fatal ("Virtual memory exhausted.");
- return value;
-}