X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Fcppalloc.c;h=79d4c9b3f65730b1be1e4a7324eae3e245543292;hb=42ca9c049ade2fa7b6273f8d4f4aec3969f543fc;hp=f7b6019d460bf84b6a73a12f05614618aa30c538;hpb=8d62a21cd3d8c4d8311bab2e02530218e76db6a7;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/cppalloc.c b/gcc/cppalloc.c index f7b6019d460..79d4c9b3f65 100644 --- a/gcc/cppalloc.c +++ b/gcc/cppalloc.c @@ -23,11 +23,14 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. what you give them. Help stamp out software-hoarding! */ #include "config.h" +#include +#include "cpplib.h" static void memory_full () { - fatal ("Memory exhausted."); + fprintf (stderr, "%s: Memory exhausted.\n", progname); + exit (FATAL_EXIT_CODE); } char * @@ -35,10 +38,9 @@ xmalloc (size) unsigned size; { register char *ptr = (char *) malloc (size); - if (ptr != 0) return (ptr); - memory_full (); - /*NOTREACHED*/ - return 0; + if (ptr == 0) + memory_full (); + return ptr; } char * @@ -51,14 +53,3 @@ xrealloc (old, size) memory_full (); return ptr; } - -char * -xcalloc (number, size) - unsigned number, size; -{ - register unsigned total = number * size; - register char *ptr = (char *) calloc (number, size); - if (ptr == 0) - memory_full (); - return ptr; -}