1 /* aNetHack 0.0.1 panic.c $ANH-Date: 1448210012 2015/11/22 16:33:32 $ $ANH-Branch: master $:$ANH-Revision: 1.10 $ */
2 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3 /* aNetHack may be freely redistributed. See license for details. */
6 * This code was adapted from the code in end.c to run in a standalone
7 * mode for the makedefs / drg code.
14 #define abort() exit()
17 extern void NDECL(vms_abort
);
22 void VDECL(panic
, (char *, ...));
33 abort(); /* avoid loops - this should never happen*/
35 (void) fputs(" ERROR: ", stderr
);
36 Vfprintf(stderr
, str
, VA_ARGS
);
37 (void) fflush(stderr
);
38 #if defined(UNIX) || defined(VMS)
42 abort(); /* generate core dump */
45 exit(EXIT_FAILURE
); /* redundant */
50 * In case bison-generated foo_yacc.c tries to use alloca(); if we don't
51 * have it then just use malloc() instead. This may not work on some
52 * systems, but they should either use yacc or get a real alloca routine.
58 return cnt
? alloc(cnt
) : (long *) 0;