mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-13 21:05:16 +00:00
9c9bfa7f29
gram.y to gram.yc so that we don't try to turn it into a .cpp file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3874 91177308-0d34-0410-b5e6-96231b3b80d8
36 lines
550 B
C
36 lines
550 B
C
char rcsid_zalloc[] = "$Id$";
|
|
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
#include "b.h"
|
|
|
|
extern void exit ARGS((int));
|
|
extern void free ARGS((void *));
|
|
extern void *malloc ARGS((unsigned));
|
|
|
|
int
|
|
fatal(const char *name, int line)
|
|
{
|
|
fprintf(stderr, "assertion failed: file %s, line %d\n", name, line);
|
|
exit(1);
|
|
return 0;
|
|
}
|
|
|
|
void *
|
|
zalloc(size) unsigned int size;
|
|
{
|
|
void *t = (void *) malloc(size);
|
|
if (!t) {
|
|
fprintf(stderr, "Malloc failed---PROGRAM ABORTED\n");
|
|
exit(1);
|
|
}
|
|
memset(t, 0, size);
|
|
return t;
|
|
}
|
|
|
|
void
|
|
zfree(p) void *p;
|
|
{
|
|
free(p);
|
|
}
|