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