1 /* SCCS Id: @(#)panic.c 3.4 1994/03/02 */
2 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3 /* NetHack 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 *,...));
25 panic VA_DECL(char *,str)
32 abort(); /* avoid loops - this should never happen*/
34 (void) fputs(" ERROR: ", stderr);
35 Vfprintf(stderr, str, VA_ARGS);
36 (void) fflush(stderr);
37 #if defined(UNIX) || defined(VMS)
41 abort(); /* generate core dump */
44 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.
57 return cnt ? alloc(cnt) : (long *)0;